Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions

hamcast::ipc::client_channel Class Reference
[Inter-process communication.]

An IPC channel describing the connection from a client to the middleware. More...

#include <client_channel.hpp>

Inheritance diagram for hamcast::ipc::client_channel:
hamcast::ipc::channel hamcast::ref_counted

List of all members.

Public Types

typedef boost::intrusive_ptr
< client_channel
ptr

Public Member Functions

virtual void send (const message::ptr &what)
void send_async_data (socket_id sock, boost::uint16_t stream, boost::uint32_t ct_size, char *ct)
message::ptr send_sync_request (function_id sync_fun_id, const util::const_buffer &send_buffer)
void register_callback (const membership_event_callback &cb)

Static Public Member Functions

static ptr get ()

Protected Member Functions

virtual void send_loop ()
virtual void receive_loop ()
virtual void on_exit (const std::string &)

Detailed Description

An IPC channel describing the connection from a client to the middleware.


Member Typedef Documentation

typedef boost::intrusive_ptr<client_channel> hamcast::ipc::client_channel::ptr

A smart pointer for client_channel instances.

Reimplemented from hamcast::ipc::channel.


Member Function Documentation

client_channel::ptr hamcast::ipc::client_channel::get (  )  [static]

Get a channel that is connected to the middleware.

Returns:
A pointer to the singleton that guards the connection to the middleware.
void hamcast::ipc::client_channel::on_exit ( const std::string &  err_str  )  [protected, virtual]

Override this function if you want to run any cleanup code after the receive and send loop have exited.

Reimplemented from hamcast::ipc::channel.

void hamcast::ipc::client_channel::receive_loop (  )  [protected, virtual]

Receives IPC data (executed in an own thread).

Implements hamcast::ipc::channel.

void hamcast::ipc::client_channel::register_callback ( const membership_event_callback &  cb  ) 

Register cb.

Parameters:
cb Membership event callback.
void hamcast::ipc::client_channel::send ( const message::ptr what  )  [virtual]

Enqueue msg to the internal output buffer.

Implements hamcast::ipc::channel.

void hamcast::ipc::client_channel::send_async_data ( socket_id  sock,
boost::uint16_t  stream,
boost::uint32_t  ct_size,
char *  ct 
)

Send an asynchronous data package to the middleware.

Parameters:
sock The ID of the outgoing multicast socket.
stream The ID of the output stream.
ct_size The size of ct.
ct The content of the data package.
Warning:
client_channel takes ownership of ct
void hamcast::ipc::client_channel::send_loop (  )  [protected, virtual]

Sends IPC data (executed in an own thread).

Implements hamcast::ipc::channel.

message::ptr hamcast::ipc::client_channel::send_sync_request ( function_id  sync_fun_id,
const util::const_buffer send_buffer 
)

Send a synchronous request to the middleware.

Parameters:
sync_fun_id The ID of the function this IP-call should invoke.
send_buffer The serialized arguments of this IP-call.
Returns:
The result of the IP-call
Exceptions:
Any exception that might occur during the invocation of the IP-call.

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator