Reentrant version of the dictionary. More...
#include <dictionary.h>
Public Member Functions | |
| Dictionary_r () | |
| void | put (zmm::String key, zmm::String value) |
| Adds a new key:value pair to the dictionary. | |
| zmm::String | get (zmm::String key) |
| Returns the value for a given key. | |
| void | remove (zmm::String key) |
| Deletes a key value pair. | |
| zmm::String | encode () |
| Returns an url encoded version of the whole dictionary. | |
| void | clear () |
| Removes all elements from the dictionary. | |
| void | decode (zmm::String url) |
| Makes a dictionary out of url encoded data. | |
| zmm::Ref< Dictionary_r > | clone () |
| Makes a shallow copy of the dictionary. | |
| bool | isSubsetOf (zmm::Ref< Dictionary > other) |
| bool | equals (zmm::Ref< Dictionary > other) |
| zmm::Ref< zmm::Array < DictionaryElement > > | getElements () |
| void | optimize () |
| Frees unnecessary memory. | |
| int | size () |
| Returns the number of elements in the dictinary. | |
| zmm::String | encodeSimple () |
| It seems that a lot of devices can not cope with a param=value encoded URL, so we will use a simplified encoding scheme. | |
| void | decodeSimple (zmm::String url) |
| Makes a dictionary out of simplified url encoded data. | |
| void | merge (zmm::Ref< Dictionary > other) |
| Merge dictionary with another dictionary. If keys with the same name already exist, the existing ones will be overwritten. | |
| bool | isSubsetOf (zmm::Ref< Dictionary > other) |
| returns true if the dictionary is a subset of another dictionary.# | |
| bool | equals (zmm::Ref< Dictionary > other) |
| checks two dictionaries for equality | |
| void | retain () |
| void | release () |
| int | getRefCount () |
Static Public Member Functions | |
| static void * | operator new (size_t size) |
| static void | operator delete (void *ptr) |
Protected Member Functions | |
| zmm::String | _encode (char sep1, char sep2) |
| Allow to specify encoding separators. | |
Protected Attributes | |
| zmm::Ref< Mutex > | mutex |
| zmm::Ref< zmm::Array < DictionaryElement > > | elements |
| Array of DictionaryElements, representing our Dictionary. | |
| mt_atomic_t | _ref_count |
Reentrant version of the dictionary.
Definition at line 126 of file dictionary.h.
| Dictionary_r::Dictionary_r | ( | ) | [inline] |
Definition at line 129 of file dictionary.h.
References mutex.
| String Dictionary::_encode | ( | char | sep1, | |
| char | sep2 | |||
| ) | [protected, inherited] |
Allow to specify encoding separators.
Definition at line 122 of file dictionary.cc.
References Dictionary::elements, and url_escape().
Referenced by Dictionary::encode(), and Dictionary::encodeSimple().
| void Dictionary_r::clear | ( | ) | [inline] |
Removes all elements from the dictionary.
Reimplemented from Dictionary.
Definition at line 164 of file dictionary.h.
References mutex.
| zmm::Ref<Dictionary_r> Dictionary_r::clone | ( | ) | [inline] |
Makes a shallow copy of the dictionary.
Reimplemented from Dictionary.
Definition at line 178 of file dictionary.h.
References Dictionary::clone(), mutex, and RefCast.
| void Dictionary_r::decode | ( | zmm::String | url | ) | [inline] |
Makes a dictionary out of url encoded data.
Reimplemented from Dictionary.
Definition at line 171 of file dictionary.h.
References mutex.
| void Dictionary::decodeSimple | ( | zmm::String | url | ) | [inherited] |
Makes a dictionary out of simplified url encoded data.
Definition at line 174 of file dictionary.cc.
References zmm::String::index(), zmm::String::length(), Dictionary::put(), zmm::String::substring(), and url_unescape().
| zmm::String Dictionary_r::encode | ( | ) | [inline] |
Returns an url encoded version of the whole dictionary.
Reimplemented from Dictionary.
Definition at line 156 of file dictionary.h.
References mutex.
| String Dictionary::encodeSimple | ( | ) | [inherited] |
It seems that a lot of devices can not cope with a param=value encoded URL, so we will use a simplified encoding scheme.
Definition at line 142 of file dictionary.cc.
References Dictionary::_encode().
| bool Dictionary::equals | ( | zmm::Ref< Dictionary > | other | ) | [inherited] |
checks two dictionaries for equality
Definition at line 242 of file dictionary.cc.
References Dictionary::isSubsetOf().
| bool Dictionary_r::equals | ( | zmm::Ref< Dictionary > | other | ) | [inline] |
Definition at line 194 of file dictionary.h.
References mutex.
| zmm::String Dictionary_r::get | ( | zmm::String | key | ) | [inline] |
Returns the value for a given key.
Reimplemented from Dictionary.
Definition at line 141 of file dictionary.h.
References mutex.
| zmm::Ref<zmm::Array<DictionaryElement> > Dictionary_r::getElements | ( | ) | [inline] |
| int Object::getRefCount | ( | ) | [inherited] |
Definition at line 78 of file object.cc.
References zmm::Object::_ref_count, and atomic_get().
| bool Dictionary::isSubsetOf | ( | zmm::Ref< Dictionary > | other | ) | [inherited] |
returns true if the dictionary is a subset of another dictionary.#
Definition at line 231 of file dictionary.cc.
References Dictionary::elements.
Referenced by Dictionary::equals().
| bool Dictionary_r::isSubsetOf | ( | zmm::Ref< Dictionary > | other | ) | [inline] |
Definition at line 186 of file dictionary.h.
References mutex.
| void Dictionary::merge | ( | zmm::Ref< Dictionary > | other | ) | [inherited] |
Merge dictionary with another dictionary. If keys with the same name already exist, the existing ones will be overwritten.
Definition at line 217 of file dictionary.cc.
References nil, and Dictionary::put().
| void Object::operator delete | ( | void * | ptr | ) | [static, inherited] |
| void * Object::operator new | ( | size_t | size | ) | [static, inherited] |
| void Dictionary_r::optimize | ( | ) | [inline] |
Frees unnecessary memory.
Reimplemented from Dictionary.
Definition at line 210 of file dictionary.h.
References mutex.
| void Dictionary_r::put | ( | zmm::String | key, | |
| zmm::String | value | |||
| ) | [inline] |
Adds a new key:value pair to the dictionary.
Reimplemented from Dictionary.
Definition at line 134 of file dictionary.h.
References mutex.
| void Object::release | ( | ) | [inherited] |
Definition at line 66 of file object.cc.
References zmm::Object::_ref_count, atomic_dec(), and zmm::Object::mutex.
Referenced by zmm::ArrayBase::clear(), zmm::String::operator=(), DSOHash< zmm::Array< CacheObject > >::releaseData(), DSBHash< VT >::releaseData(), DSOHash< zmm::Array< CacheObject > >::remove(), zmm::ArrayBase::remove(), zmm::ArrayBase::removeUnordered(), zmm::ArrayBase::set(), zmm::ArrayBase::~ArrayBase(), DSOHash< zmm::Array< CacheObject > >::~DSOHash(), zmm::ObjectQueue< AutoscanDirectory >::~ObjectQueue(), zmm::ObjectStack< Element >::~ObjectStack(), and zmm::String::~String().
| void Dictionary_r::remove | ( | zmm::String | key | ) | [inline] |
Deletes a key value pair.
Reimplemented from Dictionary.
Definition at line 149 of file dictionary.h.
References mutex.
| void Object::retain | ( | ) | [inherited] |
Definition at line 58 of file object.cc.
References zmm::Object::_ref_count, atomic_inc(), and zmm::Object::mutex.
Referenced by zmm::ArrayBase::append(), zmm::ObjectQueue< AutoscanDirectory >::enqueue(), zmm::ArrayBase::insert(), zmm::String::operator=(), zmm::ObjectStack< Element >::push(), DSOHash< zmm::Array< CacheObject > >::put(), DSBHash< VT >::put(), zmm::ArrayBase::set(), and zmm::String::String().
| int Dictionary::size | ( | ) | [inherited] |
Returns the number of elements in the dictinary.
Definition at line 104 of file dictionary.cc.
References Dictionary::elements.
mt_atomic_t zmm::Object::_ref_count [protected, inherited] |
Definition at line 54 of file object.h.
Referenced by zmm::Object::getRefCount(), zmm::Object::Object(), zmm::Object::release(), and zmm::Object::retain().
zmm::Ref<zmm::Array<DictionaryElement> > Dictionary::elements [protected, inherited] |
Array of DictionaryElements, representing our Dictionary.
Definition at line 69 of file dictionary.h.
Referenced by Dictionary::_encode(), Dictionary::clear(), Dictionary::clone(), Dictionary::Dictionary(), Dictionary::get(), Dictionary::getElements(), Dictionary::isSubsetOf(), Dictionary::optimize(), Dictionary::put(), Dictionary::remove(), and Dictionary::size().
zmm::Ref<Mutex> Dictionary_r::mutex [protected] |
Reimplemented from zmm::Object.
Definition at line 218 of file dictionary.h.
Referenced by clear(), Session::clearUpdateIDs(), clone(), Session::containerChangedUI(), decode(), Dictionary_r(), encode(), equals(), get(), getElements(), Session::getUIUpdateIDs(), isSubsetOf(), optimize(), put(), and remove().
1.6.1