Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
RedirectionCommPort Class Reference#include <RedirectionCommPort.h>
Inheritance diagram for RedirectionCommPort:
![]() Detailed DescriptionAllows you to recombine the input/output of other CommPorts in various ways.This will take input from one CommPort, and can send output to a different CommPort. It's not a 'pipe' from the input to the output, it just changes where the inputs and outputs are coming from. Definition at line 11 of file RedirectionCommPort.h.
Constructor & Destructor Documentation
destructor, checks that the file descriptor has already been closed
Definition at line 22 of file RedirectionCommPort.h.
Member Function Documentation
Returns the name of the class (aka its type). Suggested implementation is to declare a static string member, set it to the result of calling the registry's registerType, and then return that member here Implements CommPort. Definition at line 27 of file RedirectionCommPort.h. Referenced by plistValueChanged().
Returns a std::basic_streambuf, which is expected to implement the actual work. You can pass this to an istream to use the nice C++ style input and output, or you can call the streambuf functions directly. However, if you're going the latter route, probably easier to just call CommPort's own read() and write(). Depending on implementation, the streambuf this returns might be a different instance than getWriteStreambuf. If they are the same instance, then you could use an iostream instead of separate istream and ostream. Implements CommPort. Definition at line 29 of file RedirectionCommPort.h.
Returns a std::basic_streambuf, which is expected to implement the actual work. You can pass this to an ostream to use the nice C++ style input and output, or you can call the streambuf functions directly. However, if you're going the latter route, probably easier to just call CommPort's own read() and write(). Depending on implementation, the streambuf this returns might be a different instance than getReadStreambuf. If they are the same instance, then you could use an iostream instead of separate istream and ostream. Implements CommPort. Definition at line 30 of file RedirectionCommPort.h.
Allows you to check whether the reference from getReadStreambuf() is currently functional (if checking is supported!). For streambufs which don't have a way to check this, always returns true. Reimplemented from CommPort. Definition at line 31 of file RedirectionCommPort.h.
Allows you to check whether the reference from getWriteStreambuf() is currently functional (if checking is supported!). For streambufs which don't have a way to check this, always returns true. Reimplemented from CommPort. Definition at line 32 of file RedirectionCommPort.h.
Called when communication is about to begin, should handle recursive open/close calls. The subclass is expected to have its own configuration settings which define the parameters of what is to be "opened". Hence, no arguments are passed. You should be able to handle recursive levels of open/close in case multiple drivers are using the same CommPort.
Implements CommPort. Definition at line 8 of file RedirectionCommPort.cc.
Called when communication is complete, should handle recursive open/close calls.
Implements CommPort. Definition at line 23 of file RedirectionCommPort.cc.
watches input and output, triggers a close() and re-open() as needed
Implements PrimitiveListener. Definition at line 38 of file RedirectionCommPort.cc.
convenience function to lookup the current input comm port instance
Definition at line 45 of file RedirectionCommPort.h. Referenced by close(), getReadStreambuf(), isReadable(), open(), and plistValueChanged().
convenience function to lookup the current output comm port instance
Definition at line 47 of file RedirectionCommPort.h. Referenced by close(), getWriteStreambuf(), isWriteable(), open(), and plistValueChanged().
Member Data Documentation
Name of comm port from which to get input.
Definition at line 40 of file RedirectionCommPort.h. Referenced by close(), open(), plistValueChanged(), and RedirectionCommPort().
Name of comm port into which to send output.
Definition at line 41 of file RedirectionCommPort.h. Referenced by close(), open(), plistValueChanged(), and RedirectionCommPort().
name of the current input comm port (stored separately from input so if that changes, we can close the old one)
Definition at line 49 of file RedirectionCommPort.h. Referenced by getInputCP(), open(), and plistValueChanged().
name of the current output comm port (stored separately from output so if that changes, we can close the old one)
Definition at line 50 of file RedirectionCommPort.h. Referenced by getOutputCP(), open(), and plistValueChanged().
open() call depth, tracks multiple usage
Definition at line 51 of file RedirectionCommPort.h. Referenced by close(), open(), and ~RedirectionCommPort().
needed so we have something to return when the RedirectionCommPort doesn't have a valid external comm port to take a streambuf from
Definition at line 56 of file RedirectionCommPort.h. Referenced by getReadStreambuf(), and getWriteStreambuf().
holds the class name, set via registration with the CommPort registry
Definition at line 59 of file RedirectionCommPort.h. Referenced by getClassName().
The documentation for this class was generated from the following files: |
Tekkotsu Hardware Abstraction Layer 4.0 |
Generated Thu Nov 22 01:01:23 2007 by Doxygen 1.5.4 |