VR-Forces 4.0.4 Class Documentation
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes
DtObjectConsole Class Reference

This class represents the console for an individual object. More...

List of all members.

Public Member Functions

 DtObjectConsole (DtVrfObject *vrfObj)
virtual ~DtObjectConsole ()
virtual bool init ()
 Initialized the console.
virtual void registerMessageCallbacks ()
 Registers message callbacks with the VrfObject's communication interface.
virtual void setNotifyLevel (DtNotifyLevelType level)
 Sets the notify level for all streams managed by this console manager.
virtual DtNotifyLevelType notifyLevel () const
virtual void printToFile (const DtFilename &filename)
 Starts printing the output of this object console to the specified file.
virtual void stopPrintingToFile ()
 Stops printing to a file, if file printing is active.
virtual void addConsolePrinter (DtPrinter *printer)
 Adds the specified printer to all the streams associated with this console.
virtual void addAndManageConsolePrinter (DtPrinter *printer)
 Adds the specified printer, using addConsolePrinter(), but also takes ownership of the printer and deletes it when this console is deleted.
virtual void removeConsolePrinter (DtPrinter *printer)
 Removed the specified printer from all the streams associated with this console.
virtual DtOutputStream & debugStream () const
virtual DtOutputStream & verboseStream () const
virtual DtOutputStream & infoStream () const
virtual DtOutputStream & warnStream () const
virtual DtOutputStream & errorStream () const

Protected Member Functions

virtual void addDefaultPrinters ()
 Adds a DtObjectConsoleNetworkPrinter and a DtObjectConsoleVrlinkPrinter to the console.
virtual void processLogToFile (const DtVrfObjectMessage *msg)
virtual void processStopLoggingToFile (const DtVrfObjectMessage *msg)
virtual void processSetNotifyLevel (DtSimMessage *msg)

Static Protected Member Functions

static void logToFileCallback (const DtVrfObjectMessage *msg, void *usr)
static void stopLoggingToFileCallback (const DtVrfObjectMessage *msg, void *usr)
static void setNotifyLevelCallback (DtSimMessage *msg, void *usr)

Protected Attributes

DtVrfObjectmyVrfObject
DtOutputStreamBuffer * myDebugBuffer
DtOutputStream * myDebugStream
DtOutputStreamBuffer * myVerboseBuffer
DtOutputStream * myVerboseStream
DtOutputStreamBuffer * myInfoBuffer
DtOutputStream * myInfoStream
DtOutputStreamBuffer * myWarnBuffer
DtOutputStream * myWarnStream
DtOutputStreamBuffer * myErrorBuffer
DtOutputStream * myErrorStream
std::list< DtPrinter * > myManagedPrinterList
 The list of all printers managed (owned) by this console.
int myObjectConsoleThreshold
 The current notification level for this object.
DtFilePrinter * myFilePrinter
 If file logging has been turned on, this holds the pointer to the current file printer.

Private Member Functions

 DtObjectConsole ()
 Not Implemented.
 DtObjectConsole (const DtObjectConsole &orig)
 Not Implemented.
DtObjectConsoleoperator= (const DtObjectConsole &orig)
 Not Implemented.

Detailed Description

This class represents the console for an individual object.

It owns a set of streams for various notification levels (mirroring VR-Links DtWarn/DtInfo/etc. streams). Printers can be attached to send the console to various locations, including a file and DIS/RPR messages to the GUI.


Constructor & Destructor Documentation

Not Implemented.

Not Implemented.

virtual DtObjectConsole::~DtObjectConsole ( ) [virtual]

Member Function Documentation

DtObjectConsole& DtObjectConsole::operator= ( const DtObjectConsole orig) [private]

Not Implemented.

virtual bool DtObjectConsole::init ( ) [virtual]

Initialized the console.

Calls addDefaultPrinters() to add some default printers.

virtual void DtObjectConsole::registerMessageCallbacks ( ) [virtual]

Registers message callbacks with the VrfObject's communication interface.

This is pulled out into a separate method because normally the object console is set up very early in the objects init() method, before the communication interface it set up. The communication interface must be initialized before this call is made.

virtual void DtObjectConsole::setNotifyLevel ( DtNotifyLevelType  level) [virtual]

Sets the notify level for all streams managed by this console manager.

virtual DtNotifyLevelType DtObjectConsole::notifyLevel ( ) const [virtual]
Returns:
The current notification level.
virtual void DtObjectConsole::printToFile ( const DtFilename &  filename) [virtual]

Starts printing the output of this object console to the specified file.

Only one file will be printed to at a time. If a file is already being printed to, it will be stopped and printing will start to the new file.

virtual void DtObjectConsole::stopPrintingToFile ( ) [virtual]

Stops printing to a file, if file printing is active.

virtual DtOutputStream& DtObjectConsole::debugStream ( ) const [virtual]
Returns:
The stream that is routed to the object's console.
virtual DtOutputStream& DtObjectConsole::verboseStream ( ) const [virtual]
Returns:
The stream that is routed to the object's console.
virtual DtOutputStream& DtObjectConsole::infoStream ( ) const [virtual]
Returns:
The stream that is routed to the object's console.
virtual DtOutputStream& DtObjectConsole::warnStream ( ) const [virtual]
Returns:
The stream that is routed to the object's console.
virtual DtOutputStream& DtObjectConsole::errorStream ( ) const [virtual]
Returns:
The stream that is routed to the object's console.
virtual void DtObjectConsole::addConsolePrinter ( DtPrinter printer) [virtual]

Adds the specified printer to all the streams associated with this console.

The console does not take any ownership of this printer.

virtual void DtObjectConsole::addAndManageConsolePrinter ( DtPrinter printer) [virtual]

Adds the specified printer, using addConsolePrinter(), but also takes ownership of the printer and deletes it when this console is deleted.

Note:
Printers added in this way must not be shared between more than one object console, since each one will try to delete the printer.
virtual void DtObjectConsole::removeConsolePrinter ( DtPrinter printer) [virtual]

Removed the specified printer from all the streams associated with this console.

virtual void DtObjectConsole::addDefaultPrinters ( ) [protected, virtual]
static void DtObjectConsole::logToFileCallback ( const DtVrfObjectMessage msg,
void *  usr 
) [static, protected]
virtual void DtObjectConsole::processLogToFile ( const DtVrfObjectMessage msg) [protected, virtual]
static void DtObjectConsole::stopLoggingToFileCallback ( const DtVrfObjectMessage msg,
void *  usr 
) [static, protected]
virtual void DtObjectConsole::processStopLoggingToFile ( const DtVrfObjectMessage msg) [protected, virtual]
static void DtObjectConsole::setNotifyLevelCallback ( DtSimMessage msg,
void *  usr 
) [static, protected]
virtual void DtObjectConsole::processSetNotifyLevel ( DtSimMessage msg) [protected, virtual]

Member Data Documentation

DtOutputStreamBuffer* DtObjectConsole::myDebugBuffer [protected]
DtOutputStream* DtObjectConsole::myDebugStream [protected]
DtOutputStreamBuffer* DtObjectConsole::myVerboseBuffer [protected]
DtOutputStream* DtObjectConsole::myVerboseStream [protected]
DtOutputStreamBuffer* DtObjectConsole::myInfoBuffer [protected]
DtOutputStream* DtObjectConsole::myInfoStream [protected]
DtOutputStreamBuffer* DtObjectConsole::myWarnBuffer [protected]
DtOutputStream* DtObjectConsole::myWarnStream [protected]
DtOutputStreamBuffer* DtObjectConsole::myErrorBuffer [protected]
DtOutputStream* DtObjectConsole::myErrorStream [protected]

The list of all printers managed (owned) by this console.

Printers on this list will be deleted when this console is deleted.

The current notification level for this object.

DtFilePrinter* DtObjectConsole::myFilePrinter [protected]

If file logging has been turned on, this holds the pointer to the current file printer.


The documentation for this class was generated from the following file:

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)