My Project
Loading...
Searching...
No Matches
Public Member Functions | List of all members
MessageAssembler Class Reference
Collaboration diagram for MessageAssembler:
Collaboration graph

Public Member Functions

std::optional< std::string > addFragment (const MessageFrame &frame)
 Adds a fragment to the assembler.
 
bool isMessageComplete (const std::string &messageId) const
 Checks if message is complete.
 
std::optional< std::string > getAssembledMessage (const std::string &messageId)
 Gets the complete assembled message.
 
std::optional< MessageType > getMessageType (const std::string &messageId) const
 Gets the message type of completed message.
 
void cleanup (const std::string &messageId)
 Cleans up message fragments after processing.
 
size_t getIncompleteMessageCount () const
 Gets number of incomplete messages.
 

Member Function Documentation

◆ addFragment()

std::optional< std::string > MessageAssembler::addFragment ( const MessageFrame frame)

Adds a fragment to the assembler.

Parameters
frameThe message frame fragment
Returns
An optional containing the message ID if the message is complete, otherwise std::nullopt

◆ cleanup()

void MessageAssembler::cleanup ( const std::string &  messageId)

Cleans up message fragments after processing.

Parameters
messageIdThe message ID to cleanup

◆ getAssembledMessage()

std::optional< std::string > MessageAssembler::getAssembledMessage ( const std::string &  messageId)

Gets the complete assembled message.

Parameters
messageIdThe message ID
Returns
Optional containing the complete assembled payload, or std::nullopt if message not complete

◆ getIncompleteMessageCount()

size_t MessageAssembler::getIncompleteMessageCount ( ) const

Gets number of incomplete messages.

Returns
Number of incomplete messages

◆ getMessageType()

std::optional< MessageType > MessageAssembler::getMessageType ( const std::string &  messageId) const

Gets the message type of completed message.

Parameters
messageIdThe message ID
Returns
Optional containing the message type, or std::nullopt if message not found

◆ isMessageComplete()

bool MessageAssembler::isMessageComplete ( const std::string &  messageId) const

Checks if message is complete.

Parameters
messageIdThe message ID to check
Returns
true if message is complete

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