VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | 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...

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 void setNotifyLevel (const DtString &channel, DtNotifyLevelType level)
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 DtOutputChannelManagerchannelManager ()
virtual DtOutputStream & debugStream (const DtString &channel="")
virtual DtOutputStream & verboseStream (const DtString &channel="")
virtual DtOutputStream & infoStream (const DtString &channel="")
virtual DtOutputStream & warnStream (const DtString &channel="")
virtual DtOutputStream & errorStream (const DtString &channel="")

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
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.
DtOutputChannelManager myChannelManager

Private Member Functions

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

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

DtObjectConsole::DtObjectConsole ( )
private

Not Implemented.

DtObjectConsole::DtObjectConsole ( const DtObjectConsole orig)
private
DtObjectConsole::DtObjectConsole ( DtVrfObject vrfObj)
virtual DtObjectConsole::~DtObjectConsole ( )
virtual

Member Function Documentation

DtObjectConsole& DtObjectConsole::operator= ( const DtObjectConsole orig)
private
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 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)
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 DtString channel = "")
virtual
Returns
The stream that is routed to the object's console.
virtual DtOutputStream& DtObjectConsole::verboseStream ( const DtString channel = "")
virtual
virtual DtOutputStream& DtObjectConsole::infoStream ( const DtString channel = "")
virtual
virtual DtOutputStream& DtObjectConsole::warnStream ( const DtString channel = "")
virtual
virtual DtOutputStream& DtObjectConsole::errorStream ( const DtString channel = "")
virtual
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 DtOutputChannelManager& DtObjectConsole::channelManager ( )
virtual
virtual void DtObjectConsole::addDefaultPrinters ( )
protectedvirtual
static void DtObjectConsole::logToFileCallback ( const DtVrfObjectMessage msg,
void *  usr 
)
staticprotected
virtual void DtObjectConsole::processLogToFile ( const DtVrfObjectMessage msg)
protectedvirtual
static void DtObjectConsole::stopLoggingToFileCallback ( const DtVrfObjectMessage msg,
void *  usr 
)
staticprotected
virtual void DtObjectConsole::processStopLoggingToFile ( const DtVrfObjectMessage msg)
protectedvirtual
static void DtObjectConsole::setNotifyLevelCallback ( DtSimMessage msg,
void *  usr 
)
staticprotected
virtual void DtObjectConsole::processSetNotifyLevel ( DtSimMessage msg)
protectedvirtual

Member Data Documentation

DtVrfObject* DtObjectConsole::myVrfObject
protected
int DtObjectConsole::myObjectConsoleThreshold
protected

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.

DtOutputChannelManager DtObjectConsole::myChannelManager
protected

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

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)