NMPB08 Shared Libraries
Defines | Functions | Variables
RailwayDatabase.cpp File Reference
#include "../test_mem/safe_new.h"
#include "RailwayDatabase.h"
#include <math.h>

Go to the source code of this file.

Defines

#define Printf   if (trace_debug) printf

Functions

int NMPB08_LoadRailwayDatabase (const char *filename, bool trace)
 loads the train database from an external file
int NMPB08_DumpRailwayDatabase (const char *filename)
 writes the contents of the database to a file
int NMPB08_EnumRailwayDatabase (EnumRailwayEntities enumProc, unsigned int include_types, void *userdata)
 enumerate the contents of the database
int NMPB08_EnumRailwaySources (EnumRailwaySources enumProc, const char *name, void *userdata)
 enumerate the equivalent acoustical sources associated with a train or unit
template<class T >
MIN (T const &x, T const &y)
template<class T >
MAX (T const &x, T const &y)
std::string getID (const char *s)

Variables

RailwayDatabase _shared_db

Define Documentation

#define Printf   if (trace_debug) printf

Definition at line 38 of file RailwayDatabase.cpp.


Function Documentation

std::string getID ( const char *  s)

Definition at line 64 of file RailwayDatabase.cpp.

template<class T >
T MAX ( T const &  x,
T const &  y 
) [inline]

Definition at line 57 of file RailwayDatabase.cpp.

template<class T >
T MIN ( T const &  x,
T const &  y 
) [inline]

Definition at line 52 of file RailwayDatabase.cpp.

int NMPB08_DumpRailwayDatabase ( const char *  filename = 0)

writes the contents of the database to a file

Parameters:
filenamethe name of the output file in case the filename is a zero pointer or a zero length string, the output will be written to stdout
Returns:
0 if successful, otherwise an error code

Definition at line 16 of file RailwayDatabase.cpp.

int NMPB08_EnumRailwayDatabase ( EnumRailwayEntities  enumProc,
unsigned int  include_types = ENTITY_TRAFFIC,
void *  userdata = 0 
)

enumerate the contents of the database

Parameters:
enumProcuser defined callback function
include_typestype of database entries to be enumerated
userdatauser defined data to be passed to the callback function

Definition at line 21 of file RailwayDatabase.cpp.

int NMPB08_EnumRailwaySources ( EnumRailwaySources  enumProc,
const char *  name,
void *  userdata 
)

enumerate the equivalent acoustical sources associated with a train or unit

Parameters:
enumProcuser defined callback function
nameidentification a train or unit
userdatauser defined data to be passed to the callback function

Definition at line 28 of file RailwayDatabase.cpp.

int NMPB08_LoadRailwayDatabase ( const char *  filename,
bool  log_stdout = false 
)

loads the train database from an external file

Parameters:
filenamename of the external file
log_stdoutif true, prints messages to stdout
Returns:
0 if successful, otherwise an error code

Definition at line 11 of file RailwayDatabase.cpp.


Variable Documentation

Definition at line 5 of file RailwayDatabase.cpp.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines