pipeline: ipa: raspberrypi: Switch to use C++17 features where possible

With the recent change to use C++17, the following code changes can be
made:
- Use C++17 [[fallthough]] attribute instead of /* Fall through */.
- Swap boost::any to std::any.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Naushir Patuck 2020-10-06 10:07:31 +01:00 committed by Laurent Pinchart
parent dcc47ff715
commit bb6167873e
2 changed files with 5 additions and 6 deletions

View file

@ -8,13 +8,12 @@
// A simple class for carrying arbitrary metadata, for example about an image.
#include <any>
#include <string>
#include <mutex>
#include <map>
#include <memory>
#include <boost/any.hpp>
namespace RPiController {
class Metadata
@ -31,7 +30,7 @@ public:
auto it = data_.find(tag);
if (it == data_.end())
return -1;
value = boost::any_cast<T>(it->second);
value = std::any_cast<T>(it->second);
return 0;
}
void Clear()
@ -53,7 +52,7 @@ public:
auto it = data_.find(tag);
if (it == data_.end())
return nullptr;
return boost::any_cast<T>(&it->second);
return std::any_cast<T>(&it->second);
}
template<typename T>
void SetLocked(std::string const &tag, T const &value)
@ -69,7 +68,7 @@ public:
private:
mutable std::mutex mutex_;
std::map<std::string, boost::any> data_;
std::map<std::string, std::any> data_;
};
typedef std::shared_ptr<Metadata> MetadataPtr;