Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

strmod::strmod::ProcessorModule Class Reference

This wraps two objects that follow the unidirectional StreamProcessor interface in a StreamModule interface. More...

#include <StrMod/ProcessorModule.h>

Inheritance diagram for strmod::strmod::ProcessorModule:

Inheritance graph
[legend]
List of all members.

Public Types

enum  PlugSide { OneSide, OtherSide }
 Labels for the sides of this StreamModule implementation. More...


Public Methods

 ProcessorModule (StreamProcessor &from_one, StreamProcessor &from_other, bool own=true)
 Construct a ProcessorModule from the two given StreamProcessor objects.

virtual ~ProcessorModule ()
 Destruct a ProcessorModule, possibly deleting the associated StreamProcessor objects.

virtual int AreYouA (const lcore::ClassIdent &cid) const
 Asks if a class is of a particular type, or publicly derived from that type.

virtual bool canCreate (int side) const
 Can a plug be created on the given side?

virtual bool ownsPlug (const Plug *plug) const
 Does the module own this plug?

virtual bool deletePlug (Plug *plug)
 Please delete this plug.


Static Public Attributes

const STR_ClassIdent identifier
 A unique identifier for this class.


Protected Methods

virtual const lcore::ClassIdent * i_GetIdent () const
 Returns the class identifier for the class the object actually is.

virtual Plug * i_MakePlug (int side)
 Makes a plug on the given side.


Friends

class PMPlug

Detailed Description

This wraps two objects that follow the unidirectional StreamProcessor interface in a StreamModule interface.

Definition at line 53 of file ProcessorModule.h.


Member Enumeration Documentation

enum strmod::strmod::ProcessorModule::PlugSide
 

Labels for the sides of this StreamModule implementation.

Enumeration values:
OneSide  Distinguishable name.
OtherSide  Another distinguishable name.

Definition at line 61 of file ProcessorModule.h.


Constructor & Destructor Documentation

strmod::strmod::ProcessorModule::ProcessorModule StreamProcessor   from_one,
StreamProcessor   from_other,
bool    own = true
[inline]
 

Construct a ProcessorModule from the two given StreamProcessor objects.

Parameters:
from_one The StreamProcessor that will process data going from OneSide to OtherSide.
from_other The StreamProcessor that will process data going from OtherSide to OneSide.
own Whether or not this module 'owns' or assumes the duty of deleting the two passed in StreamProcessor objects.
Note:
If own is false, it's your responsibility to make sure the ProcessorModule goes away before the StreamProcessors do. If you're building a derived class, ~ProccesorModule is guaranteed not to require the StreamProcessors to exist if own is false.

Definition at line 173 of file ProcessorModule.h.

virtual strmod::strmod::ProcessorModule::~ProcessorModule   [inline, virtual]
 

Destruct a ProcessorModule, possibly deleting the associated StreamProcessor objects.

If created with own equal to false, this function guaranteed not to require subsidiary StreamProcessors to exist.

Definition at line 92 of file ProcessorModule.h.


Member Function Documentation

int strmod::strmod::ProcessorModule::AreYouA const lcore::ClassIdent &    cid const [inline, virtual]
 

Asks if a class is of a particular type, or publicly derived from that type.

Overriden in every derived class (with a static identifier member) to compare against the identifier, then call the AreYouA methods of all the superclasses.

Parameters:
cid Usually <class>::identifier for the class you want to ask if the object is an instance of.

Reimplemented from strmod::strmod::StreamModule.

Definition at line 186 of file ProcessorModule.h.

bool strmod::strmod::ProcessorModule::deletePlug Plug *    plug [virtual]
 

Please delete this plug.

Modules are supposed to own plugs, so you aren't supposed to delete them yourself.

Returns false on failure. Failure could happen because module does not own the plug.

Implements strmod::strmod::StreamModule.

Definition at line 46 of file ProcessorModule.cxx.

virtual const lcore::ClassIdent* strmod::strmod::ProcessorModule::i_GetIdent   const [inline, protected, virtual]
 

Returns the class identifier for the class the object actually is.

Should always be overridden in any class that has a static identifier member.

Reimplemented from strmod::strmod::StreamModule.

Definition at line 103 of file ProcessorModule.h.

StreamModule::Plug * strmod::strmod::ProcessorModule::i_MakePlug int    side [inline, protected, virtual]
 

Makes a plug on the given side.

Guaranteed to never be called if canCreate would return false. Must NEVER return 0 (NULL).

Implements strmod::strmod::StreamModule.

Definition at line 206 of file ProcessorModule.h.


The documentation for this class was generated from the following files:
Generated on Wed Jan 29 00:32:54 2003 for libNet by doxygen1.3-rc1