BiDirConn Class Reference
[Connection implementation classes and data]

A bidirectional (incoming and outgoing) connection. More...

#include <bidirconn.h>

Inheritance diagram for BiDirConn:

Inheritance graph
[legend]
Collaboration diagram for BiDirConn:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 BiDirConn (ConnectorP &)
 constructor
virtual ~BiDirConn () throw ()
 destructor
void add_encoder (Encoder *)
 Push a protocol-manager (Encoder) onto the set of encoders.
virtual std::string class_name (void) const
 Sub-class identification strings (abstract virtual).
virtual std::string get_id (void) const

Protected Member Functions

void start_engine (void)
virtual void stop_engine (void)
 Shutdown and detach the threads...
virtual void process_data (Data *)
 Process a data blob that's been read, before sending that data on to our recipients.

Private Member Functions

void * reader (void)
 The core of the reader thread.

Static Private Member Functions

static void * reader_thread (void *)
 C-binding caller of below reader() method.

Private Attributes

pthread_t tid_reader
 The pthread_t id of the reader thread...
std::set< Encoder * > encoders


Detailed Description

A bidirectional (incoming and outgoing) connection.

Definition at line 63 of file bidirconn.h.


Constructor & Destructor Documentation

BiDirConn::BiDirConn ( ConnectorP ourConnector  ) 

constructor

Definition at line 146 of file bidirconn.cc.

BiDirConn::~BiDirConn ( void   )  throw () [virtual]

destructor

/todo XXX - I think the "shutdown if connected" logic belongs in Connection, not here... Though, given destructor ordering, I'm not sure we'd be able to call subclass member functions from Connection::~Connection()...

Definition at line 160 of file bidirconn.cc.

References Connection::mutex, MUTEX_LOG, PTHREAD_CHECK_AND_THROW, and tid_reader.


Member Function Documentation

void BiDirConn::add_encoder ( Encoder e  ) 

Push a protocol-manager (Encoder) onto the set of encoders.

Definition at line 475 of file bidirconn.cc.

References encoders.

virtual std::string BiDirConn::class_name ( void   )  const [inline, virtual]

Sub-class identification strings (abstract virtual).

Reimplemented from Outlet.

Definition at line 73 of file bidirconn.h.

std::string BiDirConn::get_id ( void   )  const [virtual]

Reimplemented from Outlet.

Definition at line 483 of file bidirconn.cc.

References Connection::base.

Referenced by process_data(), reader(), MasterController::start_connections(), and stop_engine().

Here is the caller graph for this function:

void BiDirConn::start_engine ( void   )  [protected, virtual]

Start the reader() thread with pthread_create(), call Outlet::start_engine() to start the writer, and return.

Reimplemented from Outlet.

Definition at line 371 of file bidirconn.cc.

References PTHREAD_CHECK_AND_THROW, reader_thread(), Outlet::start_engine(), and tid_reader.

Here is the call graph for this function:

void * BiDirConn::reader_thread ( void *  instance  )  [static, private]

C-binding caller of below reader() method.

Definition at line 81 of file bidirconn.cc.

References fireball::bail(), and pthread_exception::what().

Referenced by start_engine().

Here is the call graph for this function:

Here is the caller graph for this function:

void * BiDirConn::reader ( void   )  [private]

The core of the reader thread.

Definition at line 388 of file bidirconn.cc.

References Connection::base, get_id(), Data::len(), Connection::note_disconnect(), process_data(), and Messager::send_message().

Here is the call graph for this function:

void BiDirConn::stop_engine ( void   )  [protected, virtual]

Shutdown and detach the threads...

Shut ourselves (our thread, aka "processing engine") down.

The mutex (Outlet::mutex) is expected to be unlocked.

Reimplemented from Outlet.

Definition at line 316 of file bidirconn.cc.

References Connection::base, get_id(), PTHREAD_CHECK_AND_THROW, Outlet::stop_engine(), tid_reader, and CMException::what().

Here is the call graph for this function:

void BiDirConn::process_data ( Data d  )  [protected, virtual]

Process a data blob that's been read, before sending that data on to our recipients.

Process the chunk of data that's been read from the Connector.

..

In theory, this could be a message, but it is most likely to be data to be sent to all of our receipients.

Definition at line 463 of file bidirconn.cc.

References get_id().

Referenced by reader().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

pthread_t BiDirConn::tid_reader [private]

The pthread_t id of the reader thread...

Definition at line 88 of file bidirconn.h.

Referenced by start_engine(), stop_engine(), and ~BiDirConn().

std::set<Encoder*> BiDirConn::encoders [private]

Definition at line 92 of file bidirconn.h.

Referenced by add_encoder().


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

Generated on Tue May 13 11:32:43 2008 for consmgr by  doxygen 1.5.5