VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 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 DtOutputStreamdebugStream () const
virtual DtOutputStreamverboseStream () const
virtual DtOutputStreaminfoStream () const
virtual DtOutputStreamwarnStream () const
virtual DtOutputStreamerrorStream () 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
DtOutputStreamBuffermyDebugBuffer
DtOutputStreammyDebugStream
DtOutputStreamBuffermyVerboseBuffer
DtOutputStreammyVerboseStream
DtOutputStreamBuffermyInfoBuffer
DtOutputStreammyInfoStream
DtOutputStreamBuffermyWarnBuffer
DtOutputStreammyWarnStream
DtOutputStreamBuffermyErrorBuffer
DtOutputStreammyErrorStream
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

DtObjectConsole::DtObjectConsole ( )
private

Not Implemented.

DtObjectConsole::DtObjectConsole ( const DtObjectConsole orig)
private

Not Implemented.

DtObjectConsole::DtObjectConsole ( DtVrfObject vrfObj)
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 ( )
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
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
std::list<DtPrinter*> DtObjectConsole::myManagedPrinterList
protected

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

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

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.


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

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)