Ember
Loading...
Searching...
No Matches
Ember::Network::MessageFrame Struct Reference

#include <MessageFrame.h>

Public Member Functions

 MessageFrame ()=default
 MessageFrame (Protocol::MessageType type, const uint8_t *data, size_t size)
 MessageFrame (Protocol::MessageType type, std::vector< uint8_t > &&data)
std::vector< uint8_t > ToBytes () const
bool IsValid () const
size_t TotalSize () const

Static Public Member Functions

static bool ParseHeader (const uint8_t *data, size_t dataSize, uint32_t &outLength, Protocol::MessageType &outType)
static MessageFrame FromBytes (const uint8_t *data, size_t dataSize)

Public Attributes

uint32_t payloadLength = 0
Protocol::MessageType messageType = Protocol::MessageType_Error
std::vector< uint8_t > payload

Detailed Description

Definition at line 14 of file MessageFrame.h.

Constructor & Destructor Documentation

◆ MessageFrame() [1/3]

Ember::Network::MessageFrame::MessageFrame ( )
default

◆ MessageFrame() [2/3]

Ember::Network::MessageFrame::MessageFrame ( Protocol::MessageType type,
const uint8_t * data,
size_t size )
inline

Definition at line 21 of file MessageFrame.h.

◆ MessageFrame() [3/3]

Ember::Network::MessageFrame::MessageFrame ( Protocol::MessageType type,
std::vector< uint8_t > && data )
inline

Definition at line 24 of file MessageFrame.h.

Member Function Documentation

◆ FromBytes()

MessageFrame Ember::Network::MessageFrame::FromBytes ( const uint8_t * data,
size_t dataSize )
inlinestatic

Definition at line 56 of file MessageFrame.h.

◆ IsValid()

bool Ember::Network::MessageFrame::IsValid ( ) const
inline

Definition at line 70 of file MessageFrame.h.

◆ ParseHeader()

bool Ember::Network::MessageFrame::ParseHeader ( const uint8_t * data,
size_t dataSize,
uint32_t & outLength,
Protocol::MessageType & outType )
inlinestatic

Definition at line 43 of file MessageFrame.h.

◆ ToBytes()

std::vector< uint8_t > Ember::Network::MessageFrame::ToBytes ( ) const
inline

Definition at line 27 of file MessageFrame.h.

◆ TotalSize()

size_t Ember::Network::MessageFrame::TotalSize ( ) const
inline

Definition at line 72 of file MessageFrame.h.

Member Data Documentation

◆ messageType

Protocol::MessageType Ember::Network::MessageFrame::messageType = Protocol::MessageType_Error

Definition at line 16 of file MessageFrame.h.

◆ payload

std::vector<uint8_t> Ember::Network::MessageFrame::payload

Definition at line 17 of file MessageFrame.h.

◆ payloadLength

uint32_t Ember::Network::MessageFrame::payloadLength = 0

Definition at line 15 of file MessageFrame.h.


The documentation for this struct was generated from the following file: