35 typedef std::map<Name, Token, std::less<Name> >
TokenMap;
39 return (x.size() == y.size()) && equal(x.begin(), x.end(), y.begin());
61 const std::pair<Name, Token>& rhs)
const
63 const std::string& ls = lhs.first.toString();
64 const std::string& rs = rhs.first.toString();
66 return std::lexicographical_compare(ls.begin(), ls.end(),
77 using TokenMap::erase;
79 using TokenMap::begin;
81 using TokenMap::iterator;
117 void remove(
const Name&
n);
124 bool empty(
void)
const {
return TokenMap::empty(); }
126 void info(std::ostream &)
const;
234 bool all_accessed_(std::string&, std::string prefix = std::string())
const;
241 TokenMap::const_iterator where = find(n);
243 return (*where).second;
251 TokenMap::const_iterator where = find(n);
253 return (*where).second;
261 TokenMap::const_iterator where = find(n);
271 TokenMap::const_iterator where = find(n);
273 return not where->second.accessed();
281 return TokenMap::operator[](n) = t;
288 TokenMap::const_iterator where = find(n);
290 return (*where).second;
299 return TokenMap::operator[](n);
305 Token &result=TokenMap::operator[](n);
Helper class for lexicographical sorting of dictionary entries.
Definition: dict.h:55
const Token & lookup2(const Name &n) const
lookup a name in the dictionary.
Definition: dict.h:249
void remove_dict(const std::string &, SLIInterpreter &)
Remove entries found in another dictionary from this.
Definition: dict.cc:124
void info(std::ostream &) const
Definition: dict.cc:66
std::map< Name, Token, std::less< Name > > TokenMap
Definition: dict.h:35
const Name d("d")
Specific to Izhikevich 2003.
Definition: nest_names.h:83
const Token & lookup(const Name &n) const
Lookup and return Token with given name in dictionary.
Definition: dict.h:239
void move(Token &c)
Definition: token.h:142
Dictionary(const Dictionary &d)
Definition: dict.h:74
bool all_accessed(std::string &missed) const
Check whether all elements have been accessed.
Definition: dict.h:161
const Token & operator[](const Name &) const
Definition: dict.h:286
void remove_dictstack_reference()
This function is called when the dictionary is popped from the dictionary stack.
Definition: dict.h:208
bool known_but_not_accessed(const Name &) const
Returns true if name is known but token has not been accessed.
Definition: dict.h:269
Represent strings by ints to facilitate fast comparison.
Definition: name.h:53
TokenMap::const_iterator const_iterator
Constant iterator for dictionary.
Definition: dict.h:171
bool is_on_dictstack() const
Returns true, if the dictionary has references on the dictionary stack.
Definition: dict.h:216
void add_dictstack_reference()
This function is called when a dictionary is pushed to the dictionary stack.
Definition: dict.h:200
int refs_on_dictstack_
Worker function checking whether all elements have been accessed.
Definition: dict.h:233
A class that associates names and tokens.
Definition: dict.h:45
const std::string & toString(void) const
Return string represented by Name.
Definition: name.cc:63
void add_dict(const std::string &, SLIInterpreter &)
Add the contents of this dictionary to another.
Definition: dict.cc:97
const Name y("y")
Definition: topology_names.h:52
void clear_access_flags()
Clear access flags on all dictionary elements.
Definition: dict.cc:142
bool empty(void) const
Definition: dict.h:124
Definition: interpret.h:69
const Name x("x")
current scaling factor of the synaptic weight [0...1] (Tsodyks2_connection)
Definition: nest_names.h:356
Dictionary()
Definition: dict.h:73
bool operator()(const std::pair< Name, Token > &lhs, const std::pair< Name, Token > &rhs) const
Definition: dict.h:60
Token & insert_move(const Name &, Token &)
Definition: dict.h:303
void clear()
Definition: dict.cc:49
bool operator==(const TokenMap &x, const TokenMap &y)
Definition: dict.h:37
Token & insert(const Name &n, const Token &t)
Definition: dict.h:279
const Name n("n")
Number of synaptic release sites (int >=0) (Tsodyks2_connection)
Definition: nest_names.h:202
friend std::ostream & operator<<(std::ostream &, const Dictionary &)
Definition: dict.cc:191
void initialize_property_array(Name propname)
First element in dictionary.
~Dictionary()
Definition: dict.cc:35
A type-independent container for C++-types.
Definition: token.h:68
bool known(const Name &) const
Definition: dict.h:259
Exception to be thrown if an entry referenced inside a dictionary does not exist. ...
Definition: sliexceptions.h:263
bool all_accessed_(std::string &, std::string prefix=std::string()) const
Definition: dict.cc:165
bool operator==(const Dictionary &d) const
Definition: dict.h:128
static const Token VoidToken
Definition: dict.h:235
static bool nocase_compare(char c1, char c2)
Definition: dict.cc:206