Simpact Cyan
Population based event driven simulation using mNRM
Public Member Functions | List of all members
LogFile Class Reference

Helper class to write to a log file. More...

#include <logfile.h>

Inheritance diagram for LogFile:
Inheritance graph
[legend]
Collaboration diagram for LogFile:
Collaboration graph
[legend]

Public Member Functions

bool open (const std::string &fileName)
 Opens the specified file for writing. More...
 
std::string getFileName () const
 Returns the filename from the 'open' call. More...
 
void print (const char *format,...)
 Writes the specified parameters (similar to printf) to the logfile, automatically appending a newline character (\n). More...
 
void printNoNewLine (const char *format,...)
 Writes the specified parameters (similar to printf) to the logfile. More...
 
void close ()
 Finalizes and closes the log file. More...
 
- Public Member Functions inherited from errut::ErrorBase
 ErrorBase ()
 Creates an instance without an explicit object name. More...
 
 ErrorBase (const std::string &objName)
 Creates an instance with the object name set to objName. More...
 
std::string getObjectName () const
 Returns the stored object name. More...
 
std::string getErrorString () const
 Returns the currently stored error message. More...
 

Additional Inherited Members

- Protected Member Functions inherited from errut::ErrorBase
void setErrorString (const std::string &str) const
 Derived classes can use this member function to store an error message. More...
 

Detailed Description

Helper class to write to a log file.

Member Function Documentation

void LogFile::close ( )

Finalizes and closes the log file.

std::string LogFile::getFileName ( ) const
inline

Returns the filename from the 'open' call.

bool LogFile::open ( const std::string &  fileName)

Opens the specified file for writing.

void LogFile::print ( const char *  format,
  ... 
)

Writes the specified parameters (similar to printf) to the logfile, automatically appending a newline character (\n).

void LogFile::printNoNewLine ( const char *  format,
  ... 
)

Writes the specified parameters (similar to printf) to the logfile.


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