OpenCV  5.0.0alpha
Open Source Computer Vision
Loading...
Searching...
No Matches
cv::dnn::Dict Class Reference

This class implements name-value dictionary, values are instances of DictValue. More...

#include <opencv2/dnn/dict.hpp>

Collaboration diagram for cv::dnn::Dict:

Public Member Functions

std::map< String, DictValue >::const_iterator begin () const
 
std::map< String, DictValue >::const_iterator end () const
 
void erase (const String &key)
 Erase key from the dictionary.
 
const DictValueget (const String &key) const
 If the key in the dictionary then returns its value, else an error will be generated.
 
template<typename T >
get (const String &key) const
 
template<typename T >
get (const String &key, const T &defaultValue) const
 If the key in the dictionary then returns its value, else returns defaultValue.
 
template<typename T >
std::vector< T > getVector (const String &key) const
 If the key in the dictionary then returns its value, else returns empty vector.
 
bool has (const String &key) const
 Checks a presence of the key in the dictionary.
 
DictValueptr (const String &key)
 If the key in the dictionary then returns pointer to its value, else returns NULL.
 
const DictValueptr (const String &key) const
 
template<typename T >
const T & set (const String &key, const T &value)
 Sets new value for the key, or adds new key-value pair into the dictionary.
 

Friends

std::ostream & operator<< (std::ostream &stream, const Dict &dict)
 

Detailed Description

This class implements name-value dictionary, values are instances of DictValue.

Member Function Documentation

◆ begin()

std::map< String, DictValue >::const_iterator cv::dnn::Dict::begin ( ) const

◆ end()

std::map< String, DictValue >::const_iterator cv::dnn::Dict::end ( ) const

◆ erase()

void cv::dnn::Dict::erase ( const String & key)

Erase key from the dictionary.

◆ get() [1/3]

const DictValue & cv::dnn::Dict::get ( const String & key) const

If the key in the dictionary then returns its value, else an error will be generated.

◆ get() [2/3]

template<typename T >
T cv::dnn::Dict::get ( const String & key) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ get() [3/3]

template<typename T >
T cv::dnn::Dict::get ( const String & key,
const T & defaultValue ) const

If the key in the dictionary then returns its value, else returns defaultValue.

◆ getVector()

template<typename T >
std::vector< T > cv::dnn::Dict::getVector ( const String & key) const

If the key in the dictionary then returns its value, else returns empty vector.

◆ has()

bool cv::dnn::Dict::has ( const String & key) const

Checks a presence of the key in the dictionary.

◆ ptr() [1/2]

DictValue * cv::dnn::Dict::ptr ( const String & key)

If the key in the dictionary then returns pointer to its value, else returns NULL.

◆ ptr() [2/2]

const DictValue * cv::dnn::Dict::ptr ( const String & key) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ set()

template<typename T >
const T & cv::dnn::Dict::set ( const String & key,
const T & value )

Sets new value for the key, or adds new key-value pair into the dictionary.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & stream,
const Dict & dict )
friend

The documentation for this class was generated from the following file: