Main Page | Modules | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

CommPortal Class Reference
[Communications Facilities]

#include <CommPortal.hh>

Inherited by FileCommPortal.

List of all members.


Detailed Description

Virtual abstract class for a messager modality.

The CommPortal class abstracts a messaging modality. It provides a way to receive and send messages to remote managers. The idea is that some classes of RemoteManager share a single nexus for sending and receiving data (i.e., many remote managers, one UDP socket managed by one CommMessenger sub-class).


Public Member Functions

 CommPortal ()
virtual ~CommPortal ()
bool init (CommManager *mgr)
CommManagergetManager () const
virtual MessagereceiveMsg ()=0
virtual bool releaseMsg (Message *message)=0
virtual bool flush ()=0

Static Public Member Functions

utils::Generator< CommPortal > * generator (utils::SymbolTable *table)
CommPortalgenerate (const char *spec_string, utils::SymbolTable *table)

Protected Attributes

CommManager_mgr
 The messager's communication manager.


Constructor & Destructor Documentation

CommPortal::CommPortal  )  [inline]
 

Build an unattached communications nexus

virtual CommPortal::~CommPortal  )  [inline, virtual]
 

Empty virtual destructor needed for C++ syntax reasons


Member Function Documentation

virtual bool CommPortal::flush  )  [pure virtual]
 

Flush message sends. If we are packaging or buffering message sends, force the real sends.

Returns:
Returns true for success and false for failure

Implemented in NetCommPortal, and SerialCommPortal.

CommPortal* CommPortal::generate const char *  spec_string,
utils::SymbolTable *  table
[static]
 

Create a portal given a spec string and a symbol table

Parameters:
[in] spec_string The specification string
[in] table The symbol table
Returns:
Returns the remote manager generated from the specificaiton string, or NULL if there was an error.

utils::Generator<CommPortal>* CommPortal::generator utils::SymbolTable *  table  )  [static]
 

Get the communications portal generator from the symbol table.

Parameters:
[in] table The symbol table
Returns:
Returns (creating if necessary) the generator.

CommManager* CommPortal::getManager  )  const [inline]
 

Return the communications manager.

Returns:
The messager's manager.

bool CommPortal::init CommManager mgr  ) 
 

Initialize the messager. Connect it to a CommManager and do any other necessary bookkeeping.

Parameters:
[in] mgr The controller communications manager
Returns:
true for success, false for fatal failure

virtual Message* CommPortal::receiveMsg  )  [pure virtual]
 

Receive a message, blocking until one is available.

Returns:
Returns NULL for failure, and the next available message on success

Implemented in NetCommPortal, and SerialCommPortal.

virtual bool CommPortal::releaseMsg Message message  )  [pure virtual]
 

Release a message received by CommPortal::receiveMsg. If you do not do this when you are done with a message, there will be a memory leak.

Parameters:
[in] message The message to be released.
Returns:
Return true for success and false for failure.

Implemented in NetCommPortal, and SerialCommPortal.


RHexLib Reference Documentation