F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
StatementArgBuffer.cpp
Go to the documentation of this file.
2 #include <Fw/Types/Assert.hpp>
4 
5 namespace Fw {
6 
9  FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<FwAssertArgType>(stat));
10  }
11 
13  }
14 
16  }
17 
19  SerializeStatus stat = SerializeBufferBase::setBuff(other.m_bufferData,other.getBuffLength());
20  FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<FwAssertArgType>(stat));
21  }
22 
24  if(this == &other) {
25  return *this;
26  }
27 
28  SerializeStatus stat = SerializeBufferBase::setBuff(other.m_bufferData,other.getBuffLength());
29  FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<FwAssertArgType>(stat));
30  return *this;
31  }
32 
34  return sizeof(this->m_bufferData);
35  }
36 
38  return this->m_bufferData;
39  }
40 
42  return this->m_bufferData;
43  }
44 
46  if (this->getBuffLength() != other.getBuffLength()) {
47  return false;
48  }
49 
50  const U8* us = this->getBuffAddr();
51  const U8* them = other.getBuffAddr();
52 
53  FW_ASSERT(us);
54  FW_ASSERT(them);
55 
56  for (Serializable::SizeType byte = 0; byte < this->getBuffLength(); byte++) {
57  if (us[byte] != them[byte]) {
58  return false;
59  }
60  }
61 
62  return true;
63  }
64 
65 #if FW_SERIALIZABLE_TO_STRING
66  void StatementArgBuffer::toString(Fw::StringBase& text) const {
67  static const char * formatString = "(data = %p, size = %" PRI_FwSizeType ")";
68  text.format(formatString, &this->m_bufferData, this->getBuffLength());
69  }
70 #endif
71 }
72 
Serialization/Deserialization operation was successful.
PlatformSizeType FwSizeType
StatementArgBuffer & operator=(const StatementArgBuffer &other)
U8 * getBuffAddr()
gets buffer address for data filling
#define PRI_FwSizeType
SerializeStatus
forward declaration for string
Serializable::SizeType getBuffLength() const
returns current buffer size
Serializable::SizeType getBuffCapacity() const
returns capacity, not current size, of buffer
FwSizeType SizeType
bool operator==(const StatementArgBuffer &other) const
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:55
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:56
SerializeStatus setBuff(const U8 *src, Serializable::SizeType length)
sets buffer contents and size
Declares F Prime string base class.
#define FW_ASSERT(...)
Definition: Assert.hpp:14