ot::File Class Reference

#include <File.h>

List of all members.

Public Types

enum  modeFlags { FILE_OUT = 0, FILE_IN }
 the mode i.e. input or output More...

Public Member Functions

 File (const std::string filename_, modeFlags mode_=FILE_OUT, bool append=false, bool loop_=false, bool ot11Format_=false)
 ~File ()
void write (Event &event, int station)
bool read (Event &event, int *station)
bool reset ()

Public Attributes

const std::string filename
 the full filename
const enum ot::File::modeFlags mode
 the mode i.e. input or output

Protected Attributes

std::ofstream * output
 Output stream for output mode.
std::ifstream * input
 Input stream for input mode.
bool loop
 flag for looping
bool ot11Format
 flag whether to use OT v1.1 compatible file format (for testing purposes only)

Friends

class FileModule


Member Enumeration Documentation

enum ot::File::modeFlags
 

the mode i.e. input or output

Enumerator:
FILE_OUT 
FILE_IN 


Constructor & Destructor Documentation

ot::File::File const std::string  filename_,
modeFlags  mode_ = FILE_OUT,
bool  append = false,
bool  loop_ = false,
bool  ot11Format_ = false
 

constructor method, sets some default values and opens the file in the correct mode.

Parameters:
filename_ the filename of the file to open
mode the mode to open (either IN or OUT )
append if OUT mode clear file or append to it
loop_ if IN mode loop input file or not
ot11Format_ if OT v1.1 compatible output format should be used (for testing purposes only)

ot::File::~File  ) 
 

destructor, closes the streams and deletes them again


Member Function Documentation

bool ot::File::read Event event,
int *  station
 

tries to read in the next station data, stored in the input file, only useable if File object was opened in input mode. Here you should be able to read in the right format :) ( obviously ).

Parameters:
event reference where to put the new event
station pointer to an int containing the station
Returns:
true if a new station could be read, otherwise false.

bool ot::File::reset  ) 
 

resets the input file

Returns:
true if input file was successfully reset

void ot::File::write Event event,
int  station
 

writes a event to the output stream, only useable if File object was opened in output mode. Here you can do any special formatting etc.

Parameters:
event reference to the output event
station number of the statione


Friends And Related Function Documentation

friend class FileModule [friend]
 


Member Data Documentation

const std::string ot::File::filename
 

the full filename

std::ifstream* ot::File::input [protected]
 

Input stream for input mode.

bool ot::File::loop [protected]
 

flag for looping

const enum ot::File::modeFlags ot::File::mode
 

the mode i.e. input or output

bool ot::File::ot11Format [protected]
 

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

std::ofstream* ot::File::output [protected]
 

Output stream for output mode.


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