Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

NewSimulatorLog Class Reference

Class for the handling of logfiles. More...

#include <new_sim_log.h>

Collaboration diagram for NewSimulatorLog:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 NewSimulatorLog ()
 Constructor.
virtual ~NewSimulatorLog ()
 Destructor.
bool Open (int properties, const char *filename="", int max_log_files=1)
 Open logfile(s).
void Close ()
 Close logfile(s).
void Lock ()
 Set a lock.
void Unlock ()
 Unset a lock.
void Hex (bool hex=true)
 Set/Unset hex flag.
bool IsHex ()
 Is the hex flag set.
void Time (bool t=true)
 Set/Unset time flag.
bool WithTime ()
 Is the time flag set.
void Recursive (bool r)
 Set/Unset recursive flag.
bool IsRecursive ()
 Is the recursive flag set.
NewSimulatorLogoperator<< (bool b)
 Output operator definition for a bool value.
NewSimulatorLogoperator<< (unsigned char c)
 Output operator definition for a unsigned char value.
NewSimulatorLogoperator<< (int i)
 Output operator definition for a int value.
NewSimulatorLogoperator<< (unsigned int i)
 Output operator definition for a unsigned int value.
NewSimulatorLogoperator<< (long l)
 Output operator definition for a long value.
NewSimulatorLogoperator<< (double d)
 Output operator definition for a double value.
NewSimulatorLogoperator<< (const char *str)
 Output operator definition for a string.
void Log (const char *fmt,...)
 Writes a complete log entry.
void Hex (const unsigned char *data, int size)
 Writes hex entries.
void Begin (const char *section, const char *name)
 Mark a section inside the logfile.
void End ()
 End a section inside the logfile.
NewSimulatorLogEntry (const char *entry)
 Writes an entry and returns address of object.

Protected Member Functions

void Start ()
 Start the logfile writing.
void Output (const char *str)
 Write the output dependent on which flags are set.

Protected Attributes

cThreadLock m_lock
 Thread lock.
int m_lock_count
 count of locks
int m_open_count
 count of open files
bool m_hex
 flag if hex values are written
bool m_time
 flag if time should be written
bool m_recursive
 flag recursive
bool m_std_out
 flag if output should be on stdout
bool m_std_err
 flag if output should be on stderr
bool m_nl
 flag for newline
FILE * m_fd
 file handler

Detailed Description

Class for the handling of logfiles.


Member Function Documentation

void NewSimulatorLog::Begin const char *  section,
const char *  name
 

Mark a section inside the logfile.

Parameters:
section kind of section
name name of section

NewSimulatorLog & NewSimulatorLog::Entry const char *  entry  ) 
 

Writes an entry and returns address of object.

Parameters:
entry string

void NewSimulatorLog::Hex const unsigned char *  data,
int  size
 

Writes hex entries.

Parameters:
data pointer on hex values
size size of field

void NewSimulatorLog::Hex bool  hex = true  )  [inline]
 

Set/Unset hex flag.

Parameters:
hex bool value - set yes/no

bool NewSimulatorLog::Open int  properties,
const char *  filename = "",
int  max_log_files = 1
 

Open logfile(s).

Parameters:
properties properties to be set
filename pointer on string with filename
max_log_files max logfiles
return success

void NewSimulatorLog::Output const char *  str  )  [protected]
 

Write the output dependent on which flags are set.

Parameters:
str pointer on string to be printed

void NewSimulatorLog::Recursive bool  r  )  [inline]
 

Set/Unset recursive flag.

Parameters:
r bool value - set yes/no

void NewSimulatorLog::Time bool  t = true  )  [inline]
 

Set/Unset time flag.

Parameters:
t bool value - set yes/no


The documentation for this class was generated from the following files:
Generated on Mon Apr 26 14:39:38 2010 for New Simulator by  doxygen 1.4.4