VR-Link API Documentation for HLA 1516
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
DtFilePrinter Class Reference

DtFilePrinter is a subclass of DtPrinter which opens a file and dumps all information received from DtOutputStream to the file. More...

+ Inheritance diagram for DtFilePrinter:
+ Collaboration diagram for DtFilePrinter:

Public Member Functions

 DtFilePrinter (const char *filename)
 XTOR - opens file named "filename";.
 DtFilePrinter ()
 XTOR - does not open a file, user must call resetFile to open a new file.
virtual ~DtFilePrinter ()
 DTOR - closes a file, so anything which is buffered will be written at this time.
virtual void resetFile (const char *filename)
 Reset file will close the existing file, if there is one, and open a new file stream.
virtual bool isOpen ()
 returns if the file was successfully opened
virtual void write (const std::string &st, int notify_level)
 write() is called by the output stream every time information is available to print.
- Public Member Functions inherited from DtPrinter
 DtPrinter ()
 DtPrinter (const DtPrinter &)
virtual ~DtPrinter ()

Protected Member Functions

 DtFilePrinter (const DtFilePrinter &orig)
DtFilePrinteroperator= (const DtFilePrinter &orig)

Protected Attributes

DtMutex myFileLock
std::ofstream myFile

Detailed Description

DtFilePrinter is a subclass of DtPrinter which opens a file and dumps all information received from DtOutputStream to the file.

If the file does not open for whatever reason no error is reported and all input is lost.

Constructor & Destructor Documentation

DtFilePrinter::DtFilePrinter ( const char *  filename)

XTOR - opens file named "filename";.

DtFilePrinter::DtFilePrinter ( )

XTOR - does not open a file, user must call resetFile to open a new file.

virtual DtFilePrinter::~DtFilePrinter ( )
virtual

DTOR - closes a file, so anything which is buffered will be written at this time.

DtFilePrinter::DtFilePrinter ( const DtFilePrinter orig)
protected

Member Function Documentation

virtual bool DtFilePrinter::isOpen ( )
virtual

returns if the file was successfully opened

DtFilePrinter& DtFilePrinter::operator= ( const DtFilePrinter orig)
protected
virtual void DtFilePrinter::resetFile ( const char *  filename)
virtual

Reset file will close the existing file, if there is one, and open a new file stream.

virtual void DtFilePrinter::write ( const std::string &  str,
int  notify_level 
)
virtual

write() is called by the output stream every time information is available to print.

Implements DtPrinter.

Member Data Documentation

std::ofstream DtFilePrinter::myFile
protected
DtMutex DtFilePrinter::myFileLock
protected

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

Document ID: Generated on Wed Oct 23 22:25:48 EDT 2013 from SVN revision 132765
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)