fprime/Fw/Fpy/StatementArgBuffer.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

40 lines
1.1 KiB
C++

#ifndef FW_STATEMENT_BUFFER_HPP
#define FW_STATEMENT_BUFFER_HPP
#include <Fw/FPrimeBasicTypes.hpp>
#include <Fw/Types/SerIds.hpp>
#include <Fw/Types/Serializable.hpp>
namespace Fw {
class StatementArgBuffer : public SerializeBufferBase {
public:
enum {
SERIALIZED_TYPE_ID = FW_TYPEID_TLM_BUFF,
SERIALIZED_SIZE = FW_STATEMENT_ARG_BUFFER_MAX_SIZE + sizeof(FwBuffSizeType)
};
StatementArgBuffer(const U8* args, FwSizeType size);
StatementArgBuffer();
StatementArgBuffer(const StatementArgBuffer& other);
virtual ~StatementArgBuffer();
StatementArgBuffer& operator=(const StatementArgBuffer& other);
DEPRECATED(Serializable::SizeType getBuffCapacity() const, "Use getCapacity() instead");
Serializable::SizeType getCapacity() const; // !< returns capacity, not current size, of buffer
U8* getBuffAddr();
const U8* getBuffAddr() const;
bool operator==(const StatementArgBuffer& other) const;
#if FW_SERIALIZABLE_TO_STRING
void toString(Fw::StringBase& text) const;
#endif
private:
U8 m_bufferData[FW_STATEMENT_ARG_BUFFER_MAX_SIZE]; // command argument buffer
};
} // namespace Fw
#endif