F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
ComBuffer.hpp
Go to the documentation of this file.
1 /*
2  * FwComBuffer.hpp
3  *
4  * Created on: May 24, 2014
5  * Author: tcanham
6  */
7 
8 /*
9  * Description:
10  * This object contains the ComBuffer type, used for sending and receiving packets from the ground
11  */
12 #ifndef FW_COM_BUFFER_HPP
13 #define FW_COM_BUFFER_HPP
14 
15 #include <Fw/FPrimeBasicTypes.hpp>
17 
18 namespace Fw {
19 
20 class ComBuffer final : public SerializeBufferBase {
21  public:
22  enum {
24  SERIALIZED_SIZE = FW_COM_BUFFER_MAX_SIZE + sizeof(FwBuffSizeType) // size of buffer + storage of size word
25  };
26 
27  ComBuffer(const U8* args, FwSizeType size);
28  ComBuffer();
29  ComBuffer(const ComBuffer& other);
30  virtual ~ComBuffer();
31  ComBuffer& operator=(const ComBuffer& other);
32 
33  DEPRECATED(FwSizeType getBuffCapacity() const, "Use getCapacity() instead");
34  FwSizeType getCapacity() const; // !< returns capacity, not current size, of buffer
35 
36  U8* getBuffAddr();
37  const U8* getBuffAddr() const;
38 
39  private:
40  U8 m_bufferData[FW_COM_BUFFER_MAX_SIZE]; // packet data buffer
41 };
42 
43 } // namespace Fw
44 
45 #endif
PlatformSizeType FwSizeType
virtual ~ComBuffer()
Definition: ComBuffer.cpp:13
FwSizeStoreType FwBuffSizeType
DEPRECATED(FwSizeType getBuffCapacity() const, "Use getCapacity() instead")
U8 * getBuffAddr()
Get buffer address for data filling (non-const version)
Definition: ComBuffer.cpp:42
ComBuffer & operator=(const ComBuffer &other)
Definition: ComBuffer.cpp:20
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
FwSizeType getCapacity() const
Get buffer capacity.
Definition: ComBuffer.cpp:30
Implementation of malloc based allocator.