Communication Library for Autonomous Systems v1.0
Reliable and secure communication library for autonomous vehicle systems
|
Template class for network messages with Clock integration. More...
#include <message.h>
Public Types | |
enum class | Type : std::uint8_t { UNKNOWN = 0 , INVALID = 1 , INTEREST , RESPONSE , STATUS , REQ , KEY_RESPONSE } |
typedef Channel::Address | Origin |
typedef Channel::Physical_Address | Physical_Address |
typedef Channel::Port | Port |
typedef std::uint32_t | Unit |
typedef std::vector< std::uint8_t > | Array |
typedef std::chrono::microseconds | Microseconds |
Public Member Functions | |
Message (Type message_type, const Origin &origin, Unit unit, Microseconds period=ZERO, const void *value_data=nullptr, const unsigned int value_size=0) | |
Message (const Message &other) | |
Message ()=default | |
~Message ()=default | |
const Type & | message_type () const |
const Origin & | origin () const |
const Microseconds & | timestamp () const |
const Unit & | unit () const |
const Microseconds & | period () const |
const std::uint8_t * | value () const |
const unsigned int | value_size () const |
const void * | data () const |
const unsigned int | size () const |
const bool | external () const |
void | message_type (const Type message_type) |
void | origin (const Origin addr) |
void | timestamp (const Microseconds timestamp) |
void | unit (const Unit type) |
void | period (const Microseconds period) |
void | value (const void *data, const unsigned int size) |
void | external (const bool external) |
Static Public Member Functions | |
static Message | deserialize (const void *serialized, const unsigned int size) |
static Microseconds | getSynchronizedTimestamp () |
static bool | isClockSynchronized () |
Static Public Attributes | |
static constexpr Microseconds | ZERO = Microseconds::zero() |
Template class for network messages with Clock integration.
This Message class is integrated with the Clock singleton to provide synchronized timestamps across the distributed system. When messages are created, they automatically use the Clock's getSynchronizedTime() method instead of local system time, ensuring temporal consistency in a PTP-synchronized network.
Clock Integration Features:
|
strong |
Message< Channel >::Message | ( | Type | message_type, |
const Origin & | origin, | ||
Unit | unit, | ||
Microseconds | period = ZERO , |
||
const void * | value_data = nullptr , |
||
const unsigned int | value_size = 0 |
||
) |
|
static |
|
static |
|
staticconstexpr |