fprime/Fw/Prm/PrmExternalTypes.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

51 lines
2.1 KiB
C++

// ============================================================================
// @file PrmExternalTypes.hpp
// @author Brian Campuzano
// @brief Types for delegating parameter serialization and deserialization
// ============================================================================
#ifndef FW_EXTERNAL_PARAM_TYPES_HPP
#define FW_EXTERNAL_PARAM_TYPES_HPP
#include <Fw/Prm/ParamValidEnumAc.hpp>
#include <config/FpConfig.hpp>
#include "PrmBuffer.hpp"
namespace Fw {
//! Fw::ParamExternalDelegate is used for parameters that are stored and managed
//! externally to the owning F' component.
//!
//! Fw::ParamExternalDelegate is an abstract base class that defines the interfaces
//! needed by the F' component to interact with the externally managed parameter(s)
class ParamExternalDelegate {
public:
//! Deserialize a parameter from a parameter buffer
//!
//! \param base_id: The component base ID of the parameter being deserialized
//! \param local_id: The local parameter ID of the parameter being deserialized
//! \param prmStat: The parameter status of the parameter being deserialized
//! \param buff: The buffer contained the serialized parameter
//!
//! \return: The status of the deserialize operation
virtual SerializeStatus deserializeParam(const FwPrmIdType base_id,
const FwPrmIdType local_id,
const ParamValid prmStat,
SerialBufferBase& buff) = 0;
//! Serialize a parameter into a parameter buffer
//!
//! \param base_id: The component base ID of the parameter being deserialized
//! \param local_id: The local Parameter ID of the parameter to serialized
//! \param buff: The buffer to serialize the parameter into
//!
//! \return: The status of the serialize operation
virtual SerializeStatus serializeParam(const FwPrmIdType base_id,
const FwPrmIdType local_id,
SerialBufferBase& buff) const = 0;
};
} // namespace Fw
#endif