ProMC  1.3
 All Classes Functions
Public Member Functions | Static Public Attributes | List of all members
ProMCBook Class Reference

Public Member Functions

 ProMCBook (const char *filename, const char *option)
 
void open (const char *filename, const char *option)
 
ProMCEvent get ()
 
ProMCEvent event (long idx)
 
int next ()
 
int getTimestamp ()
 
int getVersion ()
 
string getDescription ()
 
void setDescription (int events, string s)
 
int getEvents ()
 
int getEventsRequested ()
 
ProMCHeader getHeader ()
 
void setHeader (ProMCHeader h)
 
void setStatistics (ProMCStat h)
 
ProMCStat getStatistics ()
 
void close ()
 
void write (ProMCEvent e)
 
void clear ()
 
unsigned int size ()
 

Static Public Attributes

static const int current_version =3
 

Member Function Documentation

void ProMCBook::close ( )

Close all files and write metadata.

ProMCEvent ProMCBook::event ( long  idx)

Get a data record (event) using a random access. Use a key to extract the record. The key value runs from "0" to size()-1.

Parameters
key(long) of the record
Returns
ProMCEvent record corresponding to this key.
ProMCEvent ProMCBook::get ( )

Get the next record. Make sure you can next() first.

Returns
ProMCEvent record.
ProMCHeader ProMCBook::getHeader ( )

Get the record with the header file.

Parameters
Headerfile record.
ProMCStat ProMCBook::getStatistics ( )

Get the statistics record. Should be called last after all events.

Returns
int ProMCBook::next ( )

Get the next record.

Returns
0 if the record was extracted OK. Retun -1 if outside the scope
void ProMCBook::setDescription ( int  requested_events,
string  describe 
)

Set the description information.

Parameters
requested_eventsRequested events (not the actual!)
describedescription
void ProMCBook::setHeader ( ProMCHeader  h)

Set a header file.

Parameters
hHeader file.
void ProMCBook::setStatistics ( ProMCStat  h)

Set statistics information

Parameters
hStatistics info
unsigned int ProMCBook::size ( )

Return the number of records.

Returns
Return the size of all records (excluding metadata)
bool ProMCBook::write ( ProMCEvent  eve)

Write an event. Return true if no errors.

Parameters
eveEvent to be written.

The documentation for this class was generated from the following files: