DUNE: Uniform Navigational Environment  2.4.0
DUNE::IMC::Packet Class Reference

Static Public Member Functions

static uint16_t serialize (const Message *msg, uint8_t *bfr, uint16_t size)
 
static uint16_t serialize (const Message *msg, Utils::ByteBuffer &bfr)
 
static uint16_t serialize (const Message *msg, std::ostream &ofs)
 
static Messagedeserialize (const uint8_t *bfr, uint16_t bfr_len, Message *msg=NULL)
 
static Messagedeserialize (std::istream &ifs)
 
static Messagedeserialize (std::istream &ifs, Utils::ByteBuffer &bfr)
 
static uint16_t serializeHeader (const Message *msg, uint8_t *bfr, uint16_t bfr_len)
 
static void deserializeHeader (Header &hdr, const uint8_t *bfr, uint16_t bfr_len)
 
static MessagedeserializePayload (const Header &hdr, const uint8_t *bfr, uint16_t bfr_len, Message *msg)
 

Member Function Documentation

Message * DUNE::IMC::Packet::deserialize ( const uint8_t *  bfr,
uint16_t  bfr_len,
Message msg = NULL 
)
static
Message * DUNE::IMC::Packet::deserialize ( std::istream &  ifs)
static
uint16_t DUNE::IMC::Packet::serialize ( const Message msg,
uint8_t *  bfr,
uint16_t  size 
)
static

Serialize a message object.

Parameters
[in]msgmessage object.
[out]bfrdestination buffer.
[in]sizedestination buffer size.
Returns
number of bytes written to the destination buffer.

References DUNE::Algorithms::CRC16::compute(), DUNE::IMC::Message::getSerializationSize(), DUNE::IMC::serialize(), DUNE::IMC::Message::serializeFields(), and serializeHeader().

Referenced by DUNE::Tasks::SimpleTransport::consume(), and serialize().

uint16_t DUNE::IMC::Packet::serialize ( const Message msg,
Utils::ByteBuffer bfr 
)
static

Serialize a message object.

Parameters
[in]msgmessage object.
[out]bfrdestination buffer.
Returns
number of bytes written to the destination buffer.

References DUNE::Utils::ByteBuffer::getBuffer(), DUNE::IMC::Message::getSerializationSize(), serialize(), and DUNE::Utils::ByteBuffer::setSize().

uint16_t DUNE::IMC::Packet::serialize ( const Message msg,
std::ostream &  ofs 
)
static

Serialize a message object.

Parameters
[in]msgmessage object.
[out]ofsdestination output stream.
Returns
number of bytes written to the destination output stream.

References DUNE::IMC::Message::getSerializationSize(), and serialize().

Collaboration diagram for DUNE::IMC::Packet:
Collaboration graph