A Python-like dictionary_, based on std::map.
More...
#include <dictionary.h>
|
| template<typename T > |
| T | cast_value_ (const any_type &value, const std::string &key) const |
| | Cast the specified non-vector value to the specified type.
|
| |
| template<Integer RetT> |
| RetT | cast_to_integer_ (const any_type &value, const std::string &key) const |
| | Cast the specified value to an integer.
|
| |
| void | register_access_ (const DictEntry_ &entry) const |
| | Mark dictionary entry as accessed.
|
| |
| template<> |
| double | cast_value_ (const any_type &value, const std::string &key) const |
| |
| template<> |
| double | cast_value_ (const any_type &value, const std::string &key) const |
| | Specialization that allows passing long where double is expected.
|
| |
A Python-like dictionary_, based on std::map.
Values are stored as DictEntry_ items providing access checking.
◆ maptype_
◆ all_entries_accessed()
| void dictionary_::all_entries_accessed |
( |
const std::string & |
where, |
|
|
const std::string & |
what, |
|
|
const bool |
thread_local_dict = false |
|
) |
| const |
◆ at() [1/2]
| any_type & dictionary_::at |
( |
const std::string & |
key | ) |
|
◆ at() [2/2]
| const any_type & dictionary_::at |
( |
const std::string & |
key | ) |
const |
◆ cast_to_integer_()
| RetT dictionary_::cast_to_integer_ |
( |
const any_type & |
value, |
|
|
const std::string & |
key |
|
) |
| const |
|
inlineprivate |
Cast the specified value to an integer.
- Parameters
-
| value | the any object to cast. |
| key | key where the value is located in the dictionary, for information upon cast errors. |
- Exceptions
-
| TypeMismatch | if the value is not an integer. |
- Returns
- value cast to an integer.
◆ cast_value_() [1/3]
template<>
| double dictionary_::cast_value_ |
( |
const any_type & |
value, |
|
|
const std::string & |
key |
|
) |
| const |
|
private |
◆ cast_value_() [2/3]
template<typename T >
| T dictionary_::cast_value_ |
( |
const any_type & |
value, |
|
|
const std::string & |
key |
|
) |
| const |
|
inlineprivate |
Cast the specified non-vector value to the specified type.
- Template Parameters
-
| T | Type of element. If the value is not of the specified type, a TypeMismatch error is thrown. |
- Parameters
-
| value | the any object to cast. |
| key | key where the value is located in the Dictionary, for information upon cast errors. |
- Exceptions
-
| TypeMismatch | if the value is not of specified type T. |
- Returns
- value cast to the specified type.
References get_typename().
◆ cast_value_() [3/3]
template<>
| double dictionary_::cast_value_ |
( |
const any_type & |
value, |
|
|
const std::string & |
key |
|
) |
| const |
|
private |
Specialization that allows passing long where double is expected.
◆ find() [1/2]
| dictionary_::iterator dictionary_::find |
( |
const std::string & |
key | ) |
|
◆ find() [2/2]
| dictionary_::const_iterator dictionary_::find |
( |
const std::string & |
key | ) |
const |
◆ get()
| T dictionary_::get |
( |
const std::string & |
key | ) |
const |
|
inline |
◆ get_or_create_vector()
template<typename T >
| std::vector< T > & dictionary_::get_or_create_vector |
( |
const std::string & |
key | ) |
|
|
inline |
◆ has_been_accessed()
| bool dictionary_::has_been_accessed |
( |
const std::string & |
key | ) |
const |
|
inline |
◆ init_access_flags()
| void dictionary_::init_access_flags |
( |
const bool |
thread_local_dict = false | ) |
const |
◆ known()
| bool dictionary_::known |
( |
const std::string & |
key | ) |
const |
|
inline |
◆ mark_as_accessed()
| void dictionary_::mark_as_accessed |
( |
const std::string & |
key | ) |
const |
|
inline |
◆ operator!=()
| bool dictionary_::operator!= |
( |
const dictionary_ & |
other | ) |
const |
|
inline |
See Dictionary::operator!=.
◆ operator==()
| bool dictionary_::operator== |
( |
const dictionary_ & |
other | ) |
const |
◆ operator[]() [1/2]
| any_type & dictionary_::operator[] |
( |
const std::string & |
key | ) |
|
◆ operator[]() [2/2]
| any_type & dictionary_::operator[] |
( |
std::string && |
key | ) |
|
◆ register_access_()
| void dictionary_::register_access_ |
( |
const DictEntry_ & |
entry | ) |
const |
|
private |
◆ update_dictionary()
| bool dictionary_::update_dictionary |
( |
Dictionary & |
dict_out | ) |
const |
|
inline |
◆ update_integer_value()
| bool dictionary_::update_integer_value |
( |
const std::string & |
key, |
|
|
T & |
value |
|
) |
| const |
|
inline |
◆ update_value()
template<typename T >
| bool dictionary_::update_value |
( |
const std::string & |
key, |
|
|
T & |
value |
|
) |
| const |
|
inline |
The documentation for this class was generated from the following files: