BusBricks: Message Class Reference
BusBricks  0.1
Customize bus-communication
Loading...
Searching...
No Matches
Message Class Reference

Represents a message with information for sender and receiver, and provides methods for converting between PDU and message content. More...

Inheritance diagram for Message:
[legend]
Collaboration diagram for Message:
[legend]

Public Member Functions

 Message ()
 Default constructor for Message.
 
 ~Message ()
 Destroy the Message object.
 
 Message (bool boolean_expression)
 Constructor for Message from a boolean expression.
 
 Message (String *representation)
 Constructor for Message from a string-formatted PDU.
 
 Message (Message_content_t *message_content)
 Constructor for Message from Message_content_t.
 
String to_string ()
 Converts the message to a string representation.
 
- Public Member Functions inherited from Content< Message_content_t, String >
 Content (Message_content_t content)
 Construct a new Content object from an instance from type content_type (content itself)
 
 Content (String representation)
 Construct a new Content object from it's representation from type representation_type.
 
Stringget_representation ()
 Get the address of the informations representation of type representation-type.
 
Message_content_tget_content ()
 Get the address of the informations content of type content_type.
 
bool isValid ()
 Representation and Content of the object are existent (not default)
 

Additional Inherited Members

- Protected Member Functions inherited from Content< Message_content_t, String >
- Protected Attributes inherited from Content< Message_content_t, String >
Message_content_t content
 Content of an information (view on information (content) closer to Service-Layer)

 
String representation
 Representation of an information (view on information (content) closer to physical layer)

 

Detailed Description

Represents a message with information for sender and receiver, and provides methods for converting between PDU and message content.

This class handles the mapping between string-formatted PDUs (Representation) and text messages with sender- and receiver information (Content). It offers constructors for creating Message objects from different types of inputs and provides methods to convert between a message's content and its PDU representation.

Note
The Message class inherits from Content<Message_content_t, String>, providing a specialized implementation for handling messages.

Constructors

Methods

  • String to_string(): Returns a string representation of the message.
  • void rep_to_content(): Converts the byte-representation (PDU) to message content. This method is overridden from the base class Content.
  • void content_to_rep(): Converts message content to byte-representation (PDU). This method is overridden from the base class Content.

Constructor & Destructor Documentation

◆ Message() [1/4]

Message::Message ( )

Default constructor for Message.

Initializes an empty message.

◆ Message() [2/4]

Message::Message ( bool boolean_expression)

Constructor for Message from a boolean expression.

Constructs a message with default content if the boolean expression is true.

Parameters
boolean_expressionA boolean value determining whether to initialize the message with default content.

◆ Message() [3/4]

Message::Message ( String * representation)

Constructor for Message from a string-formatted PDU.

Initializes the message based on the provided string representation of the PDU.

Parameters
representationA pointer to the string-formatted PDU.

◆ Message() [4/4]

Message::Message ( Message_content_t * message_content)

Constructor for Message from Message_content_t.

Initializes the message using the provided Message_content_t structure.

Parameters
message_contentA pointer to the Message_content_t structure containing the message details.

Member Function Documentation

◆ to_string()

String Message::to_string ( )

Converts the message to a string representation.

Returns
A String representing the message.

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