Lines Matching defs:key

48         Key key;
54 return (test & mask) == key;
63 key(_key & _mask), mask(_mask), value(_val),
96 parent, this, key, mask, value);
117 * A utility method which checks whether the key being looked up lies
122 * @param key The key we're looking for.
123 * @param new_mask The mask to use when matching against the key.
127 goesAfter(Node **parent, Node *kid, Key key, Key new_mask)
129 if (kid && kid->matches(key) && (kid->mask & new_mask) == kid->mask) {
154 * Method which looks up the Handle corresponding to a particular key. This
155 * is useful if you want to delete the Handle corresponding to a key since
157 * @param key The key to look up.
158 * @return The first Handle matching this key, or NULL if none was found.
161 lookupHandle(Key key)
168 if (node->kids[0] && node->kids[0]->matches(key))
170 else if (node->kids[1] && node->kids[1]->matches(key))
181 * Method which inserts a key/value pair into the trie.
182 * @param key The key which can later be used to look up this value.
183 * @param width How many bits of the key (from msb) should be used.
188 insert(Key key, unsigned width, Value *val)
198 // Use it to tidy up the key.
199 key &= new_mask;
204 while (goesAfter(&node, node->kids[0], key, new_mask) ||
205 goesAfter(&node, node->kids[1], key, new_mask))
222 new_node = new Node(key, new_mask, val);
235 done = ((key & cur_mask) != (kid->key & cur_mask)) ||
245 new_node = new Node(key, cur_mask, NULL);
258 new_node = new Node(key, new_mask, val);
269 * Method which looks up the Value corresponding to a particular key.
270 * @param key The key to look up.
271 * @return The first Value matching this key, or NULL if none was found.
274 lookup(Key key)
276 Node *node = lookupHandle(key);
329 * @param key The key to look up and then remove.
333 remove(Key key)
335 Handle handle = lookupHandle(key);
342 * A method which removes all key/value pairs from the trie. This is more
360 ccprintf(os, "*** (parent, me, key, mask, value pointer)\n");