ot::FileModule Class Reference
[Common Classes]

#include <FileModule.h>

Inheritance diagram for ot::FileModule:

Inheritance graph
[legend]
Collaboration diagram for ot::FileModule:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class manages the files and FileSink and FileSource objects. FileSources are driven by the main loop, whereas FileSinks write directly to the associated file, whenever they receive an event.

Author:
Gerhard Reitmayr


Public Member Functions

 FileModule ()
virtual ~FileModule ()
virtual void init (StringTable &attributes, ConfigNode *localTree)
virtual NodecreateNode (const std::string &name, StringTable &attributes)
virtual void pushEvent ()
virtual void close ()

Protected Attributes

std::map< std::string, NodeVectornodes
 map of name to list of either FileSink or FileSource nodes
std::map< std::string, File * > files
 map of name to File objects
std::list< FileSource * > sources
 list of file sources
bool append
 flag whether output files should be appended to or not
bool loop
 flag whether to loop input files or not
double interval
 interval time between new events
bool ot11Format
 flag whether to use OT v1.1 compatible file format (for testing purposes only)
bool realtime
 flag whether to play back events in realtime
double lastTime
 last timestamp
Event event
 local event
double firstPlaybackTime
 the time at which the first event was played back
double firstSavedEventTime
 the time at which the first event was recorded


Constructor & Destructor Documentation

ot::FileModule::FileModule  )  [inline]
 

constructor method. initializes internal and static data such as the functionMap and keyMap tables.

ot::FileModule::~FileModule  )  [virtual]
 

Destructor method, clears nodes member.


Member Function Documentation

void ot::FileModule::close  )  [virtual]
 

Closes the files and cleans up data structures.

Reimplemented from ot::Module.

Node * ot::FileModule::createNode const std::string &  name,
StringTable attributes
[virtual]
 

This method is called to construct a new Node. It compares name to the FileSink or FileSource element name, and if it matches creates the necessary File and Node objects.

Parameters:
name reference to string containing element name reference to StringTable containing attribute values
Returns:
pointer to new Node or NULL. The new Node must be allocated with new !

Implements ot::NodeFactory.

void ot::FileModule::init StringTable attributes,
ConfigNode localTree
[virtual]
 

initializes the tracker module. This class provides an implementation that sets the initialization flag to true. Subclasses should call this method if they override this method. It takes the attributes of the element configuring this module and a local tree consisting of the children of the element. This tree must be build of Nodes.

Parameters:
attributes StringTable of elements attribute values. Should be possibly , but is not for convenience.
localTree pointer to root of configuration nodes tree

Reimplemented from ot::Module.

void ot::FileModule::pushEvent  )  [virtual]
 

reads from the input files and fires new events, if necessary.

Reimplemented from ot::Module.


Member Data Documentation

bool ot::FileModule::append [protected]
 

flag whether output files should be appended to or not

Event ot::FileModule::event [protected]
 

local event

std::map<std::string, File *> ot::FileModule::files [protected]
 

map of name to File objects

double ot::FileModule::firstPlaybackTime [protected]
 

the time at which the first event was played back

double ot::FileModule::firstSavedEventTime [protected]
 

the time at which the first event was recorded

double ot::FileModule::interval [protected]
 

interval time between new events

double ot::FileModule::lastTime [protected]
 

last timestamp

bool ot::FileModule::loop [protected]
 

flag whether to loop input files or not

std::map<std::string, NodeVector> ot::FileModule::nodes [protected]
 

map of name to list of either FileSink or FileSource nodes

bool ot::FileModule::ot11Format [protected]
 

flag whether to use OT v1.1 compatible file format (for testing purposes only)

bool ot::FileModule::realtime [protected]
 

flag whether to play back events in realtime

std::list<FileSource*> ot::FileModule::sources [protected]
 

list of file sources


The documentation for this class was generated from the following files:
Generated on Wed Feb 28 15:28:14 2007 for NaviTrack by  doxygen 1.4.6