hamcast
Version 0.7
|
#include <channel.hpp>
Public Types | |
typedef intrusive_ptr< channel > | ptr |
Protected Member Functions | |
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) | |
virtual void | on_exit (const std::string &err_str) |
virtual void | ipc_read ()=0 |
virtual void | poll_messages (size_t num)=0 |
void | notify_message (size_t num=1) |
![]() | |
ref_counted () | |
void | ref () |
bool | deref () |
Additional Inherited Members | |
![]() | |
long | ref_count () |
![]() | |
static void | add_ref (ref_counted *rc) |
static void | release (ref_counted *rc) |
An IPC channel.
This class describes an abstract IPC channel that manages an IPC connection.
A smart pointer to an instance of channel.
|
protected |
Creates a channel that reads from in
and writes to out
.
in | The input source for this . |
out | The output sink for this . |
|
protected |
Creates a channel that reads from io_pair.first
and writes to io_pair.second
.
io_pair | io_pair.first is the input source for this and io_pair.second is the output sink for this . |
|
protectedpure virtual |
Reads data form the IPC channel via m_source
.
Implemented in hamcast::ipc::client_channel.
|
protected |
Notifies the channel about a new message.
num
< 32
|
protectedvirtual |
Override this function if you want to run any cleanup code after the receive and send loop have exited.
err_str | Occurred error. |
Reimplemented in hamcast::ipc::client_channel.
|
protectedpure virtual |
Reads num
messages from the channel's queue.
Implemented in hamcast::ipc::client_channel.