#ifndef MEDIAPIPE_FRAMEWORK_TOOL_OPTIONS_MAP_H_
#define MEDIAPIPE_FRAMEWORK_TOOL_OPTIONS_MAP_H_
#include <map>
#include <memory>
#include <type_traits>
#include "absl/synchronization/mutex.h"
#include "mediapipe/framework/calculator.pb.h"
#include "mediapipe/framework/port/any_proto.h"
#include "mediapipe/framework/tool/type_util.h"
namespace mediapipe {
namespace tool {
extern absl::Mutex option_extension_lock;
template <typename T>
struct IsExtension { … };
template <class T,
typename std::enable_if<IsExtension<T>::value, int>::type = 0>
bool HasExtension(const CalculatorOptions& options) { … }
template <class T,
typename std::enable_if<!IsExtension<T>::value, int>::type = 0>
bool HasExtension(const CalculatorOptions& options) { … }
template <class T,
typename std::enable_if<IsExtension<T>::value, int>::type = 0>
T* GetExtension(CalculatorOptions& options) { … }
template <class T,
typename std::enable_if<!IsExtension<T>::value, int>::type = 0>
T* GetExtension(const CalculatorOptions& options) { … }
template <class T>
void GetExtension(const CalculatorOptions& options, T* result) { … }
template <class T>
void GetNodeOptions(const CalculatorGraphConfig::Node& node_config, T* result) { … }
template <class T>
void SetNodeOptions(CalculatorGraphConfig::Node& node_config, const T& value) { … }
class TypeMap { … };
class OptionsMap { … };
class MutableOptionsMap : public OptionsMap { … };
}
}
#endif