F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
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.getSize() <= sizeof(this->m_bufferData));
20 
21  SerializeStatus stat = SerializeBufferBase::setBuff(other.m_bufferData, other.getSize());
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.getSize() <= sizeof(this->m_bufferData));
32 
33  SerializeStatus stat = SerializeBufferBase::setBuff(other.m_bufferData, other.getSize());
34  FW_ASSERT(FW_SERIALIZE_OK == stat, static_cast<FwAssertArgType>(stat));
35  return *this;
36 }
37 
39  return sizeof(this->m_bufferData);
40 }
41 
42 Serializable::SizeType SmSignalBuffer::getBuffCapacity() const {
43  return this->getCapacity();
44 }
45 
47  return this->m_bufferData;
48 }
49 
51  return this->m_bufferData;
52 }
53 
54 } // namespace Fw
Serialization/Deserialization operation was successful.
Serializable::SizeType getSize() const override
Get current buffer size.
SerializeStatus
forward declaration for string
FwSizeType SizeType
SerializeStatus setBuff(const U8 *src, Serializable::SizeType length) override
Set buffer contents from external source.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
SmSignalBuffer & operator=(const SmSignalBuffer &other)
Serializable::SizeType getCapacity() const
Get buffer capacity.
U8 * getBuffAddr()
Get buffer address for data filling (non-const version)
Implementation of malloc based allocator.
#define FW_ASSERT(...)
Definition: Assert.hpp:14