24#ifndef _NETCOMM_FAWKES_MESSAGE_H_
25#define _NETCOMM_FAWKES_MESSAGE_H_
27#include <core/exceptions/software.h>
28#include <core/utils/refcount.h>
41 unsigned short int cid;
82 unsigned short int cid,
83 unsigned short int msg_id,
88 unsigned short int msg_id,
92 unsigned short int cid,
93 unsigned short int msg_id,
96 unsigned short int msg_id,
104 unsigned int clid()
const;
105 unsigned short int cid()
const;
106 unsigned short int msgid()
const;
118 template <
typename MT>
137 template <
typename MT>
157 template <
typename MT>
167 throw Exception(
"Unknown exception caught while parsing complex network message");
181 void init_cid_msgid(
unsigned short int cid,
unsigned short int msg_id);
Base class for exceptions in Fawkes.
Fawkes network message content.
The given message size exceeds the limit.
FawkesNetworkMessageTooBigException(size_t message_size)
Constructor.
Representation of a message that is sent over the network.
const fawkes_message_t & fmsg() const
Get message reference.
unsigned short int msgid() const
Get message type ID.
unsigned short int cid() const
Get component ID.
MT * msg() const
Get correctly casted payload.
MT * msgge() const
Get correctly casted payload.
void set_message_id(unsigned short int msg_id)
Set message type ID.
unsigned int clid() const
Get client ID.
void * payload() const
Get payload buffer.
virtual ~FawkesNetworkMessage()
Destructor.
size_t payload_size() const
Get payload size.
MT * msgc() const
Get correctly parsed output.
void set_client_id(unsigned int clid)
Set client ID.
void set_component_id(unsigned short int cid)
Set component ID.
void pack()
Pack data for sending.
FawkesNetworkMessage()
Constructor.
void set(fawkes_message_t &msg)
Set from message.
void set_payload(void *payload, size_t payload_size)
Set payload.
void set_content(FawkesNetworkMessageContent *content)
Set complex message content.
Reference counting base class.
Fawkes library namespace.
Message as stored in local queues.
fawkes_message_header_t header
message header
void * payload
message payload