Commit 47ce8bf6 authored by Michael Ott's avatar Michael Ott

Remove getPublicSensorByPattern() function

parent f578c9a8
......@@ -215,15 +215,6 @@ public:
*/
SCError getPublicSensorByName(PublicSensor& sensor, const char* publicName);
/**
* @brief Retrieve a public sensor by pattern.
*
* @param sensor Reference to a PublicSensor object that will be populated with the sensor's definition.
* @param pattern Pattern to search for.
* @return See SCError.
*/
SCError getPublicSensorByPattern(PublicSensor& sensor, const char* pattern);
/**
* @brief Retrieve a list of public sensors that match a wildcard.
*
......
......@@ -51,7 +51,6 @@ protected:
typedef std::unordered_map<std::string, std::reference_wrapper<PublicSensor>> SensorMap_t;
SensorMap_t sensorMapByName;
SensorMap_t sensorMapByPattern;
std::list<PublicSensor> sensorList;
bool validateSensorPattern(const char* sensorPattern);
......@@ -69,7 +68,6 @@ public:
SCError getPublicSensorsVerbose(std::list<PublicSensor>& publicSensors);
SCError getPublicSensorByName(PublicSensor& sensor, const char* publicName);
SCError getPublicSensorByPattern(PublicSensor& sensor, const char* pattern);
SCError getPublicSensorsByWildcard(std::list<PublicSensor>& sensors, const char* wildcard);
SCError isVirtual(bool& isVirtual, std::string publicName);
......
......@@ -179,11 +179,6 @@ SCError SensorConfig::getPublicSensorByName(PublicSensor& sensor, const char* pu
return impl->getPublicSensorByName(sensor, publicName);
}
SCError SensorConfig::getPublicSensorByPattern(PublicSensor& sensor, const char* pattern)
{
return impl->getPublicSensorByPattern(sensor, pattern);
}
SCError SensorConfig::getPublicSensorsByWildcard(std::list<PublicSensor>& sensors, const char* wildcard)
{
return impl->getPublicSensorsByWildcard(sensors, wildcard);
......@@ -328,7 +323,6 @@ SCError SensorConfigImpl::loadCache()
{
sensorList.clear();
sensorMapByName.clear();
sensorMapByPattern.clear();
SCError rc = getPublicSensorsVerbose(sensorList);
if (rc != SC_OK) {
......@@ -336,7 +330,6 @@ SCError SensorConfigImpl::loadCache()
} else {
for (auto& s: sensorList) {
sensorMapByName.insert(std::make_pair(s.name, std::ref(s)));
sensorMapByPattern.insert(std::make_pair(s.pattern, std::ref(s)));
}
return SC_OK;
}
......@@ -1088,7 +1081,6 @@ SCError SensorConfigImpl::getPublicSensorByName(PublicSensor& sensor, const char
/* Add to sensorPropertyCache for later use */
sensorList.push_back(sensor);
sensorMapByName.insert(std::make_pair(publicName, std::ref(sensorList.back())));
sensorMapByPattern.insert(std::make_pair(sensor.pattern, std::ref(sensorList.back())));
}
else {
cass_result_free(result);
......@@ -1108,21 +1100,6 @@ SCError SensorConfigImpl::getPublicSensorByName(PublicSensor& sensor, const char
return SC_OK;
}
SCError SensorConfigImpl::getPublicSensorByPattern(PublicSensor& sensor, const char* pattern)
{
if (sensorList.size() == 0) {
loadCache();
}
SensorMap_t::const_iterator got = sensorMapByPattern.find(pattern);
if (got != sensorMapByPattern.end()) {
sensor = got->second;
return SC_OK;
} else {
return SC_UNKNOWNSENSOR;
}
}
SCError SensorConfigImpl::getPublicSensorsByWildcard(std::list<PublicSensor>& sensors, const char* wildcard)
{
SCError err = SC_OK;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment