Robotsystem from Robot Group Leipzig: LogFile Class Template Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Alphabetical List
- Class Hierarchy
- Class Members

# LogFile Class Template Reference
[Base classes]

`#include <logfile.h>`

Inheritance diagram for LogFile:

[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.)

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)
| print comment line in file format is "#%d: %s"
void | print_names_list ()
| print numbered names list in file header
void | print ()
| print data line in file format is "%5.3f%s" * number of channels s is the separator string usually "\t"
## 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 25 of file logfile.h.

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

| Definition at line 26 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 35 of file logfile.h.

~LogFile | ( |  | ) | `[inline]`

| Definition at line 39 of file logfile.h.

## Member Function Documentation

void addChannel | ( | const T & | name | ) | `[inline]`

| Definition at line 45 of file logfile.h.

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

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

void init | ( |  | ) | `[inline, protected]`

| Definition at line 83 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 69 of file logfile.h.

void print_names_list | ( |  | ) | `[inline]`

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

void putData | ( | const T & | channel,
|  | double | value
| ) | `[inline]`

| Reimplemented in PlotLog, and PlotLog< std::string >. Definition at line 48 of file logfile.h.

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

| Definition at line 42 of file logfile.h.

## Member Data Documentation

bool _print_names_list`[protected]`

| Definition at line 33 of file logfile.h.

data_map data`[protected]`

| Definition at line 27 of file logfile.h.

FILE* f`[protected]`

| Definition at line 24 of file logfile.h.

std::string filename`[protected]`

| Definition at line 29 of file logfile.h.

std::string info`[protected]`

| Definition at line 30 of file logfile.h.

int line_counter`[protected]`

| Definition at line 32 of file logfile.h.

names_list names`[protected]`

| Definition at line 28 of file logfile.h.

std::string separator`[protected]`

| Definition at line 31 of file logfile.h.