23 #ifndef DICTIONARYSTACK_H
24 #define DICTIONARYSTACK_H
64 #ifndef DICTSTACK_CACHE
65 #define DICTSTACK_CACHE 1
74 std::list<DictionaryDatum>
d;
76 #ifdef DICTSTACK_CACHE
87 #ifdef DICTSTACK_CACHE
127 for(TokenMap::iterator i = d->begin(); i != d->end(); ++i)
138 const size_t cache_size=
cache_.size();
140 for(
size_t i=0; i< cache_size; ++i)
160 #ifdef DICTSTACK_CACHE
170 std::list<DictionaryDatum>::const_iterator i=
d.begin();
174 TokenMap::const_iterator
where =(*i)->find(n);
175 if(where!=(*i)->end())
177 #ifdef DICTSTACK_CACHE
180 return where->second;
193 #ifdef DICTSTACK_CACHE
202 TokenMap::const_iterator
where =
base_->find(n);
204 if ( where !=
base_->end() )
206 #ifdef DICTSTACK_CACHE
210 return where->second;
220 #ifdef DICTSTACK_CACHE
229 std::list<DictionaryDatum>::const_iterator i(
d.begin());
233 TokenMap::const_iterator
where =(*i)->find(n);
234 if(where!=(*i)->end())
236 #ifdef DICTSTACK_CACHE
250 #ifdef DICTSTACK_CACHE
259 TokenMap::const_iterator
where =
base_->find(n);
260 if(where!=
base_->end())
262 #ifdef DICTSTACK_CACHE
329 size_t size(
void)
const;
336 void info(std::ostream&)
const;
337 void top_info(std::ostream &)
const;
349 #ifdef DICTSTACK_CACHE
352 #ifndef DICTSTACK_CACHE
368 #ifdef DICTSTACK_CACHE
371 #ifndef DICTSTACK_CACHE
372 (*
d.begin())->insert_move(n,t);
void clear_dict_from_cache(DictionaryDatum d)
Definition: dictstack.h:125
void pop(void)
Definition: dictstack.cc:88
void push(const DictionaryDatum &)
Definition: dictstack.cc:151
const Token & lookup2(const Name &n)
Definition: dictstack.h:158
bool known(const Name &n)
Test for a name searching all dictionaries on the stack.
Definition: dictstack.h:218
void cache_token(const Name &n, const Token *result)
Add a token to the cache.
Definition: dictstack.h:91
static size_t num_handles()
Definition: name.cc:34
const DictionaryStack & operator=(const DictionaryStack &)
Definition: dictstack.cc:203
const Token & baselookup(const Name &n)
Lookup a name searching only the bottom level dictionary.
Definition: dictstack.h:191
std::list< DictionaryDatum > d
Definition: dictstack.h:74
void def_move(const Name &, Token &)
Bind a Token to a Name in the top level dictionary.
Definition: dictstack.h:358
Represent strings by ints to facilitate fast comparison.
Definition: name.h:53
DictionaryStack(const Token &=Token())
Definition: dictstack.cc:25
void basedef_move(const Name &n, Token &t)
Bind a Token to a Name in the bottom level dictionary.
Definition: dictstack.cc:76
void top_info(std::ostream &) const
Definition: dictstack.cc:198
Definition: tokenarray.h:62
bool baseknown(const Name &n)
Test for a name in the bottom level dictionary.
Definition: dictstack.h:248
const std::string & toString(void) const
Return string represented by Name.
Definition: name.cc:63
const Token VoidToken
Definition: dictstack.h:73
DictionaryDatum base_
Definition: dictstack.h:75
void info(std::ostream &) const
Definition: dictstack.cc:183
void set_basedict()
This function must be called once to initialize the systemdict cache.
Definition: dictstack.cc:168
void basecache_token(const Name &n, const Token *result)
Definition: dictstack.h:99
std::vector< const Token * > cache_
Definition: dictstack.h:77
bool where(const Name &, Token &)
Definition: dictstack.h:70
void top(Token &) const
Definition: dictstack.cc:111
std::vector< const Token * > basecache_
Definition: dictstack.h:78
const Token & lookup(const Name &n)
Definition: dictstack.h:146
handle_t toIndex(void) const
Return table index for Name object.
Definition: name.h:75
size_t size(void) const
Definition: dictstack.cc:173
void clear_cache()
Clear the entire cache.
Definition: dictstack.h:136
const Name n("n")
Number of synaptic release sites (int >=0) (Tsodyks2_connection)
Definition: nest_names.h:202
void clear_token_from_basecache(const Name &n)
Definition: dictstack.h:118
void clear(void)
Definition: dictstack.cc:102
~DictionaryStack()
Definition: dictstack.cc:35
void toArray(TokenArray &) const
Definition: dictstack.cc:125
A type-independent container for C++-types.
Definition: token.h:68
void def(const Name &, const Token &)
Bind a Token to a Name in the top level dictionary.
Definition: dictstack.h:342
Exception to be thrown if an entry referenced inside a dictionary does not exist. ...
Definition: sliexceptions.h:263
void basedef(const Name &n, const Token &t)
Bind a Token to a Name in the bottom level dictionary.
Definition: dictstack.cc:60
void clear_token_from_cache(const Name &n)
Clear a name from the cache.
Definition: dictstack.h:111
unsigned int handle_t
Definition: name.h:57
void undef(const Name &)
Unbind a previously defined Name from its token.
Definition: dictstack.cc:43