Remove custom version of getPtr
Now that sdbusplus variant supports std::get_if, we can remove our
custom, mapbox namespaced implementation that does the same thing.
Change-Id: I854c473003e28e41dd45dba08ca683433f1c1774
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp
index 44725b1..f3c3ec3 100644
--- a/redfish-core/lib/managers.hpp
+++ b/redfish-core/lib/managers.hpp
@@ -174,7 +174,8 @@
return;
}
const std::string* namePtr =
- mapbox::getPtr<const std::string>(findName->second);
+ sdbusplus::message::variant_ns::get_if<std::string>(
+ &findName->second);
if (namePtr == nullptr)
{
BMCWEB_LOG_ERROR << "Pid Name Field illegal";
@@ -214,8 +215,9 @@
// zones
if (intfPair.first == pidZoneConfigurationIface)
{
- const double* ptr = mapbox::getPtr<const double>(
- propertyPair.second);
+ const double* ptr =
+ sdbusplus::message::variant_ns::get_if<double>(
+ &propertyPair.second);
if (ptr == nullptr)
{
BMCWEB_LOG_ERROR << "Field Illegal "
@@ -233,8 +235,9 @@
auto findClass = intfPair.second.find("Class");
if (findClass != intfPair.second.end())
{
- classPtr = mapbox::getPtr<const std::string>(
- findClass->second);
+ classPtr =
+ sdbusplus::message::variant_ns::get_if<
+ std::string>(&findClass->second);
}
if (classPtr == nullptr)
{
@@ -274,9 +277,9 @@
if (propertyPair.first == "Zones")
{
const std::vector<std::string>* inputs =
- mapbox::getPtr<
- const std::vector<std::string>>(
- propertyPair.second);
+ sdbusplus::message::variant_ns::get_if<
+ std::vector<std::string>>(
+ &propertyPair.second);
if (inputs == nullptr)
{
@@ -309,9 +312,9 @@
{
auto& data = element[propertyPair.first];
const std::vector<std::string>* inputs =
- mapbox::getPtr<
- const std::vector<std::string>>(
- propertyPair.second);
+ sdbusplus::message::variant_ns::get_if<
+ std::vector<std::string>>(
+ &propertyPair.second);
if (inputs == nullptr)
{
@@ -335,8 +338,8 @@
propertyPair.first == "SlewPos")
{
const double* ptr =
- mapbox::getPtr<const double>(
- propertyPair.second);
+ sdbusplus::message::variant_ns::get_if<
+ double>(&propertyPair.second);
if (ptr == nullptr)
{
BMCWEB_LOG_ERROR << "Field Illegal "
@@ -752,8 +755,8 @@
if (property.first == "Version")
{
const std::string* value =
- mapbox::getPtr<const std::string>(
- property.second);
+ sdbusplus::message::variant_ns::get_if<
+ std::string>(&property.second);
if (value == nullptr)
{
continue;