ObjectDictionary< T > Class Template Reference

#include <object_dictionary.h>

Inheritance diagram for ObjectDictionary< T >:
zmm::Object

Public Member Functions

 ObjectDictionary ()
 Constructor, initializes the dictionary.
void put (zmm::String key, zmm::Ref< T > value)
 Adds a new key:value pair to the dictionary.
zmm::Ref< T > get (zmm::String key)
 Returns the value for a given key.
int size ()
 Returns the number of elements in the dictinary.
void remove (zmm::String key)
 Deletes a key value pair.
void clear ()
 Removes all elements from the dictionary.
zmm::Ref< ObjectDictionaryclone ()
 Makes a shallow copy of the dictionary.
zmm::Ref< zmm::Array
< ObjectDictionaryElement< T > > > 
getElements ()
void optimize ()
 Frees unnecessary memory.
void retain ()
void release ()
int getRefCount ()

Static Public Member Functions

static void * operator new (size_t size)
static void operator delete (void *ptr)

Protected Attributes

zmm::Ref< zmm::Array
< ObjectDictionaryElement< T > > > 
elements
 Array of DictionaryElements, representing our Dictionary.
mt_atomic_t _ref_count
pthread_mutex_t mutex

Detailed Description

template<class T>
class ObjectDictionary< T >

Definition at line 70 of file object_dictionary.h.


Constructor & Destructor Documentation

template<class T>
ObjectDictionary< T >::ObjectDictionary (  )  [inline]

Constructor, initializes the dictionary.

Definition at line 74 of file object_dictionary.h.

Referenced by ObjectDictionary< zmm::Object >::clone().


Member Function Documentation

template<class T>
void ObjectDictionary< T >::clear (  )  [inline]

Removes all elements from the dictionary.

Definition at line 127 of file object_dictionary.h.

template<class T>
zmm::Ref<ObjectDictionary> ObjectDictionary< T >::clone (  )  [inline]

Makes a shallow copy of the dictionary.

Definition at line 133 of file object_dictionary.h.

template<class T>
zmm::Ref<T> ObjectDictionary< T >::get ( zmm::String  key  )  [inline]

Returns the value for a given key.

Definition at line 96 of file object_dictionary.h.

template<class T>
zmm::Ref<zmm::Array<ObjectDictionaryElement<T> > > ObjectDictionary< T >::getElements (  )  [inline]

Definition at line 145 of file object_dictionary.h.

int Object::getRefCount (  )  [inherited]

Definition at line 78 of file object.cc.

References zmm::Object::_ref_count, and atomic_get().

void Object::operator delete ( void *  ptr  )  [static, inherited]

Definition at line 87 of file object.cc.

References FREE.

void * Object::operator new ( size_t  size  )  [static, inherited]

Definition at line 83 of file object.cc.

References MALLOC.

template<class T>
void ObjectDictionary< T >::optimize (  )  [inline]

Frees unnecessary memory.

Definition at line 151 of file object_dictionary.h.

template<class T>
void ObjectDictionary< T >::put ( zmm::String  key,
zmm::Ref< T >  value 
) [inline]

Adds a new key:value pair to the dictionary.

Definition at line 80 of file object_dictionary.h.

void Object::release (  )  [inherited]
template<class T>
void ObjectDictionary< T >::remove ( zmm::String  key  )  [inline]

Deletes a key value pair.

Definition at line 113 of file object_dictionary.h.

void Object::retain (  )  [inherited]
template<class T>
int ObjectDictionary< T >::size (  )  [inline]

Returns the number of elements in the dictinary.

Definition at line 110 of file object_dictionary.h.


Field Documentation

mt_atomic_t zmm::Object::_ref_count [protected, inherited]
template<class T>
zmm::Ref<zmm::Array<ObjectDictionaryElement<T> > > ObjectDictionary< T >::elements [protected]
pthread_mutex_t zmm::Object::mutex [protected, inherited]

The documentation for this class was generated from the following file:

Generated on Fri Mar 26 20:16:57 2010 for MediaTomb by  doxygen 1.6.1