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

TxqLog Class Reference

Class for connecting multiple ostreams through a single ostream. More...

#include <TxqLog.h>

Inheritance diagram for TxqLog::

TxThroughStream List of all members.

Public Methods

 TxqLog ()
 The TxqLog defaults to sending output to all attached ostreams. More...

 TxqLog (ostream &os, txfilter f=TX_ALL)
 The TxqLog sends output to the input parameter ostream. More...

virtual ~TxqLog ()
 Virtual destructor flushes remaining output. More...

TXSTD::vector<ostream*> getStreams ()
 Get the streams associated with this class. More...

void attachModel (TxqMasterIoFrame *mdl, txfilter f=TX_ALL)
 Attaches the TxqMasterIoFrame *mdl to the TxThroughStream with filter type f. More...

void detachModel (TxqMasterIoFrame *mdl)
 Disconnects mdl from the TxThroughStream. More...

void setModelFilter (txfilter f)
 Labels the type for suceeding output to the TxqLog stream. More...


Protected Methods

int sync ()
 sync method from streambuf. More...

int output (char *text, int length)
 Helper function to output length characters from text. More...


Protected Attributes

TXSTD::map<TxqMasterIoFrame*,
txfilter> 
mdlStateMap
 Associate array of attached TxqMasterIoFrame. More...

TxqMasterIoFramemodel
 The model window pointer. More...

txfilter mdlState
 The type of current output. More...


Private Attributes

QString strBuffer
 The QString buffer to hold the output characters until ready to send to the model window. More...


Detailed Description

Class for connecting multiple ostreams through a single ostream.

A TxqLog is an ostream for which the output can be connected to multiple other ostreams. Output to a TxqLog can be labeled with one or more filter flags specifing the nature of the output. Ostreams attached to the TxqLog can register to selectively listen to given types of output. The output is also sent to the TxqMasterIoFrame.

Copyright (c) 1999 - 2001 by Tech-X Corporation. All rights reserved.

Author:
Kelly G. Luetkemeyer

Definition at line 46 of file TxqLog.h.


Constructor & Destructor Documentation

TxqLog::TxqLog ( )
 

The TxqLog defaults to sending output to all attached ostreams.

TxqLog::TxqLog ( ostream & os,
txfilter f = TX_ALL )
 

The TxqLog sends output to the input parameter ostream.

Parameters:
os   the desired ostream to attach
f   the desired filter type

TxqLog::~TxqLog ( ) [virtual]
 

Virtual destructor flushes remaining output.


Member Function Documentation

void TxqLog::attachModel ( TxqMasterIoFrame * mdl,
txfilter f = TX_ALL )
 

Attaches the TxqMasterIoFrame *mdl to the TxThroughStream with filter type f.

Any output sent to the TxThroughStream that matches one of the types in f will be passed on to s. Calling attachModel with mdl already attached will reset the filter type to f.

Parameters:
mdl   the TxqMasterIoFrame to attach.
f   the types of messages that TxqMasterIoFrame will listen to. Defaults to ALL.

void TxqLog::detachModel ( TxqMasterIoFrame * mdl )
 

Disconnects mdl from the TxThroughStream.

Functionaly equivalent to attachModel(mdl, OFF).

Parameters:
mdl   the TxqMasterIoFrame to detach

TXSTD::vector< ostream *> TxqLog::getStreams ( )
 

Get the streams associated with this class.

Returns:
the assocated streams in a vector

int TxqLog::output ( char * text,
int length ) [protected]
 

Helper function to output length characters from text.

Output is sent to attached ostreams if they the types match.

Parameters:
text   the text buffer
length   the number of characters to output
Returns:
the number of characters sucessfully output.

void TxqLog::setModelFilter ( txfilter f )
 

Labels the type for suceeding output to the TxqLog stream.

Output has type f until this function is called again.

Parameters:
f   the type of future messages to TxThroughStream.

int TxqLog::sync ( ) [protected]
 

sync method from streambuf.


Member Data Documentation

txfilter TxqLog::mdlState [protected]
 

The type of current output.

Definition at line 134 of file TxqLog.h.

TXSTD::map< TxqMasterIoFrame *, txfilter > TxqLog::mdlStateMap [protected]
 

Associate array of attached TxqMasterIoFrame.

Definition at line 124 of file TxqLog.h.

TxqMasterIoFrame * TxqLog::model [protected]
 

The model window pointer.

Definition at line 129 of file TxqLog.h.

QString TxqLog::strBuffer [private]
 

The QString buffer to hold the output characters until ready to send to the model window.

Definition at line 142 of file TxqLog.h.


The documentation for this class was generated from the following file: Copyright Tech-X Corporation, all rights reserved.