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

Typedefs

using CarType = _CarType
 Type of the car.
 
using PowerType = _PowerType
 Type of the power.
 
using LocomotivePowerMethod = _LocomotivePowerMethod
 Type of the power.
 
using FuelType = _fuelTypes
 Type of the fuel.
 

Enumerations

enum class  _CarType {
  cargo , dieselTender , batteryTender , hydrogenTender ,
  biodieselTender
}
 Values that represent car types. More...
 
enum class  _PowerType {
  diesel , electric , biodiesel , dieselElectric ,
  dieselHybrid , hydrogenHybrid , biodieselHybrid
}
 Values that represent power types. More...
 
enum class  _LocomotivePowerMethod { notApplicable , series , parallel }
 Values that represent power types. More...
 
enum class  _fuelTypes { diesel , biodiesel , hydrogen , noFuel }
 Values that represent fuel types. More...
 

Functions

Vector< CarTypegetCarTypeVector ()
 Gets car type vector.
 
std::string carTypeToStr (CarType type)
 Car type to string.
 
CarType strtoCarType (const std::string &cartype)
 Strto car type.
 
CarType itoCarType (int cartype)
 Ito car type.
 
std::ostream & operator<< (std::ostream &ss, const CarType &obj)
 Stream insertion operator.
 
std::string PowerTypeToStr (PowerType type)
 Power type to string.
 
PowerType strToPowerType (std::string powertype)
 Converts a powertype to a power type.
 
PowerType iToPowerType (int powertype)
 Converts a powertype to a power type.
 
std::ostream & operator<< (std::ostream &ss, const PowerType &obj)
 Stream insertion operator.
 
LocomotivePowerMethod strToPowerMethod (std::string powertype)
 Converts a string to a power method.
 
LocomotivePowerMethod iToPowerMethod (int powertype)
 Converts a powertype to a power type.
 
std::ostream & operator<< (std::ostream &ss, const LocomotivePowerMethod &obj)
 Stream insertion operator.
 
std::string fuelTypeToStr (FuelType type)
 
FuelType getFuelTypeFromPowerType (PowerType theType)
 

Detailed Description

Typedef Documentation

◆ CarType

using TrainTypes::CarType = typedef _CarType

Type of the car.

◆ FuelType

Type of the fuel.

◆ LocomotivePowerMethod

Type of the power.

◆ PowerType

Type of the power.

Enumeration Type Documentation

◆ _CarType

enum class TrainTypes::_CarType
strong

Values that represent car types.

Enumerator
cargo 
dieselTender 
batteryTender 
hydrogenTender 
biodieselTender 

◆ _fuelTypes

enum class TrainTypes::_fuelTypes
strong

Values that represent fuel types.

Enumerator
diesel 
biodiesel 
hydrogen 
noFuel 

◆ _LocomotivePowerMethod

Values that represent power types.

Enumerator
notApplicable 
series 
parallel 

◆ _PowerType

enum class TrainTypes::_PowerType
strong

Values that represent power types.

Enumerator
diesel 
electric 
biodiesel 
dieselElectric 
dieselHybrid 
hydrogenHybrid 
biodieselHybrid 

Function Documentation

◆ carTypeToStr()

std::string TrainTypes::carTypeToStr ( CarType  type)
inline

Car type to string.

Author
Ahmed Aredah
Date
3/20/2023
Parameters
typeThe type.
Returns
A std::string.

◆ fuelTypeToStr()

std::string TrainTypes::fuelTypeToStr ( FuelType  type)
inline

◆ getCarTypeVector()

Vector< CarType > TrainTypes::getCarTypeVector ( )
inline

Gets car type vector.

Author
Ahmed Aredah
Date
3/20/2023
Returns
The car type vector.

◆ getFuelTypeFromPowerType()

FuelType TrainTypes::getFuelTypeFromPowerType ( PowerType  theType)
inline

◆ itoCarType()

CarType TrainTypes::itoCarType ( int  cartype)
inline

Ito car type.

Author
Ahmed Aredah
Date
3/20/2023
Exceptions
std::invalid_argumentThrown when an invalid argument error condition occurs.
Parameters
cartypeThe cartype.
Returns
A CarType.

◆ iToPowerMethod()

LocomotivePowerMethod TrainTypes::iToPowerMethod ( int  powertype)
inline

Converts a powertype to a power type.

Author
Ahmed Aredah
Date
3/20/2023
Exceptions
std::invalid_argumentThrown when an invalid argument error condition occurs.
Parameters
powertypeThe powertype.
Returns
Powertype as a PowerType.

◆ iToPowerType()

PowerType TrainTypes::iToPowerType ( int  powertype)
inline

Converts a powertype to a power type.

Author
Ahmed Aredah
Date
3/20/2023
Exceptions
std::invalid_argumentThrown when an invalid argument error condition occurs.
Parameters
powertypeThe powertype.
Returns
Powertype as a PowerType.

◆ operator<<() [1/3]

std::ostream & TrainTypes::operator<< ( std::ostream &  ss,
const CarType obj 
)
inline

Stream insertion operator.

Author
Ahmed Aredah
Date
3/20/2023
Parameters
[in,out]ssThe ss.
objThe object.
Returns
The shifted result.

◆ operator<<() [2/3]

std::ostream & TrainTypes::operator<< ( std::ostream &  ss,
const LocomotivePowerMethod obj 
)
inline

Stream insertion operator.

Author
Ahmed Aredah
Date
3/20/2023
Parameters
[in,out]ssThe ss.
objThe object.
Returns
The shifted result.

◆ operator<<() [3/3]

std::ostream & TrainTypes::operator<< ( std::ostream &  ss,
const PowerType obj 
)
inline

Stream insertion operator.

Author
Ahmed Aredah
Date
3/20/2023
Parameters
[in,out]ssThe ss.
objThe object.
Returns
The shifted result.

◆ PowerTypeToStr()

std::string TrainTypes::PowerTypeToStr ( PowerType  type)
inline

Power type to string.

Author
Ahmed Aredah
Date
3/20/2023
Parameters
typeThe type.
Returns
A std::string.

◆ strtoCarType()

CarType TrainTypes::strtoCarType ( const std::string &  cartype)
inline

Strto car type.

Author
Ahmed Aredah
Date
3/20/2023
Exceptions
std::invalid_argumentThrown when an invalid argument error condition occurs.
Parameters
cartypeThe cartype.
Returns
A CarType.

◆ strToPowerMethod()

LocomotivePowerMethod TrainTypes::strToPowerMethod ( std::string  powertype)
inline

Converts a string to a power method.

Author
Ahmed Aredah
Date
3/20/2023
Exceptions
std::invalid_argumentThrown when an invalid argument error condition occurs.
Parameters
powertypeThe powertype.
Returns
Powertype as a PowerType.

◆ strToPowerType()

PowerType TrainTypes::strToPowerType ( std::string  powertype)
inline

Converts a powertype to a power type.

Author
Ahmed Aredah
Date
3/20/2023
Exceptions
std::invalid_argumentThrown when an invalid argument error condition occurs.
Parameters
powertypeThe powertype.
Returns
Powertype as a PowerType.