NeTrainSim 0.1.1 beta
The Open-Source Network Trains Simulator
 
Loading...
Searching...
No Matches
TrainsList Namespace Reference

Functions

Vector< std::tuple< std::string, Vector< int >, double, double, Vector< std::tuple< int, double, double, int, double, double, double, double, int > >, Vector< std::tuple< int, int, double, double, double, double, double, int > >, bool > > readTrainsFile (const std::string &fileName)
 Reads a trains file and returns the train records.
 
Vector< std::shared_ptr< Train > > generateTrains (Vector< std::tuple< std::string, Vector< int >, double, double, Vector< std::tuple< int, double, double, int, double, double, double, double, int > >, Vector< std::tuple< int, int, double, double, double, double, double, int > >, bool > > &trainRecords)
 Generates a Vector of trains from the given train records.
 
Vector< std::shared_ptr< Train > > ReadAndGenerateTrains (const std::string &fileName)
 Reads a trains file, generates trains from the train records, and returns the generated trains.
 
bool writeTrainsFile (Vector< std::tuple< std::string, Vector< int >, double, double, Vector< std::tuple< int, double, double, int, double, double, double, double, int > >, Vector< std::tuple< int, int, double, double, double, double, double, int > >, bool > > trains, const std::string &fileName)
 Writes the train records to a trains file.
 

Function Documentation

◆ generateTrains()

Vector< std::shared_ptr< Train > > TrainsList::generateTrains ( Vector< std::tuple< std::string, Vector< int >, double, double, Vector< std::tuple< int, double, double, int, double, double, double, double, int > >, Vector< std::tuple< int, int, double, double, double, double, double, int > >, bool > > &  trainRecords)

Generates a Vector of trains from the given train records.

Parameters
trainRecordsThe train records to generate trains from.
Returns
A Vector of shared pointers to Train objects.

◆ ReadAndGenerateTrains()

Vector< std::shared_ptr< Train > > TrainsList::ReadAndGenerateTrains ( const std::string &  fileName)

Reads a trains file, generates trains from the train records, and returns the generated trains.

Parameters
fileNameThe filename of the trains file to read.
Returns
A Vector of shared pointers to Train objects.

◆ readTrainsFile()

Vector< std::tuple< std::string, Vector< int >, double, double, Vector< std::tuple< int, double, double, int, double, double, double, double, int > >, Vector< std::tuple< int, int, double, double, double, double, double, int > >, bool > > TrainsList::readTrainsFile ( const std::string &  fileName)

Reads a trains file and returns the train records.

Parameters
fileNameThe filename of the trains file to read.
Returns
A Vector of train records.

◆ writeTrainsFile()

bool TrainsList::writeTrainsFile ( Vector< std::tuple< std::string, Vector< int >, double, double, Vector< std::tuple< int, double, double, int, double, double, double, double, int > >, Vector< std::tuple< int, int, double, double, double, double, double, int > >, bool > >  trains,
const std::string &  fileName 
)

Writes the train records to a trains file.

Parameters
trainsThe train records to write.
fileNameThe filename of the trains file to write to.
Returns
True if the write operation is successful, false otherwise.