chromium/third_party/mediapipe/src/mediapipe/framework/tool/options_map.h

#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;

// A compile-time detector for the constant |T::ext|.
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) {}

// A map from object type to object.
class TypeMap {};

// Extracts the options message of a specified type from a
// CalculatorGraphConfig::Node.
class OptionsMap {};

class MutableOptionsMap : public OptionsMap {};

}  // namespace tool
}  // namespace mediapipe

#endif  // MEDIAPIPE_FRAMEWORK_TOOL_OPTIONS_MAP_H_