![]() |
VR-Link API Documentation for HLA 1.3
|
DtOutputStream is used for all toolkit output. More...
Inheritance diagram for DtOutputStream:
Collaboration diagram for DtOutputStream:Public Member Functions | |
| DtOutputStream (DtOutputStreamBuffer *buffer, int &globalThresholdRef, int threshold=1, DtPrinter *dflt_printer=0) | |
| CTOR. | |
| virtual | ~DtOutputStream () |
| Virtual DTOR. | |
| virtual void | attachPrinter (DtPrinter *sink) |
| Add or remove DtPrinters from this Stream. | |
| virtual bool | detachPrinter (DtPrinter *sink) |
| Returns true if printer was found, returns false if not found or other error. | |
| virtual void | detachAllPrinters () |
| Removes all DtPrinter references. | |
| virtual void | write (const std::string &str, bool newLine=false) |
| Writes the string to each printer. | |
| virtual void | setThreshold (int level) |
| Sets the threshold required for sending string output to all attached printer. | |
| virtual int | threshold () const |
| Returns the current threshold required to send string output to all attached printers. | |
| virtual bool | okToPrint () const |
| Boolean, if true we will write this, if false write is a no-op. | |
| virtual void | operator() (const char *s,...) |
| Provided to allow printf like syntax. | |
Protected Types | |
| typedef std::vector< DtPrinter * > | PrinterPtrVec |
Protected Attributes | |
| DtOutputStreamBuffer * | myStreamBuf |
| DtMutex | myStreamBufMutex |
| PrinterPtrVec | myPrinters |
| DtMutex | myPrintersMutex |
| int | myThreshold |
| int & | myGlobalThresholdReference |
| This is the global value we compare myThreshold to. | |
Private Member Functions | |
| DtOutputStream (const DtOutputStream &) | |
| Copy constructor - not implemented. | |
| DtOutputStream & | operator= (const DtOutputStream &) |
| Assignment Operator - not implemented. | |
DtOutputStream is used for all toolkit output.
It takes streams and strings of characters and sends them to one or more DtPrinter objects. Each DtPrinter object will then send that stream to an output device. It is possible for DtOutputStream to have NO DtPrinters, then it will output nothing.
DtOutputStream has a threshold property, based on this property the output stream will, or will not be sent to each registered printer. By default the threshold is compared to the global variable globalThresholdRef. If the value of globalThresholdRef is greater or equal to the value the threshold, the string is passed to each registered printer.
DtOutputStream maintains pointers to DtPrinter instances, when you attach a printer to it, you must maintain the DtPrinter instance for the whole time it is attached. Likewise DtOutputStream will not free this printer when you detach from it.
|
protected |
| DtOutputStream::DtOutputStream | ( | DtOutputStreamBuffer * | buffer, |
| int & | globalThresholdRef, | ||
| int | threshold = 1, |
||
| DtPrinter * | dflt_printer = 0 |
||
| ) |
CTOR.
Takes a pointer to a variable to use to check against a global threshold. Each DtOutputStreamBuffer needs to also have a unique DtOutputStreamBuffer which should be created before the DtOutputStream that uses it is created.
|
virtual |
Virtual DTOR.
|
private |
Copy constructor - not implemented.
|
virtual |
Add or remove DtPrinters from this Stream.
|
virtual |
Removes all DtPrinter references.
Remember, DtOutputStream does not manage any memory, so if you allocated a printer please delete it.
Returns true if printer was found, returns false if not found or other error.
|
virtual |
Boolean, if true we will write this, if false write is a no-op.
override this if you want to change the conditions under which this class will print.
|
virtual |
Provided to allow printf like syntax.
|
private |
Assignment Operator - not implemented.
|
inlinevirtual |
Sets the threshold required for sending string output to all attached printer.
|
inlinevirtual |
Returns the current threshold required to send string output to all attached printers.
|
virtual |
Writes the string to each printer.
The newLine argument indicates that the string to write starts a new line. This can be used to format output (eg. for adding timestamps).
|
protected |
This is the global value we compare myThreshold to.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |