fprime/Fw/Tlm/TlmBuffer.hpp
Vince Woo 48e4720419
Created new SerialBufferBase as a parent of SerializeBufferBase (now renamed LinearBufferBase). (#4288)
* Created new SerialBufferBase as a parent of SerializeBufferBase. Renaming interface functions to be less confusing.

* Deprecating copyRawOffset. No direct use-cases in F' core.

* Make SerialBufferBase a true pure virtual interface.

* Changing Serializable to work with SerialBufferBase parent interface.

* Changing copyRaw and copyRawOffset to work with SerialBufferBase

* Updating documentation for SerialBufferBase usage

* Adding some documentation. Adding missing ASSERT in copyRaw. Fixing some bugs that new ASSERT uncovered.

* Renaming SerializeBufferBase to LinearBufferBase. Add a using declaration to maintain backwards compatability. Properly mark LinearBufferBase functions as override.

* Filling in the rest of the docstrings for the classes in Serializable

* Removing redundant virtual keyword on override function

* Applying clang formatting

* Incorporating PR comments

* Fix compile issues

* Bump version to alpha

* Format

* v

---------

Co-authored-by: M Starch <LeStarch@googlemail.com>
2025-11-06 16:23:20 -08:00

43 lines
1.0 KiB
C++

/*
* TlmBuffer.hpp
*
* Author: tcanham
*/
/*
* Description:
* This object contains the TlmBuffer type, used for storing telemetry
*/
#ifndef FW_TLM_BUFFER_HPP
#define FW_TLM_BUFFER_HPP
#include <Fw/FPrimeBasicTypes.hpp>
#include <Fw/Types/SerIds.hpp>
#include <Fw/Types/Serializable.hpp>
namespace Fw {
class TlmBuffer final : public SerializeBufferBase {
public:
enum { SERIALIZED_TYPE_ID = FW_TYPEID_TLM_BUFF, SERIALIZED_SIZE = FW_TLM_BUFFER_MAX_SIZE + sizeof(FwBuffSizeType) };
TlmBuffer(const U8* args, FwSizeType size);
TlmBuffer();
TlmBuffer(const TlmBuffer& other);
virtual ~TlmBuffer();
TlmBuffer& operator=(const TlmBuffer& other);
DEPRECATED(FwSizeType getBuffCapacity() const, "Use getCapacity() instead");
FwSizeType getCapacity() const; // !< returns capacity, not current size, of buffer
U8* getBuffAddr();
const U8* getBuffAddr() const;
private:
U8 m_bufferData[FW_TLM_BUFFER_MAX_SIZE]; // command argument buffer
};
} // namespace Fw
#endif