F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
Fw::DpContainer Class Reference

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 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

DpContaineroperator= (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
 

Detailed Description

A data product Container.

Definition at line 21 of file DpContainer.hpp.

Constructor & Destructor Documentation

◆ DpContainer() [1/2]

Fw::DpContainer::DpContainer ( FwDpIdType  id,
const Fw::Buffer buffer 
)

Constructor for initialized container.

Parameters
idThe container id
bufferThe buffer

Definition at line 19 of file DpContainer.cpp.

◆ DpContainer() [2/2]

Fw::DpContainer::DpContainer ( )

Constructor for container with default initialization.

Definition at line 28 of file DpContainer.cpp.

◆ ~DpContainer()

virtual Fw::DpContainer::~DpContainer ( )
inlinevirtual

Destructor.

Definition at line 74 of file DpContainer.hpp.

Member Function Documentation

◆ checkDataHash()

Success::T Fw::DpContainer::checkDataHash ( Utils::HashBuffer storedHash,
Utils::HashBuffer computedHash 
) const

Check the data hash.

Parameters
storedHashThe stored hash (output)
computedHashThe computed hash (output)

Definition at line 228 of file DpContainer.cpp.

◆ checkHeaderHash()

Success::T Fw::DpContainer::checkHeaderHash ( Utils::HashBuffer storedHash,
Utils::HashBuffer computedHash 
) const

Check the header hash.

Parameters
storedHashThe stored hash (output)
computedHashThe computed hash (output)

Definition at line 181 of file DpContainer.cpp.

◆ computeDataHash()

Utils::HashBuffer Fw::DpContainer::computeDataHash ( ) const

Compute the data hash from the data

Returns
The hash

Definition at line 198 of file DpContainer.cpp.

◆ computeHeaderHash()

Utils::HashBuffer Fw::DpContainer::computeHeaderHash ( ) const

Compute the header hash from the header data

Returns
The hash

Definition at line 158 of file DpContainer.cpp.

◆ deserializeHeader()

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

Returns
The serialize status

Definition at line 38 of file DpContainer.cpp.

◆ getBuffer()

Fw::Buffer Fw::DpContainer::getBuffer ( ) const
inline

Get the packet buffer

Returns
The buffer

Definition at line 99 of file DpContainer.hpp.

◆ getDataHash()

Utils::HashBuffer Fw::DpContainer::getDataHash ( ) const

Get the stored data hash

Returns
The hash

Definition at line 187 of file DpContainer.cpp.

◆ getDataHashOffset()

FwSizeType Fw::DpContainer::getDataHashOffset ( ) const
inline

Get the data hash offset.

Definition at line 201 of file DpContainer.hpp.

◆ getDataSize()

FwSizeType Fw::DpContainer::getDataSize ( ) const
inline

Get the data size

Returns
The data size

Definition at line 95 of file DpContainer.hpp.

◆ getDpState()

DpState Fw::DpContainer::getDpState ( ) const
inline

Get the data product state.

Definition at line 120 of file DpContainer.hpp.

◆ getHeaderHash()

Utils::HashBuffer Fw::DpContainer::getHeaderHash ( ) const

Get the stored header hash

Returns
The hash

Definition at line 149 of file DpContainer.cpp.

◆ getId()

FwDpIdType Fw::DpContainer::getId ( ) const
inline

Get the container id

Returns
The id

Definition at line 91 of file DpContainer.hpp.

◆ getPacketSize()

FwSizeType Fw::DpContainer::getPacketSize ( ) const
inline

Get the packet size corresponding to the data size.

Definition at line 102 of file DpContainer.hpp.

◆ getPacketSizeForDataSize()

static constexpr FwSizeType Fw::DpContainer::getPacketSizeForDataSize ( FwSizeType  dataSize)
inlinestaticconstexpr

Get the packet size for a given data size.

Parameters
dataSizeThe data size

Definition at line 232 of file DpContainer.hpp.

◆ getPriority()

FwDpPriorityType Fw::DpContainer::getPriority ( ) const
inline

Get the priority

Returns
The priority

Definition at line 106 of file DpContainer.hpp.

◆ getProcTypes()

DpCfg::ProcType::SerialType Fw::DpContainer::getProcTypes ( ) const
inline

Get the processing types

Returns
The processing types

Definition at line 117 of file DpContainer.hpp.

◆ getState()

Fw::DpState Fw::DpContainer::getState ( ) const
inline

Get the product state.

Definition at line 113 of file DpContainer.hpp.

◆ getTimeTag()

Fw::Time Fw::DpContainer::getTimeTag ( ) const
inline

Get the time tag

Returns
The time tag

Definition at line 110 of file DpContainer.hpp.

◆ invalidateBuffer()

void Fw::DpContainer::invalidateBuffer ( )
inline

Invalidate the packet buffer.

Definition at line 174 of file DpContainer.hpp.

◆ operator=()

DpContainer& Fw::DpContainer::operator= ( const DpContainer src)
protecteddefault

Copy assignment operator.

◆ serializeHeader()

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 91 of file DpContainer.cpp.

◆ setBuffer()

void Fw::DpContainer::setBuffer ( const Buffer buffer)

Set the packet buffer.

Parameters
bufferThe packet buffer

Definition at line 126 of file DpContainer.cpp.

◆ setDataHash()

void Fw::DpContainer::setDataHash ( Utils::HashBuffer  hash)

Set the data hash.

Parameters
hashThe hash

Definition at line 210 of file DpContainer.cpp.

◆ setDataSize()

void Fw::DpContainer::setDataSize ( FwSizeType  dataSize)
inline

Set the data size.

Parameters
dataSizeThe data size

Definition at line 164 of file DpContainer.hpp.

◆ setDpState()

void Fw::DpContainer::setDpState ( DpState  dpState)
inline

Set the data product state.

Parameters
dpStateThe data product state

Definition at line 158 of file DpContainer.hpp.

◆ setHeaderHash()

void Fw::DpContainer::setHeaderHash ( const Utils::HashBuffer hash)

Set the header hash.

Parameters
hashThe hash

Definition at line 168 of file DpContainer.cpp.

◆ setId()

void Fw::DpContainer::setId ( FwDpIdType  id)
inline

Set the id.

Parameters
idThe id

Definition at line 134 of file DpContainer.hpp.

◆ setPriority()

void Fw::DpContainer::setPriority ( FwDpPriorityType  priority)
inline

Set the priority.

Parameters
priorityThe priority

Definition at line 140 of file DpContainer.hpp.

◆ setProcTypes()

void Fw::DpContainer::setProcTypes ( DpCfg::ProcType::SerialType  procTypes)
inline

Set the processing types bit mask.

Parameters
procTypesThe processing types

Definition at line 152 of file DpContainer.hpp.

◆ setTimeTag()

void Fw::DpContainer::setTimeTag ( Fw::Time  timeTag)
inline

Set the time tag.

Parameters
timeTagThe time tag

Definition at line 146 of file DpContainer.hpp.

◆ updateDataHash()

void Fw::DpContainer::updateDataHash ( )

Update the data hash.

Definition at line 224 of file DpContainer.cpp.

◆ updateHeaderHash()

void Fw::DpContainer::updateHeaderHash ( )

Compute and set the header hash.

Definition at line 177 of file DpContainer.cpp.

Member Data Documentation

◆ DATA_OFFSET

constexpr FwSizeType Fw::DpContainer::DATA_OFFSET = HEADER_HASH_OFFSET + HASH_DIGEST_LENGTH
staticconstexpr

The data offset.

Definition at line 54 of file DpContainer.hpp.

◆ HEADER_HASH_OFFSET

constexpr FwSizeType Fw::DpContainer::HEADER_HASH_OFFSET = Header::SIZE
staticconstexpr

The header hash offset.

Definition at line 52 of file DpContainer.hpp.

◆ m_buffer

Buffer Fw::DpContainer::m_buffer
protected

The packet buffer.

Definition at line 278 of file DpContainer.hpp.

◆ m_dataBuffer

Fw::ExternalSerializeBufferWithMemberCopy Fw::DpContainer::m_dataBuffer
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 283 of file DpContainer.hpp.

◆ m_dataSize

FwSizeType Fw::DpContainer::m_dataSize
protected

The data size.

Definition at line 275 of file DpContainer.hpp.

◆ m_dpState

DpState Fw::DpContainer::m_dpState
protected

The data product state.

Definition at line 272 of file DpContainer.hpp.

◆ m_id

FwDpIdType Fw::DpContainer::m_id
protected

The container id This is a system-global id (component-local id + component base id)

Definition at line 260 of file DpContainer.hpp.

◆ m_priority

FwDpPriorityType Fw::DpContainer::m_priority
protected

The priority.

Definition at line 263 of file DpContainer.hpp.

◆ m_procTypes

DpCfg::ProcType::SerialType Fw::DpContainer::m_procTypes
protected

The processing types.

Definition at line 269 of file DpContainer.hpp.

◆ m_timeTag

Time Fw::DpContainer::m_timeTag
protected

The time tag.

Definition at line 266 of file DpContainer.hpp.

◆ m_userData

Header::UserData Fw::DpContainer::m_userData

The user data.

Definition at line 251 of file DpContainer.hpp.

◆ MIN_PACKET_SIZE

constexpr FwSizeType Fw::DpContainer::MIN_PACKET_SIZE = Header::SIZE + 2 * HASH_DIGEST_LENGTH
staticconstexpr

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 58 of file DpContainer.hpp.


The documentation for this class was generated from the following files: