1 #ifndef CARMA_DBMS_PHYSICALDEVICEIDAUTHORITY_H
2 #define CARMA_DBMS_PHYSICALDEVICEIDAUTHORITY_H
91 int getDeviceID( const ::std::string & device )
const;
93 static int getDeviceID( const ::std::string & device,
103 ::std::string
getLocation(
const int & locationID )
const;
105 static ::std::string
getLocation(
const int & locationID,
115 ::std::string
getDevice(
const int & deviceID )
const;
117 static ::std::string
getDevice(
const int & deviceID,
123 typedef ::std::map< ::std::string, int > Name2IdMap;
124 typedef ::std::map< int, ::std::string > Id2NameMap;
150 void registerLocationNameID( const ::std::string & location,
151 const int & locationID );
160 void registerDeviceNameID( const ::std::string & device,
161 const int & deviceID );
163 static const char *
const locationNames_[];
164 static const char *
const deviceNames_[];
166 static const int locationCount_;
167 static const int deviceCount_;
170 Name2IdMap deviceName2ID_;
171 Name2IdMap locationName2ID_;
172 Id2NameMap deviceID2Name_;
173 Id2NameMap locationID2Name_;
184 return locationCount_;
195 #endif // CARMA_DBMS_PHYSICALDEVICEIDAUTHORITY_H
int getDeviceID(const ::std::string &device) const
return the ID for a given hardware device name
Class used for configuring a DBConnection.
int getLocationID(const ::std::string &location) const
return the ID for a given hardware location name
static int getLocationCount()
return the number of locations
static int getDeviceCount()
return the number of devices
A lookup class for mapping names and IDs of locations and devices.
::std::string getLocation(const int &locationID) const
return the location name for for an ID
static const PhysicalDeviceIDAuthority & getAuthority(bool production=false, const dbms::DBConfigurator *dbconf=0)
get the singleton instance of the PhysicalDeviceIDAuthority.
::std::string getDevice(const int &deviceID) const
return the device name for for an ID
static void closeAuthority()
indicate that one's use of the authority is complete.