#include <StrMod/StreamProcessor.h>
Inheritance diagram for strmod::strmod::StreamProcessor:

Public Methods | |
| StreamProcessor () | |
| Abstract base classes don't have substansive constructors. | |
| virtual | ~StreamProcessor () |
| Abstract base classes don't have substansive destructors. | |
| virtual int | AreYouA (const lcore::ClassIdent &cid) const |
| Asks if a class is of a particular type, or publicly derived from that type. | |
| bool | canWriteTo () const |
Can you put data into this thing? Note that this is !incoming_. | |
| void | writeTo (const StrChunkPtr &chnk) |
| Shove in some data. Must not be called when !canWriteTo(). | |
| bool | canReadFrom () const |
Can you get any data from this thing? Note that this is outgoing_ready_. | |
| const StrChunkPtr | readFrom () |
| Pull out some data. Must not be called when !canReadFrom(). | |
Static Public Attributes | |
| const STR_ClassIdent | identifier |
| Globally 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 | processIncoming ()=0 |
| Do something with your incoming_ data. | |
Protected Attributes | |
| StrChunkPtr | incoming_ |
| Where to find the incoming data when processIncoming() is called. | |
| StrChunkPtr | outgoing_ |
| Where to stick data that's ready to go out. | |
| bool | outgoing_ready_ |
Set this when the data in outgoing_ is actually ready to go out. | |
Non-active means that this things readable or writeable status can't change unless it's a result of being read or written to.
This class is intended to be used with a ProcessorModule to create modules that do some sort of processing on every chunk that passes through.
A prime example of this sort of thing are streams that re-chunk the data passing through them according to some criteria. Another example is a stream which simply prepends a header of some sort to every chunk coming through.
Another prime example is a process in a Unix pipeline.
Definition at line 66 of file StreamProcessor.h.
|
|
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.
Reimplemented from strmod::lcore::Protocol. Reimplemented in strmod::strmod::CharChopper, strmod::strmod::NewlineChopper, strmod::strmod::PassThrough, and strmod::strmod::TelnetChunker. Definition at line 126 of file StreamProcessor.h. |
|
|
Can you get any data from this thing? Note that this is
It's a gross error for Definition at line 146 of file StreamProcessor.h. |
|
|
Can you put data into this thing? Note that this is
This means that if you need more data to complete your processing, your must clear incoming_ and store the partially processed data someplace else, like Definition at line 131 of file StreamProcessor.h. |
|
|
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::lcore::Protocol. Reimplemented in strmod::strmod::NewlineChopper, strmod::strmod::PassThrough, and strmod::strmod::TelnetChunker. Definition at line 101 of file StreamProcessor.h. |
|
|
Do something with your incoming_ data.
Implemented in strmod::strmod::PassThrough, and strmod::strmod::TelnetChunker. |
|
|
Globally unique identifier for this class. Every class that might need to be identified should have a public static const identifier object in it. Reimplemented from strmod::lcore::Protocol. Reimplemented in strmod::strmod::CharChopper, strmod::strmod::NewlineChopper, strmod::strmod::PassThrough, and strmod::strmod::TelnetChunker. |
1.3-rc1