Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Examples

LogFile Class Template Reference
[Base classes]

#include <logfile.h>

Inherited by PlotLog.

Inheritance diagram for LogFile:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<class T>
class LogFile< T >

Logs values for arbitrary defined channels. T can be std::string or int or anything else supports the << of streams. (It is used as name for a channel.)
Examples:

example.cpp.

Definition at line 22 of file logfile.h.

Public Member Functions

 LogFile (const std::string &filename="", const std::string &info="", const std::string &separator="\t")
 ~LogFile ()
void setInfo (const std::string &info)
void addChannel (const T &name)
void putData (const T &channel, double value)
void comment (const std::string &text)
void print_names_list ()
void print ()

Protected Types

typedef std::map< T, double > data_map
typedef std::list< T > names_list

Protected Member Functions

void init ()

Protected Attributes

FILE * f
data_map data
names_list names
std::string filename
std::string info
std::string separator
int line_counter
bool _print_names_list


Member Typedef Documentation

typedef std::map<T, double> data_map [protected]
 

Definition at line 28 of file logfile.h.

typedef std::list<T> names_list [protected]
 

Definition at line 29 of file logfile.h.


Constructor & Destructor Documentation

LogFile const std::string &  filename = "",
const std::string &  info = "",
const std::string &  separator = "\t"
[inline]
 

Definition at line 38 of file logfile.h.

~LogFile  )  [inline]
 

Definition at line 42 of file logfile.h.


Member Function Documentation

void addChannel const T &  name  )  [inline]
 

Definition at line 48 of file logfile.h.

void comment const std::string &  text  )  [inline]
 

print comment line in file format is "#%d: %s" Definition at line 57 of file logfile.h.

void init  )  [inline, protected]
 

Definition at line 86 of file logfile.h.

void print  )  [inline]
 

print data line in file format is "%5.3f%s" * number of channels s is the separator string usually "\t" Definition at line 72 of file logfile.h.

void print_names_list  )  [inline]
 

print numbered names list in file header Definition at line 65 of file logfile.h.

void putData const T &  channel,
double  value
[inline]
 

Reimplemented in PlotLog.

Definition at line 51 of file logfile.h.

void setInfo const std::string &  info  )  [inline]
 

Definition at line 45 of file logfile.h.


Member Data Documentation

bool _print_names_list [protected]
 

Definition at line 36 of file logfile.h.

data_map data [protected]
 

Definition at line 30 of file logfile.h.

FILE* f [protected]
 

Definition at line 27 of file logfile.h.

std::string filename [protected]
 

Definition at line 32 of file logfile.h.

std::string info [protected]
 

Definition at line 33 of file logfile.h.

int line_counter [protected]
 

Definition at line 35 of file logfile.h.

names_list names [protected]
 

Definition at line 31 of file logfile.h.

std::string separator [protected]
 

Definition at line 34 of file logfile.h.


The documentation for this class was generated from the following file:
Generated on Wed Apr 6 10:22:37 2005 for Gnuplot by doxygen 1.3.8