Class MHO_StationCodeMap Handles the mapping of two character and one character station representation. This class can be initialized from a file, otherwise it assigns free 1-char codes based on the order in which stations are encountered. Optionally, we can enable some legacy station code assignments inherited from difx2mark4.
More...
#include <MHO_StationCodeMap.hh>
Class MHO_StationCodeMap Handles the mapping of two character and one character station representation. This class can be initialized from a file, otherwise it assigns free 1-char codes based on the order in which stations are encountered. Optionally, we can enable some legacy station code assignments inherited from difx2mark4.
- Author
- J. Barrett - barre.nosp@m.ttj@.nosp@m.mit.e.nosp@m.du
- Date
- Thu Apr 28 12:25:09 2022 -0400
◆ MHO_StationCodeMap()
hops::MHO_StationCodeMap::MHO_StationCodeMap |
( |
bool |
use_legacy_default_codes = false | ) |
|
◆ ~MHO_StationCodeMap()
hops::MHO_StationCodeMap::~MHO_StationCodeMap |
( |
| ) |
|
|
virtual |
◆ GetAllMk4Ids()
std::vector< std::string > hops::MHO_StationCodeMap::GetAllMk4Ids |
( |
| ) |
|
Getter for all mk4ids.
- Returns
- std::vector<std::string containing all Mk4 IDs.
◆ GetAllStationCodes()
std::vector< std::string > hops::MHO_StationCodeMap::GetAllStationCodes |
( |
| ) |
|
Getter for all station codes.
- Returns
- A vector of strings containing all unique station codes.
◆ GetMk4IdFromStationCode()
std::string hops::MHO_StationCodeMap::GetMk4IdFromStationCode |
( |
std::string |
station_code | ) |
|
Getter for mk4id from station code.
- Parameters
-
station_code | Input station code to retrieve mk4id |
- Returns
- mk4id corresponding to input station_code
◆ GetStationCodeFromMk4Id()
std::string hops::MHO_StationCodeMap::GetStationCodeFromMk4Id |
( |
std::string |
mk4id | ) |
|
Getter for station code from mk4id.
- Parameters
-
mk4id | Input Mk4 ID string to search for in the map. |
- Returns
- Station code as a string if found; otherwise, an empty string.
◆ InitializeStationCodes()
void hops::MHO_StationCodeMap::InitializeStationCodes |
( |
std::string |
station_codes_file = "" | ) |
|
Initializes station codes by reading from a file and optionally using legacy codes.
- Parameters
-
station_codes_file | Path to the file containing station codes. |
◆ UseLegacyCodes()
void hops::MHO_StationCodeMap::UseLegacyCodes |
( |
| ) |
|
|
inline |
Sets legacy codes usage flag to true.
The documentation for this class was generated from the following files: