NMPB08 Shared Libraries
|
the database of railway rolling stock More...
#include <RailwayDatabase.h>
Public Member Functions | |
RailwayDatabase (void) | |
int | LoadFile (const char *filename, bool trace=false) |
load an external file into the database | |
int | GetErrorCode (void) |
get the most recent error code | |
int | Dump (const char *filename) |
dump the contents of the database to a text file | |
int | EnumEntities (EnumRailwayEntities enumProc, unsigned int include_types, void *userdata) |
enumerates the contents of the database | |
int | EnumSources (EnumRailwaySources enumProc, IDREF id, void *userdata, double pos=0.0) |
enumerates the elementary sources associated with a unit or a train | |
RailwaySource const * | getSource (IDREF ref) |
get the elementary source record | |
RailwayUnit const * | getUnit (IDREF ref) |
get the rolling stock unit record | |
RailwayTrain const * | getTrain (IDREF ref) |
get the train record |
the database of railway rolling stock
the database is structures at three levels : train, units and elementary sources
a railway traffic may be composed from trains and/or units.
Definition at line 147 of file RailwayDatabase.h.
RailwayDatabase::RailwayDatabase | ( | void | ) | [inline] |
Definition at line 151 of file RailwayDatabase.h.
int RailwayDatabase::Dump | ( | const char * | filename | ) |
dump the contents of the database to a text file
filename | name of the text file. If the file name is a NULL pointer or points to an empty string, the output is written to stdout. |
Definition at line 485 of file RailwayDatabase.cpp.
int RailwayDatabase::EnumEntities | ( | EnumRailwayEntities | enumProc, |
unsigned int | include_types, | ||
void * | userdata | ||
) |
enumerates the contents of the database
enumProc | a user defined callback function, called once for each selected entry in the database |
include_types | type of database entries to be enumerated |
userdata | user defined data to be passed to the callback function |
Definition at line 524 of file RailwayDatabase.cpp.
int RailwayDatabase::EnumSources | ( | EnumRailwaySources | enumProc, |
IDREF | id, | ||
void * | userdata, | ||
double | pos = 0.0 |
||
) |
enumerates the elementary sources associated with a unit or a train
enumProc | a user defined callback function, called once for each elementary sources |
id | identification code for train or unit |
userdata | user defined data to be passed to the callback function |
pos | position along the train (for internal use only) |
Definition at line 583 of file RailwayDatabase.cpp.
int RailwayDatabase::GetErrorCode | ( | void | ) | [inline] |
get the most recent error code
Definition at line 163 of file RailwayDatabase.h.
RailwaySource const * RailwayDatabase::getSource | ( | IDREF | ref | ) |
get the elementary source record
ref | the identifier of the elementary source |
Definition at line 223 of file RailwayDatabase.cpp.
RailwayTrain const * RailwayDatabase::getTrain | ( | IDREF | ref | ) |
get the train record
ref | the identifier of the train |
Definition at line 241 of file RailwayDatabase.cpp.
RailwayUnit const * RailwayDatabase::getUnit | ( | IDREF | ref | ) |
get the rolling stock unit record
ref | the identifier of the rolling stock unit |
Definition at line 232 of file RailwayDatabase.cpp.
int RailwayDatabase::LoadFile | ( | const char * | filename, |
bool | trace = false |
||
) |
load an external file into the database
filename | name of the file |
trace | if true, trace operations to stdout |
Definition at line 144 of file RailwayDatabase.cpp.