Public Types | Public Member Functions | Protected Member Functions

hamcast::ipc::channel Class Reference

An IPC channel. More...

#include <channel.hpp>

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

List of all members.

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)

Detailed Description

An IPC channel.

This class describes an abstract IPC channel that manages an IPC connection.

Note:
An IPC channel runs two threads (for sending and receiving IPC messages from its socket).

Member Typedef Documentation

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

A smart pointer to an instance of channel.

Reimplemented in hamcast::ipc::client_channel.


Constructor & Destructor Documentation

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.

Parameters:
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.

Parameters:
io_pair io_pair.first is the input source for this and io_pair.second is the output sink for this.

Member Function Documentation

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.


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