![]() |
F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
|
A data product Container. More...
#include <Fw/Dp/DpContainer.hpp>
Classes | |
| struct | Header |
| A DpContainer packet header. More... | |
Public Member Functions | |
| DpContainer (FwDpIdType id, const Fw::Buffer &buffer) | |
| Constructor for initialized container. More... | |
| DpContainer () | |
| Constructor for container with default initialization. More... | |
| virtual | ~DpContainer () |
| Destructor. More... | |
| FwDpIdType | getId () const |
| FwSizeType | getDataSize () const |
| Fw::Buffer | getBuffer () const |
| FwSizeType | getPacketSize () const |
| Get the packet size corresponding to the data size. More... | |
| FwDpPriorityType | getPriority () const |
| Fw::Time | getTimeTag () const |
| Fw::DpState | getState () const |
| Get the product state. More... | |
| DpCfg::ProcType::SerialType | getProcTypes () const |
| DpState | getDpState () const |
| Get the data product state. More... | |
| Fw::SerializeStatus | deserializeHeader () |
| void | serializeHeader () |
| void | setId (FwDpIdType id) |
| Set the id. More... | |
| void | setPriority (FwDpPriorityType priority) |
| Set the priority. More... | |
| void | setTimeTag (Fw::Time timeTag) |
| Set the time tag. More... | |
| void | setProcTypes (DpCfg::ProcType::SerialType procTypes) |
| Set the processing types bit mask. More... | |
| void | setDpState (DpState dpState) |
| Set the data product state. More... | |
| void | setDataSize (FwSizeType dataSize) |
| Set the data size. More... | |
| void | setBuffer (const Buffer &buffer) |
| Set the packet buffer. More... | |
| void | shrinkBufferSize () |
| void | invalidateBuffer () |
| Invalidate the packet buffer. More... | |
| Utils::HashBuffer | getHeaderHash () const |
| Utils::HashBuffer | computeHeaderHash () const |
| void | setHeaderHash (const Utils::HashBuffer &hash) |
| Set the header hash. More... | |
| void | updateHeaderHash () |
| Compute and set the header hash. More... | |
| Success::T | checkHeaderHash (Utils::HashBuffer &storedHash, Utils::HashBuffer &computedHash) const |
| Check the header hash. More... | |
| FwSizeType | getDataHashOffset () const |
| Get the data hash offset. More... | |
| Utils::HashBuffer | getDataHash () const |
| Utils::HashBuffer | computeDataHash () const |
| void | setDataHash (Utils::HashBuffer hash) |
| Set the data hash. More... | |
| void | updateDataHash () |
| Update the data hash. More... | |
| Success::T | checkDataHash (Utils::HashBuffer &storedHash, Utils::HashBuffer &computedHash) const |
| Check the data hash. More... | |
Static Public Member Functions | |
| static constexpr FwSizeType | getPacketSizeForDataSize (FwSizeType dataSize) |
| Get the packet size for a given data size. More... | |
Public Attributes | |
| Header::UserData | m_userData |
| The user data. More... | |
Static Public Attributes | |
| static constexpr FwSizeType | HEADER_HASH_OFFSET = Header::SIZE |
| The header hash offset. More... | |
| static constexpr FwSizeType | DATA_OFFSET = HEADER_HASH_OFFSET + HASH_DIGEST_LENGTH |
| The data offset. More... | |
| static constexpr FwSizeType | MIN_PACKET_SIZE = Header::SIZE + 2 * HASH_DIGEST_LENGTH |
Protected Member Functions | |
| DpContainer & | operator= (const DpContainer &src)=default |
| Copy assignment operator. More... | |
Protected Attributes | |
| FwDpIdType | m_id |
| FwDpPriorityType | m_priority |
| The priority. More... | |
| Time | m_timeTag |
| The time tag. More... | |
| DpCfg::ProcType::SerialType | m_procTypes |
| The processing types. More... | |
| DpState | m_dpState |
| The data product state. More... | |
| FwSizeType | m_dataSize |
| The data size. More... | |
| Buffer | m_buffer |
| The packet buffer. More... | |
| Fw::ExternalSerializeBufferWithMemberCopy | m_dataBuffer |
Friends | |
| class | Fw::DpContainerTester |
A data product Container.
Definition at line 26 of file DpContainer.hpp.
| Fw::DpContainer::DpContainer | ( | FwDpIdType | id, |
| const Fw::Buffer & | buffer | ||
| ) |
Constructor for initialized container.
| id | The container id |
| buffer | The buffer |
Definition at line 19 of file DpContainer.cpp.
| Fw::DpContainer::DpContainer | ( | ) |
Constructor for container with default initialization.
Definition at line 28 of file DpContainer.cpp.
|
inlinevirtual |
Destructor.
Definition at line 81 of file DpContainer.hpp.
| Success::T Fw::DpContainer::checkDataHash | ( | Utils::HashBuffer & | storedHash, |
| Utils::HashBuffer & | computedHash | ||
| ) | const |
Check the data hash.
| storedHash | The stored hash (output) |
| computedHash | The computed hash (output) |
Definition at line 240 of file DpContainer.cpp.
| Success::T Fw::DpContainer::checkHeaderHash | ( | Utils::HashBuffer & | storedHash, |
| Utils::HashBuffer & | computedHash | ||
| ) | const |
Check the header hash.
| storedHash | The stored hash (output) |
| computedHash | The computed hash (output) |
Definition at line 193 of file DpContainer.cpp.
| Utils::HashBuffer Fw::DpContainer::computeDataHash | ( | ) | const |
| Utils::HashBuffer Fw::DpContainer::computeHeaderHash | ( | ) | const |
Compute the header hash from the header data
Definition at line 170 of file DpContainer.cpp.
| Fw::SerializeStatus Fw::DpContainer::deserializeHeader | ( | ) |
Deserialize the header from the packet buffer Buffer must be valid, and its size must be at least MIN_PACKET_SIZE Before calling this function, you should call checkHeaderHash() to check the header hash
Definition at line 38 of file DpContainer.cpp.
|
inline |
| Utils::HashBuffer Fw::DpContainer::getDataHash | ( | ) | const |
|
inline |
Get the data hash offset.
Definition at line 212 of file DpContainer.hpp.
|
inline |
|
inline |
Get the data product state.
Definition at line 127 of file DpContainer.hpp.
| Utils::HashBuffer Fw::DpContainer::getHeaderHash | ( | ) | const |
|
inline |
|
inline |
Get the packet size corresponding to the data size.
Definition at line 109 of file DpContainer.hpp.
|
inlinestatic |
Get the packet size for a given data size.
| dataSize | The data size |
Definition at line 243 of file DpContainer.hpp.
|
inline |
|
inline |
Get the processing types
Definition at line 124 of file DpContainer.hpp.
|
inline |
Get the product state.
Definition at line 120 of file DpContainer.hpp.
|
inline |
|
inline |
Invalidate the packet buffer.
Definition at line 185 of file DpContainer.hpp.
|
protecteddefault |
Copy assignment operator.
| void Fw::DpContainer::serializeHeader | ( | ) |
Serialize the header into the packet buffer and update the header hash Buffer must be valid, and its size must be at least MIN_PACKET_SIZE
Definition at line 89 of file DpContainer.cpp.
| void Fw::DpContainer::setBuffer | ( | const Buffer & | buffer | ) |
Set the packet buffer.
| buffer | The packet buffer |
Definition at line 122 of file DpContainer.cpp.
| void Fw::DpContainer::setDataHash | ( | Utils::HashBuffer | hash | ) |
|
inline |
|
inline |
Set the data product state.
| dpState | The data product state |
Definition at line 165 of file DpContainer.hpp.
| void Fw::DpContainer::setHeaderHash | ( | const Utils::HashBuffer & | hash | ) |
|
inline |
|
inline |
|
inline |
Set the processing types bit mask.
| procTypes | The processing types |
Definition at line 159 of file DpContainer.hpp.
|
inline |
| void Fw::DpContainer::shrinkBufferSize | ( | ) |
Shrink the Fw::Buffer size to match the DataSize in the container header
Definition at line 145 of file DpContainer.cpp.
| void Fw::DpContainer::updateDataHash | ( | ) |
Update the data hash.
Definition at line 236 of file DpContainer.cpp.
| void Fw::DpContainer::updateHeaderHash | ( | ) |
Compute and set the header hash.
Definition at line 189 of file DpContainer.cpp.
|
friend |
Definition at line 27 of file DpContainer.hpp.
|
static |
The data offset.
Definition at line 61 of file DpContainer.hpp.
|
static |
The header hash offset.
Definition at line 59 of file DpContainer.hpp.
|
protected |
The packet buffer.
Definition at line 289 of file DpContainer.hpp.
|
protected |
The data buffer We use member copy semantics because m_dataBuffer points into m_buffer, which is owned by this object
Definition at line 294 of file DpContainer.hpp.
|
protected |
The data size.
Definition at line 286 of file DpContainer.hpp.
|
protected |
The data product state.
Definition at line 283 of file DpContainer.hpp.
|
protected |
The container id This is a system-global id (component-local id + component base id)
Definition at line 271 of file DpContainer.hpp.
|
protected |
The priority.
Definition at line 274 of file DpContainer.hpp.
|
protected |
The processing types.
Definition at line 280 of file DpContainer.hpp.
|
protected |
The time tag.
Definition at line 277 of file DpContainer.hpp.
| Header::UserData Fw::DpContainer::m_userData |
The user data.
Definition at line 262 of file DpContainer.hpp.
|
static |
The minimum packet size Reserve space for the header, the header hash, and the data hash This is also the number of non-data bytes in the packet
Definition at line 65 of file DpContainer.hpp.