VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
DtObjectConsole Class Reference

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.

Related Examples

Public Member Functions

 DtObjectConsole (const DtSimObject *)
 
virtual ~DtObjectConsole ()
 
virtual bool init ()
 
virtual void setNotifyLevel (DtNotifyLevelType level)
 
virtual void setNotifyLevel (const DtString &channel, DtNotifyLevelType level)
 
virtual DtNotifyLevelType notifyLevel () const
 
virtual void printToFile (const DtFilename &filename) const
 
virtual void stopPrintingToFile () const
 
virtual void addConsolePrinter (DtPrinter *printer)
 
virtual void addAndManageConsolePrinter (DtPrinter *printer)
 
virtual void removeConsolePrinter (DtPrinter *printer)
 
virtual const
DtOutputChannelManager
channelManager () const
 
virtual DtOutputStream & debugStream (const DtString &channel="") const
 
virtual DtOutputStream & verboseStream (const DtString &channel="") const
 
virtual DtOutputStream & infoStream (const DtString &channel="") const
 
virtual DtOutputStream & warnStream (const DtString &channel="") const
 
virtual DtOutputStream & errorStream (const DtString &channel="") const
 

Protected Member Functions

virtual void addDefaultPrinters ()
 

Protected Attributes

int myObjectConsoleThreshold
 
DtFilePrinter * myFilePrinter
 
DtOutputChannelManager myChannelManager
 
tbb::spin_mutex myMutex
 
const DtSimObjectmySimObject
 

Private Member Functions

 DtObjectConsole (const DtObjectConsole &orig)
 
DtObjectConsoleoperator= (const DtObjectConsole &orig)
 

Constructor & Destructor Documentation

DtObjectConsole::DtObjectConsole ( const DtSimObject )
virtual DtObjectConsole::~DtObjectConsole ( )
virtual
DtObjectConsole::DtObjectConsole ( const DtObjectConsole orig)
private

Not Implemented.

Member Function Documentation

virtual bool DtObjectConsole::init ( )
virtual

Initialized the console. Calls addDefaultPrinters() to add some default printers.

virtual void DtObjectConsole::setNotifyLevel ( DtNotifyLevelType  level)
virtual

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

virtual void DtObjectConsole::setNotifyLevel ( const DtString channel,
DtNotifyLevelType  level 
)
virtual
virtual DtNotifyLevelType DtObjectConsole::notifyLevel ( ) const
virtual
Returns
The current notification level.
virtual void DtObjectConsole::printToFile ( const DtFilename &  filename) const
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 ( ) const
virtual

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

virtual DtOutputStream& DtObjectConsole::debugStream ( const DtString channel = "") const
virtual
Returns
The stream that is routed to the object's console.
virtual DtOutputStream& DtObjectConsole::verboseStream ( const DtString channel = "") const
virtual
Returns
The stream that is routed to the object's console.
virtual DtOutputStream& DtObjectConsole::infoStream ( const DtString channel = "") const
virtual
Returns
The stream that is routed to the object's console.
virtual DtOutputStream& DtObjectConsole::warnStream ( const DtString channel = "") const
virtual
Returns
The stream that is routed to the object's console.
virtual DtOutputStream& DtObjectConsole::errorStream ( const DtString channel = "") 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 const DtOutputChannelManager& DtObjectConsole::channelManager ( ) const
virtual
virtual void DtObjectConsole::addDefaultPrinters ( )
protectedvirtual
DtObjectConsole& DtObjectConsole::operator= ( const DtObjectConsole orig)
private

Not Implemented.

Member Data Documentation

int DtObjectConsole::myObjectConsoleThreshold
protected

The current notification level for this object.

DtFilePrinter* DtObjectConsole::myFilePrinter
mutableprotected

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

DtOutputChannelManager DtObjectConsole::myChannelManager
mutableprotected
tbb::spin_mutex DtObjectConsole::myMutex
mutableprotected
const DtSimObject* DtObjectConsole::mySimObject
protected

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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)