An IPC channel. More...
#include <channel.hpp>
Public Types | |
typedef boost::intrusive_ptr < channel > | ptr |
Public Member Functions | |
virtual void | send (const message::ptr &what)=0 |
Protected Member Functions | |
channel (const util::source::ptr &in, const util::sink::ptr &out) | |
channel (const std::pair< util::source::ptr, util::sink::ptr > &io_pair) | |
virtual void | send_loop ()=0 |
virtual void | receive_loop ()=0 |
virtual void | on_exit (const std::string &err_str) |
An IPC channel.
This class describes an abstract IPC channel that manages an IPC connection.
typedef boost::intrusive_ptr<channel> hamcast::ipc::channel::ptr |
A smart pointer to an instance of channel.
Reimplemented in hamcast::ipc::client_channel.
hamcast::ipc::channel::channel | ( | const util::source::ptr & | in, | |
const util::sink::ptr & | out | |||
) | [protected] |
Creates a channel that reads from in
and writes to out
.
in | The input source for this . | |
out | The output sink for this . |
hamcast::ipc::channel::channel | ( | const std::pair< util::source::ptr, util::sink::ptr > & | io_pair | ) | [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 . |
void hamcast::ipc::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 in hamcast::ipc::client_channel.
virtual void hamcast::ipc::channel::receive_loop | ( | ) | [protected, pure virtual] |
Receives IPC data (executed in an own thread).
Implemented in hamcast::ipc::client_channel.
virtual void hamcast::ipc::channel::send | ( | const message::ptr & | what | ) | [pure virtual] |
Enqueue msg
to the internal output buffer.
Implemented in hamcast::ipc::client_channel.
virtual void hamcast::ipc::channel::send_loop | ( | ) | [protected, pure virtual] |
Sends IPC data (executed in an own thread).
Implemented in hamcast::ipc::client_channel.