ST_engine  0.3-ALPHA
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
message Class Reference

A message object passed around in the message bus. Holds anything created with make_data<>(). More...

#include <message.hpp>

Public Member Functions

void * get_data () const
 
messagemake_copy () const
 
 message (uint8_t name, const std::shared_ptr< void > &data=nullptr)
 
 message (uint8_t name, uint32_t base_data0, const std::shared_ptr< void > &data=nullptr)
 

Static Public Member Functions

static void * operator new (size_t)
 
static void operator delete (void *)
 

Public Attributes

uint32_t base_data0 = 0
 
uint16_t base_data1 = 0
 
uint8_t base_data2 = 0
 
uint8_t msg_name {}
 

Detailed Description

A message object passed around in the message bus. Holds anything created with make_data<>().

Only use new message() and delete() for the creation of a message.

Definition at line 21 of file message.hpp.

Constructor & Destructor Documentation

◆ message()

message::message ( uint8_t  name,
const std::shared_ptr< void > &  data = nullptr 
)
inlineexplicit
Parameters
nameThe type of message. See ST::msg_type.
dataThe data the message carries - created with make_data<>() or is nullptr

Definition at line 44 of file message.hpp.

Member Function Documentation

◆ get_data()

void * message::get_data ( ) const
inline
Returns
The data contained within a message. Always a void* that MUST be properly cast to an actual type on the other end

Definition at line 80 of file message.hpp.

◆ make_copy()

message * message::make_copy ( ) const
inline
Returns
A copy of this message.

Definition at line 87 of file message.hpp.


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