4#ifndef HUMMINGBIRD_BANKS_BANK_BASE_H_
5#define HUMMINGBIRD_BANKS_BANK_BASE_H_
7#include <nlohmann/json.hpp>
9#include <unordered_map>
63 virtual void Build(
const json& json_input) = 0;
Base class for banks that store objects of type T by integer ID and look them up by the name given in...
const T & GetByID(const int id) const
Get the object by its ID.
virtual void Build(const json &json_input)=0
Build the bank.
const T & GetByName(const std::string &name) const
Get the object by its name in the JSON input file.
std::unordered_map< std::string, int > name_id_map_
name to object ID map
std::unordered_map< int, T > id_object_map_
ID to object map.
int GetIDByName(const std::string &name) const
Get the ID of an object by its name in the JSON input file.