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

strmod::strmod::StreamSplitterModule Class Reference

This module is for treating two uni-directional streams as one bi-directional stream. More...

#include <StrMod/StreamSplitter.h>

Inheritance diagram for strmod::strmod::StreamSplitterModule:

Inheritance graph
[legend]
List of all members.

Public Types

enum  Sides { SideIn, SideOut, SideBiDir }
 On what sides can a plug be created? More...


Public Methods

 StreamSplitterModule ()
 Create a splitter module who's plugs are connected to nothing.

virtual ~StreamSplitterModule ()
 Delete splitter module and destroy all plugs it owns.

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

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

virtual bool ownsPlug (const Plug *p) const
 Does the module own 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 void plugDisconnected (Plug *plug)
 See base class.

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


Friends

class SPPlug

Detailed Description

This module is for treating two uni-directional streams as one bi-directional stream.

SplitterModule's work this way:


              SideIn
  Module>---->--->-->--+
                       |       (bi-directional)
                      Splitter===>==<==>==<==>==<===Module
                       |      ^
  Module<----<---<--<--+      |
              SideOut         +--side SideBiDir
 

The SplitterModule takes three i/o streams, one that does both input and output, one that does input, and one that does output, and connects them together. They're connected in such a way as to cause the output of the stream that does input and ouput goes into the stream that only takes input, and the output of the stream that only does output goes to the input of the combined stream.

The SideOut plug is never writeable, and the SideIn plug is never readable..

Definition at line 72 of file StreamSplitter.h.


Member Enumeration Documentation

enum strmod::strmod::StreamSplitterModule::Sides
 

On what sides can a plug be created?

Enumeration values:
SideIn  Only accepts input.
SideOut  Only produces output.
SideBiDir  Writing here goes out SideOut and reading comes from SideIn.

Definition at line 83 of file StreamSplitter.h.


Member Function Documentation

bool strmod::strmod::StreamSplitterModule::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 52 of file StreamSplitter.cxx.

virtual const lcore::ClassIdent* strmod::strmod::StreamSplitterModule::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 133 of file StreamSplitter.h.

StreamModule::Plug * strmod::strmod::StreamSplitterModule::i_MakePlug int    side [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 99 of file StreamSplitter.cxx.

void strmod::strmod::StreamSplitterModule::plugDisconnected Plug *    plug [protected, virtual]
 

See base class.

This one sets the read/writeable flags on the other plugs to be right.

It calls the base class version after doing its work.

Reimplemented from strmod::strmod::StreamModule.

Definition at line 81 of file StreamSplitter.cxx.


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