Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
The container registry cleanup task is now completed and the registry can be used normally.
Open sidebar
dcdb
dcdb
Commits
47ce8bf6
Commit
47ce8bf6
authored
Aug 10, 2020
by
Michael Ott
Browse files
Remove getPublicSensorByPattern() function
parent
f578c9a8
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/include/dcdb/sensorconfig.h
View file @
47ce8bf6
...
@@ -215,15 +215,6 @@ public:
...
@@ -215,15 +215,6 @@ public:
*/
*/
SCError
getPublicSensorByName
(
PublicSensor
&
sensor
,
const
char
*
publicName
);
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.
* @brief Retrieve a list of public sensors that match a wildcard.
*
*
...
...
lib/include_internal/sensorconfig_internal.h
View file @
47ce8bf6
...
@@ -51,7 +51,6 @@ protected:
...
@@ -51,7 +51,6 @@ protected:
typedef
std
::
unordered_map
<
std
::
string
,
std
::
reference_wrapper
<
PublicSensor
>>
SensorMap_t
;
typedef
std
::
unordered_map
<
std
::
string
,
std
::
reference_wrapper
<
PublicSensor
>>
SensorMap_t
;
SensorMap_t
sensorMapByName
;
SensorMap_t
sensorMapByName
;
SensorMap_t
sensorMapByPattern
;
std
::
list
<
PublicSensor
>
sensorList
;
std
::
list
<
PublicSensor
>
sensorList
;
bool
validateSensorPattern
(
const
char
*
sensorPattern
);
bool
validateSensorPattern
(
const
char
*
sensorPattern
);
...
@@ -69,7 +68,6 @@ public:
...
@@ -69,7 +68,6 @@ public:
SCError
getPublicSensorsVerbose
(
std
::
list
<
PublicSensor
>&
publicSensors
);
SCError
getPublicSensorsVerbose
(
std
::
list
<
PublicSensor
>&
publicSensors
);
SCError
getPublicSensorByName
(
PublicSensor
&
sensor
,
const
char
*
publicName
);
SCError
getPublicSensorByName
(
PublicSensor
&
sensor
,
const
char
*
publicName
);
SCError
getPublicSensorByPattern
(
PublicSensor
&
sensor
,
const
char
*
pattern
);
SCError
getPublicSensorsByWildcard
(
std
::
list
<
PublicSensor
>&
sensors
,
const
char
*
wildcard
);
SCError
getPublicSensorsByWildcard
(
std
::
list
<
PublicSensor
>&
sensors
,
const
char
*
wildcard
);
SCError
isVirtual
(
bool
&
isVirtual
,
std
::
string
publicName
);
SCError
isVirtual
(
bool
&
isVirtual
,
std
::
string
publicName
);
...
...
lib/src/sensorconfig.cpp
View file @
47ce8bf6
...
@@ -179,11 +179,6 @@ SCError SensorConfig::getPublicSensorByName(PublicSensor& sensor, const char* pu
...
@@ -179,11 +179,6 @@ SCError SensorConfig::getPublicSensorByName(PublicSensor& sensor, const char* pu
return
impl
->
getPublicSensorByName
(
sensor
,
publicName
);
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
)
SCError
SensorConfig
::
getPublicSensorsByWildcard
(
std
::
list
<
PublicSensor
>&
sensors
,
const
char
*
wildcard
)
{
{
return
impl
->
getPublicSensorsByWildcard
(
sensors
,
wildcard
);
return
impl
->
getPublicSensorsByWildcard
(
sensors
,
wildcard
);
...
@@ -328,7 +323,6 @@ SCError SensorConfigImpl::loadCache()
...
@@ -328,7 +323,6 @@ SCError SensorConfigImpl::loadCache()
{
{
sensorList
.
clear
();
sensorList
.
clear
();
sensorMapByName
.
clear
();
sensorMapByName
.
clear
();
sensorMapByPattern
.
clear
();
SCError
rc
=
getPublicSensorsVerbose
(
sensorList
);
SCError
rc
=
getPublicSensorsVerbose
(
sensorList
);
if
(
rc
!=
SC_OK
)
{
if
(
rc
!=
SC_OK
)
{
...
@@ -336,7 +330,6 @@ SCError SensorConfigImpl::loadCache()
...
@@ -336,7 +330,6 @@ SCError SensorConfigImpl::loadCache()
}
else
{
}
else
{
for
(
auto
&
s
:
sensorList
)
{
for
(
auto
&
s
:
sensorList
)
{
sensorMapByName
.
insert
(
std
::
make_pair
(
s
.
name
,
std
::
ref
(
s
)));
sensorMapByName
.
insert
(
std
::
make_pair
(
s
.
name
,
std
::
ref
(
s
)));
sensorMapByPattern
.
insert
(
std
::
make_pair
(
s
.
pattern
,
std
::
ref
(
s
)));
}
}
return
SC_OK
;
return
SC_OK
;
}
}
...
@@ -1088,7 +1081,6 @@ SCError SensorConfigImpl::getPublicSensorByName(PublicSensor& sensor, const char
...
@@ -1088,7 +1081,6 @@ SCError SensorConfigImpl::getPublicSensorByName(PublicSensor& sensor, const char
/* Add to sensorPropertyCache for later use */
/* Add to sensorPropertyCache for later use */
sensorList
.
push_back
(
sensor
);
sensorList
.
push_back
(
sensor
);
sensorMapByName
.
insert
(
std
::
make_pair
(
publicName
,
std
::
ref
(
sensorList
.
back
())));
sensorMapByName
.
insert
(
std
::
make_pair
(
publicName
,
std
::
ref
(
sensorList
.
back
())));
sensorMapByPattern
.
insert
(
std
::
make_pair
(
sensor
.
pattern
,
std
::
ref
(
sensorList
.
back
())));
}
}
else
{
else
{
cass_result_free
(
result
);
cass_result_free
(
result
);
...
@@ -1108,21 +1100,6 @@ SCError SensorConfigImpl::getPublicSensorByName(PublicSensor& sensor, const char
...
@@ -1108,21 +1100,6 @@ SCError SensorConfigImpl::getPublicSensorByName(PublicSensor& sensor, const char
return
SC_OK
;
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
SensorConfigImpl
::
getPublicSensorsByWildcard
(
std
::
list
<
PublicSensor
>&
sensors
,
const
char
*
wildcard
)
{
{
SCError
err
=
SC_OK
;
SCError
err
=
SC_OK
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment