NEST
2.6.0,not_revisioned_source_dir@0
|
A class that associates names and tokens. More...
#include <dict.h>
Classes | |
class | DictItemLexicalOrder |
Helper class for lexicographical sorting of dictionary entries. More... | |
Public Types | |
typedef TokenMap::const_iterator | const_iterator |
Constant iterator for dictionary. More... | |
Public Member Functions | |
Dictionary () | |
Dictionary (const Dictionary &d) | |
~Dictionary () | |
void | clear () |
const Token & | lookup (const Name &n) const |
Lookup and return Token with given name in dictionary. More... | |
const Token & | lookup2 (const Name &n) const |
lookup a name in the dictionary. More... | |
bool | known (const Name &) const |
bool | known_but_not_accessed (const Name &) const |
Returns true if name is known but token has not been accessed. More... | |
Token & | insert (const Name &n, const Token &t) |
Token & | insert_move (const Name &, Token &) |
void | remove (const Name &n) |
Remove entry from dictionary. More... | |
const Token & | operator[] (const Name &) const |
Token & | operator[] (const Name &) |
const Token & | operator[] (const char *) const |
Token & | operator[] (const char *) |
bool | empty (void) const |
void | info (std::ostream &) const |
bool | operator== (const Dictionary &d) const |
void | add_dict (const std::string &, SLIInterpreter &) |
Add the contents of this dictionary to another. More... | |
void | remove_dict (const std::string &, SLIInterpreter &) |
Remove entries found in another dictionary from this. More... | |
void | clear_access_flags () |
Clear access flags on all dictionary elements. More... | |
bool | all_accessed (std::string &missed) const |
Check whether all elements have been accessed. More... | |
void | initialize_property_array (Name propname) |
First element in dictionary. More... | |
void | add_dictstack_reference () |
This function is called when a dictionary is pushed to the dictionary stack. More... | |
void | remove_dictstack_reference () |
This function is called when the dictionary is popped from the dictionary stack. More... | |
bool | is_on_dictstack () const |
Returns true, if the dictionary has references on the dictionary stack. More... | |
Private Member Functions | |
bool | all_accessed_ (std::string &, std::string prefix=std::string()) const |
Private Attributes | |
int | refs_on_dictstack_ |
Worker function checking whether all elements have been accessed. More... | |
Static Private Attributes | |
static const Token | VoidToken |
Friends | |
std::ostream & | operator<< (std::ostream &, const Dictionary &) |
A class that associates names and tokens.
typedef TokenMap::const_iterator Dictionary::const_iterator |
Constant iterator for dictionary.
Dictionary inherits privately from std::map to hide implementation details. To allow for inspection of all elements in a dictionary, we export the constant iterator type and begin() and end() methods.
|
inline |
|
inline |
Dictionary::~Dictionary | ( | ) |
void Dictionary::add_dict | ( | const std::string & | target, |
SLIInterpreter & | i | ||
) |
Add the contents of this dictionary to another.
The target dictionary is given by names and must be retrieved via the interpreter.
References SLIInterpreter::baselookup(), and nest::names::d.
|
inline |
This function is called when a dictionary is pushed to the dictionary stack.
The dictioray stack must keep track about which dictioraries are on the dictionary stack. If a dictionary is modified and it is on the dictionary stack, the cache of the dictionary stack must be adjusted. This is e.g. the case for the systemdict or the errordict.
References refs_on_dictstack_.
|
inline |
Check whether all elements have been accessed.
Checks nested dictionaries recursively.
std::string& | contains string with names of non-accessed entries |
References all_accessed_().
Referenced by nest::register_preconf_model().
|
private |
Referenced by all_accessed().
void Dictionary::clear | ( | ) |
References nest::names::clear, clear(), nest::names::d, nest::names::dt, lockPTR< D >::get(), and lockPTR< D >::unlock().
Referenced by clear(), and nest::Network::clear_models_().
void Dictionary::clear_access_flags | ( | ) |
Clear access flags on all dictionary elements.
Flags for nested dictionaries are cleared recursively.
Referenced by nest::register_preconf_model().
|
inline |
void Dictionary::info | ( | std::ostream & | out | ) | const |
void Dictionary::initialize_property_array | ( | Name | propname | ) |
First element in dictionary.
Dictionary inherits privately from std::map to hide implementation details. To allow for inspection of all elements in a dictionary, we export the constant iterator type and begin() and end() methods. One-past-last element in dictionary. Dictionary inherits privately from std::map to hide implementation details. To allow for inspection of all elements in a dictionary, we export the constant iterator type and begin() and end() methods.
Referenced by nest::Network::copy_model(), SLIInterpreter::execute_(), SLIInterpreter::execute_debug_(), RegexpModule::init(), Processes::init(), nest::Network::init_(), SLIInterpreter::raiseagain(), SLIInterpreter::raiseerror(), SLIInterpreter::raisesignal(), nest::Network::register_conn_builder(), nest::Network::register_model(), and SLIInterpreter::SLIInterpreter().
References Token::move().
Referenced by librandom::GslRandomGen::add_gsl_rngs(), SLIInterpreter::raiseerror(), and RandomNumbers::register_rdv_().
|
inline |
Returns true, if the dictionary has references on the dictionary stack.
References refs_on_dictstack_.
|
inline |
Referenced by librandom::GslRandomGen::add_gsl_rngs(), nest::ConnBuilder::ConnBuilder(), nest::Network::connect(), nest::Network::copy_model(), nest::NestModule::CopyModel_l_l_DFunction::execute(), SLIInterpreter::execute_(), SLIInterpreter::execute_debug_(), SLIInterpreter::print_error(), SLIInterpreter::raiseagain(), nest::RandomParameter::RandomParameter(), nest::Network::register_basis_model(), nest::Network::register_conn_builder(), nest::Network::register_model(), and SLIInterpreter::terminate().
|
inline |
Returns true if name is known but token has not been accessed.
Lookup and return Token with given name in dictionary.
If the name is not found, an empty token is returned. This version of lookup is deprecated and will disappear in future versions. Please use lookup2() instead.
const &
, so that the control flag for dictionary read-out is set on the Token in the dictionary, not its copy. References VoidToken.
Referenced by nest::ConnectionCreator::ConnectionCreator(), nest::AbstractLayer::create_layer(), nest::NestModule::SetDefaults_l_DFunction::execute(), nest::NestModule::GetDefaults_lFunction::execute(), nest::NestModule::CopyModel_l_l_DFunction::execute(), nest::NestModule::Create_l_iFunction::execute(), nest::NestModule::DataConnect_i_D_sFunction::execute(), nest::NestModule::Connect_i_i_lFunction::execute(), nest::NestModule::Connect_i_i_d_d_lFunction::execute(), nest::NestModule::Connect_i_i_D_lFunction::execute(), nest::NestModule::DivergentConnect_i_ia_a_a_lFunction::execute(), nest::NestModule::RDivergentConnect_i_i_ia_da_da_b_b_lFunction::execute(), nest::NestModule::ConvergentConnect_ia_i_a_a_lFunction::execute(), nest::NestModule::RConvergentConnect_ia_i_i_da_da_b_b_lFunction::execute(), nest::NestModule::RConvergentConnect_ia_ia_ia_daa_daa_b_b_lFunction::execute(), SLIInterpreter::print_error(), SLIInterpreter::raiseagain(), SLIInterpreter::raiseerror(), and nest::Selector::Selector().
lookup a name in the dictionary.
If the name is not found an UndefinedName exception is thrown. lookup2 is the preferred way to retrieve entries from the dictionary.
const &
, so that the control flag for dictionary read-out is set on the Token in the dictionary, not its copy. References Name::toString().
|
inline |
References operator==().
References Name::toString().
Referenced by operator[]().
const Token & Dictionary::operator[] | ( | const char * | n | ) | const |
References operator[]().
Token & Dictionary::operator[] | ( | const char * | n | ) |
References operator[]().
void Dictionary::remove | ( | const Name & | n | ) |
Remove entry from dictionary.
Referenced by nest::Network::unregister_model().
void Dictionary::remove_dict | ( | const std::string & | target, |
SLIInterpreter & | i | ||
) |
Remove entries found in another dictionary from this.
References SLIInterpreter::baselookup(), and nest::names::d.
|
inline |
This function is called when the dictionary is popped from the dictionary stack.
References refs_on_dictstack_.
|
friend |
|
private |
Worker function checking whether all elements have been accessed.
Checks nested dictionaries recursively.
std::string& | contains string with names of non-accessed entries |
std::string | prefix for nested dictionary entries, built during recursion |
Referenced by add_dictstack_reference(), is_on_dictstack(), and remove_dictstack_reference().