NEST main@caf0ae8
 
Loading...
Searching...
No Matches
dictionary_ Class Reference

A Python-like dictionary_, based on std::map. More...

#include <dictionary.h>

Inheritance diagram for dictionary_:
[legend]
Collaboration diagram for dictionary_:
[legend]

Public Member Functions

template<DictionaryEntryType T>
T get (const std::string &key) const
 See Dictionary::get.
 
template<typename T >
std::vector< T > & get_or_create_vector (const std::string &key)
 See Dictionary::get_or_create_vector.
 
template<typename T >
bool update_value (const std::string &key, T &value) const
 See Dictionary::update_value.
 
template<Integer T>
bool update_integer_value (const std::string &key, T &value) const
 See Dictionary::update_integer_value.
 
bool update_dictionary (Dictionary &dict_out) const
 See Dictionary::update_dictionary.
 
bool known (const std::string &key) const
 See Dictionary::known.
 
void mark_as_accessed (const std::string &key) const
 See Dictionary::marked_as_accessed.
 
bool has_been_accessed (const std::string &key) const
 See Dictionary::has_been_accessed.
 
bool operator== (const dictionary_ &other) const
 See Dictionary::operator==.
 
bool operator!= (const dictionary_ &other) const
 See Dictionary::operator!=.
 
void init_access_flags (const bool thread_local_dict=false) const
 See Dictionary::init_access_flags.
 
void all_entries_accessed (const std::string &where, const std::string &what, const bool thread_local_dict=false) const
 See Dictionary::all_entries_accessedinit_access_flags.
 
any_type & operator[] (const std::string &key)
 
any_type & operator[] (std::string &&key)
 
any_type & at (const std::string &key)
 
const any_type & at (const std::string &key) const
 
iterator find (const std::string &key)
 
const_iterator find (const std::string &key) const
 

Private Types

using maptype_ = std::map< std::string, DictEntry_ >
 

Private Member Functions

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.
 

Detailed Description

A Python-like dictionary_, based on std::map.

Values are stored as DictEntry_ items providing access checking.

Member Typedef Documentation

◆ maptype_

using dictionary_::maptype_ = std::map< std::string, DictEntry_ >
private

Member Function Documentation

◆ all_entries_accessed()

void dictionary_::all_entries_accessed ( const std::string &  where,
const std::string &  what,
const bool  thread_local_dict = false 
) const

See Dictionary::all_entries_accessedinit_access_flags.

References nest::VPManager::assert_single_threaded(), nest::kernel(), and nest::KernelManager::vp_manager.

Here is the call graph for this function:

◆ at() [1/2]

any_type & dictionary_::at ( const std::string &  key)

References register_access_().

Referenced by get().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ at() [2/2]

const any_type & dictionary_::at ( const std::string &  key) const

References register_access_().

Here is the call graph for this function:

◆ cast_to_integer_()

template<Integer RetT>
RetT dictionary_::cast_to_integer_ ( const any_type &  value,
const std::string &  key 
) const
inlineprivate

Cast the specified value to an integer.

Parameters
valuethe any object to cast.
keykey where the value is located in the dictionary, for information upon cast errors.
Exceptions
TypeMismatchif 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

References get_typename().

Here is the call graph for this function:

◆ 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
TType of element. If the value is not of the specified type, a TypeMismatch error is thrown.
Parameters
valuethe any object to cast.
keykey where the value is located in the Dictionary, for information upon cast errors.
Exceptions
TypeMismatchif the value is not of specified type T.
Returns
value cast to the specified type.

References get_typename().

Here is the call graph for this function:

◆ 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)

References register_access_().

Referenced by update_integer_value(), and update_value().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find() [2/2]

dictionary_::const_iterator dictionary_::find ( const std::string &  key) const

References register_access_().

Here is the call graph for this function:

◆ get()

template<DictionaryEntryType T>
T dictionary_::get ( const std::string &  key) const
inline

See Dictionary::get.

References at().

Here is the call graph for this function:

◆ 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

See Dictionary::init_access_flags.

References nest::VPManager::assert_single_threaded(), nest::kernel(), and nest::KernelManager::vp_manager.

Here is the call graph for this function:

◆ known()

bool dictionary_::known ( const std::string &  key) const
inline

See Dictionary::known.

Referenced by operator==().

Here is the caller graph for this function:

◆ mark_as_accessed()

void dictionary_::mark_as_accessed ( const std::string &  key) const
inline

See Dictionary::marked_as_accessed.

References register_access_().

Here is the call graph for this function:

◆ operator!=()

bool dictionary_::operator!= ( const dictionary_ &  other) const
inline

See Dictionary::operator!=.

◆ operator==()

bool dictionary_::operator== ( const dictionary_ &  other) const

See Dictionary::operator==.

References known().

Here is the call graph for this function:

◆ operator[]() [1/2]

any_type & dictionary_::operator[] ( const std::string &  key)

References register_access_().

Here is the call graph for this function:

◆ operator[]() [2/2]

any_type & dictionary_::operator[] ( std::string &&  key)

References register_access_().

Here is the call graph for this function:

◆ register_access_()

void dictionary_::register_access_ ( const DictEntry_ &  entry) const
private

Mark dictionary entry as accessed.

References DictEntry_::accessed.

Referenced by at(), at(), find(), find(), mark_as_accessed(), operator[](), and operator[]().

Here is the caller graph for this function:

◆ update_dictionary()

bool dictionary_::update_dictionary ( Dictionary &  dict_out) const
inline

◆ update_integer_value()

template<Integer T>
bool dictionary_::update_integer_value ( const std::string &  key,
T &  value 
) const
inline

See Dictionary::update_integer_value.

References find().

Here is the call graph for this function:

◆ update_value()

template<typename T >
bool dictionary_::update_value ( const std::string &  key,
T &  value 
) const
inline

See Dictionary::update_value.

References find().

Here is the call graph for this function:

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