#include <message.hpp>
|
static ptr | create (message_type mtype, boost::uint16_t field1, boost::uint32_t field2, boost::uint32_t field3, boost::uint32_t ct_size, char *ct) |
|
static ptr | create (message_type mtype, boost::uint16_t field1, boost::uint32_t field2, boost::uint32_t field3, const std::pair< size_t, void * > &ct) |
|
static void | add_ref (ref_counted *rc) |
|
static void | release (ref_counted *rc) |
|
Describes a single IPC message.
See Structure of an IPC message for detailed description and usage.
A smart pointer to an instance of message.
const char* hamcast::ipc::message::content |
( |
| ) |
const |
Get the content of this message.
- Returns
- The internal C-buffer.
boost::uint32_t hamcast::ipc::message::content_size |
( |
| ) |
const |
message::ptr hamcast::ipc::message::create |
( |
message_type |
mtype, |
|
|
boost::uint16_t |
field1, |
|
|
boost::uint32_t |
field2, |
|
|
boost::uint32_t |
field3, |
|
|
boost::uint32_t |
ct_size, |
|
|
char * |
ct |
|
) |
| |
|
static |
Create an IPC message.
- Parameters
-
mtype | The type of this IPC message. |
field1 | First message field (16 bit). |
field2 | Second message field (32 bit). |
field3 | Third message field (32 bit). |
ct_size | The size of ct . |
ct | The content of this IPC message. |
- Precondition
(ct != NULL && ct_size > 0)
or (ct == NULL && ct_size == 0)
.
-
mtype
is a valid message type.
- Warning
- ipc_message takes ownership of
ct
if ct != NULL
-
ct
should be allocated with new char[...]
because the dtor calls delete[] ct;
.
- Returns
- A smart pointer to the newly created message object.
static ptr hamcast::ipc::message::create |
( |
message_type |
mtype, |
|
|
boost::uint16_t |
field1, |
|
|
boost::uint32_t |
field2, |
|
|
boost::uint32_t |
field3, |
|
|
const std::pair< size_t, void * > & |
ct |
|
) |
| |
|
static |
Create an IPC message.
This is a convenient function that calls create(mtype, field1, field2, field3, ct.first, ct.second).
- Parameters
-
mtype | The type of this IPC message. |
field1 | First message field (16 bit). |
field2 | Second message field (32 bit). |
field3 | Third message field (32 bit). |
ct | A pair describing the content as {size, data}. |
- Returns
- A smart pointer to the newly created message object.
size_t hamcast::ipc::message::size |
( |
| ) |
const |
Get the full size of this message (content + header).
- Returns
header_size + content_size()
Get the value of the message type
field.
- Returns
- The message_type of
this
.
const size_t hamcast::ipc::message::header_size |
|
static |
Initial value:=
(2 * sizeof(boost::uint16_t)) + (3 * sizeof(boost::uint32_t))
The size of an IPC message header in bytes.
The documentation for this class was generated from the following files:
- hamcast/ipc/message.hpp
- src/message.cpp