42#include <opencv2/core.hpp>
46#include <opencv2/dnn/dnn.hpp>
48#ifndef OPENCV_DNN_DNN_DICT_HPP
49#define OPENCV_DNN_DNN_DICT_HPP
53CV__DNN_INLINE_NS_BEGIN
68 CV_WRAP
DictValue(
const String &s) : type(Param::STRING), ps(new
AutoBuffer<String,1>) { (*ps)[0] = s; }
71 template<
typename TypeIter>
73 template<
typename TypeIter>
74 static DictValue arrayReal(TypeIter begin,
int size);
75 template<
typename TypeIter>
76 static DictValue arrayString(TypeIter begin,
int size);
79 T
get(
int idx = -1)
const;
83 CV_WRAP
bool isInt()
const;
84 CV_WRAP
bool isString()
const;
85 CV_WRAP
bool isReal()
const;
87 CV_WRAP
int getIntValue(
int idx = -1)
const;
88 CV_WRAP
double getRealValue(
int idx = -1)
const;
89 CV_WRAP String getStringValue(
int idx = -1)
const;
93 friend std::ostream &operator<<(std::ostream &stream,
const DictValue &dictv);
109 DictValue(Param _type,
void *_p) : type(_type), pv(_p) {}
116 typedef std::map<String, DictValue> _Dict;
122 bool has(
const String &key)
const;
128 const DictValue *ptr(
const String &key)
const;
131 const DictValue &get(
const String &key)
const;
134 template <
typename T>
135 T get(
const String &key)
const;
138 template <
typename T>
139 T get(
const String &key,
const T &defaultValue)
const;
143 const T &set(
const String &key,
const T &value);
146 void erase(
const String &key);
148 friend std::ostream &operator<<(std::ostream &stream,
const Dict &dict);
150 std::map<String, DictValue>::const_iterator begin()
const;
152 std::map<String, DictValue>::const_iterator end()
const;
Automatically Allocated Buffer Class
Definition: utility.hpp:102
This class implements name-value dictionary, values are instances of DictValue.
Definition: dict.hpp:115
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75
This struct stores the scalar value (or array) of one of the following type: double,...
Definition: dict.hpp:61
DictValue(bool i)
Constructs integer scalar
Definition: dict.hpp:63
DictValue(const char *s)
これはオーバーロードされたメンバ関数です。利便性のために用意されています。元の関数との違いは引き数のみです。
Definition: dict.hpp:69
DictValue(int64 i=0)
Constructs integer scalar
Definition: dict.hpp:64
static DictValue arrayInt(TypeIter begin, int size)
Constructs integer array
DictValue(unsigned p)
Constructs integer scalar
Definition: dict.hpp:66
T get(int idx=-1) const
Tries to convert array element with specified index to requested type and returns its.