hamcast  Version 0.7
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
hamcast::ipc::client_channel Class Reference

#include <client_channel.hpp>

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

Public Types

typedef intrusive_ptr
< client_channel
ptr
 
- Public Types inherited from hamcast::ipc::channel
typedef intrusive_ptr< channelptr
 

Public Member Functions

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)
 
virtual void register_callback (const membership_event_callback &cb)
 
- Public Member Functions inherited from hamcast::ref_counted
long ref_count ()
 

Static Public Member Functions

static ptr get ()
 
- Static Public Member Functions inherited from hamcast::ref_counted
static void add_ref (ref_counted *rc)
 
static void release (ref_counted *rc)
 

Protected Member Functions

virtual void ipc_read ()
 
virtual void poll_messages (size_t num)
 
virtual void on_exit (const std::string &)
 
- Protected Member Functions inherited from hamcast::ipc::channel
 channel (const util::source::ptr &in, const util::sink::ptr &out, int ms_poll_timeout=-1)
 
 channel (const std::pair< util::source::ptr, util::sink::ptr > &io_pair)
 
void notify_message (size_t num=1)
 
- Protected Member Functions inherited from hamcast::ref_counted
 ref_counted ()
 
void ref ()
 
bool deref ()
 

Detailed Description

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

Member Typedef Documentation

A smart pointer for client_channel instances.

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::ipc_read ( )
protectedvirtual

Reads data form the IPC channel via m_source.

Implements hamcast::ipc::channel.

void hamcast::ipc::client_channel::on_exit ( const std::string &  err_str)
protectedvirtual

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

Parameters
err_strOccurred error.

Reimplemented from hamcast::ipc::channel.

void hamcast::ipc::client_channel::poll_messages ( size_t  num)
protectedvirtual

Reads num messages from the channel's queue.

Implements hamcast::ipc::channel.

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

Register cb.

Parameters
cbMembership event callback.
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
sockThe ID of the outgoing multicast socket.
streamThe ID of the output stream.
ct_sizeThe size of ct.
ctThe content of the data package.
Warning
client_channel takes ownership of ct
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_idThe ID of the function this IP-call should invoke.
send_bufferThe serialized arguments of this IP-call.
Returns
The result of the IP-call
Exceptions
Anyexception that might occur during the invocation of the IP-call.

The documentation for this class was generated from the following files: