F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SmSignalBuffer.cpp
Go to the documentation of this file.
2 #include <Fw/Types/Assert.hpp>
3 
4 namespace Fw {
5 
6 SmSignalBuffer::SmSignalBuffer(const U8* args, Serializable::SizeType size) : m_bufferData{} {
7  FW_ASSERT(args != nullptr);
8  FW_ASSERT(size <= sizeof(this->m_bufferData));
10  FW_ASSERT(FW_SERIALIZE_OK == stat, static_cast<FwAssertArgType>(stat));
11 }
12 
13 SmSignalBuffer::SmSignalBuffer() : m_bufferData{} {}
14 
16 
18  FW_ASSERT(other.getBuffAddr() != nullptr);
19  FW_ASSERT(other.getBuffLength() <= sizeof(this->m_bufferData));
20 
21  SerializeStatus stat = SerializeBufferBase::setBuff(other.m_bufferData, other.getBuffLength());
22  FW_ASSERT(FW_SERIALIZE_OK == stat, static_cast<FwAssertArgType>(stat));
23 }
24 
26  if (this == &other) {
27  return *this;
28  }
29 
30  FW_ASSERT(other.getBuffAddr() != nullptr);
31  FW_ASSERT(other.getBuffLength() <= sizeof(this->m_bufferData));
32 
33  SerializeStatus stat = SerializeBufferBase::setBuff(other.m_bufferData, other.getBuffLength());
34  FW_ASSERT(FW_SERIALIZE_OK == stat, static_cast<FwAssertArgType>(stat));
35  return *this;
36 }
37 
39  return sizeof(this->m_bufferData);
40 }
41 
43  return this->m_bufferData;
44 }
45 
47  return this->m_bufferData;
48 }
49 
50 } // namespace Fw
Serialization/Deserialization operation was successful.
SerializeStatus
forward declaration for string
Serializable::SizeType getBuffLength() const
returns current buffer size
FwSizeType SizeType
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
SmSignalBuffer & operator=(const SmSignalBuffer &other)
SerializeStatus setBuff(const U8 *src, Serializable::SizeType length)
sets buffer contents and size
U8 * getBuffAddr()
gets buffer address for data filling
Serializable::SizeType getBuffCapacity() const
returns capacity, not current size, of buffer
#define FW_ASSERT(...)
Definition: Assert.hpp:14