24 #include <core/exception.h> 26 #include <netcomm/fawkes/message.h> 27 #include <netcomm/fawkes/message_content.h> 29 #include <netinet/in.h> 49 :
Exception(
"Network message size too big")
52 append(
"Tried to create message of %l bytes, while only %l bytes allowed", message_size,
89 memset(&_msg, 0,
sizeof(_msg));
127 void *payload,
size_t payload_size)
206 unsigned short int cid,
unsigned short int msg_id,
227 unsigned short int cid,
unsigned short int msg_id,
228 void *payload,
size_t payload_size)
249 unsigned short int cid,
unsigned short int msg_id)
265 if ( _content == NULL ) {
411 if ( _content != NULL ) {
void * payload() const
Get payload buffer.
void set_content(FawkesNetworkMessageContent *content)
Set complex message content.
void set_client_id(unsigned int clid)
Set client ID.
virtual ~FawkesNetworkMessage()
Destructor.
unsigned short int cid() const
Get component ID.
fawkes_message_header_t header
message header
Fawkes library namespace.
unsigned int clid() const
Get client ID.
Fawkes network message content.
FawkesNetworkMessage()
Constructor.
void set_component_id(unsigned short int cid)
Set component ID.
void pack()
Pack data for sending.
void set_message_id(unsigned short int msg_id)
Set message type ID.
virtual void serialize()=0
Serialize message content.
Base class for exceptions in Fawkes.
Message as stored in local queues.
virtual void * payload()
Return pointer to payload.
void * payload
message payload
const fawkes_message_t & fmsg() const
Get message reference.
FawkesNetworkMessageTooBigException(size_t message_size)
Constructor.
void set_payload(void *payload, size_t payload_size)
Set payload.
virtual size_t payload_size()
Return payload size.
unsigned short int msgid() const
Get message type ID.
The given message size exceeds the limit.
void set(fawkes_message_t &msg)
Set from message.
MT * msg() const
Get correctly casted payload.
void append(const char *format,...)
Append messages to the message list.
size_t payload_size() const
Get payload size.