Public Member Functions

SEDict< KeyType, ValueType > Class Template Reference

SEDict is a dictionary class of KeyType associated to ValueType. More...

#include <skype-dict.h>

List of all members.

Public Member Functions

 SEDict (int size)
 SEDict (const SEDict &dict)
 ~SEDict ()
void insert (const KeyType &key, const ValueType &value)
ValueType find (const KeyType &key, unsigned int offset=0) const
SEDict< KeyType, ValueType > & operator= (const SEDict< KeyType, ValueType > &dict)
size_t size () const
ValueType operator[] (size_t i) const
KeyType keyAt (size_t i) const
ValueType value (const KeyType &key)
bool remove (const KeyType &key)
SEList< KeyType > keys ()

Detailed Description

template<class KeyType, class ValueType>
class SEDict< KeyType, ValueType >

SEDict is a dictionary class of KeyType associated to ValueType.

Definition at line 31 of file skype-dict.h.


Constructor & Destructor Documentation

template<class KeyType, class ValueType>
SEDict< KeyType, ValueType >::SEDict ( int  size  )  [inline]

Creates an empty dictionary of KeyType/ValueType.

Definition at line 34 of file skype-dict.h.

template<class KeyType, class ValueType>
SEDict< KeyType, ValueType >::SEDict ( const SEDict< KeyType, ValueType > &  dict  )  [inline]

Constructs an implicitly shared copy of dict.

Definition at line 38 of file skype-dict.h.

template<class KeyType, class ValueType>
SEDict< KeyType, ValueType >::~SEDict (  )  [inline]

Destroys the dictionary and frees the data if this is the last reference to it.

Definition at line 43 of file skype-dict.h.


Member Function Documentation

template<class KeyType, class ValueType>
ValueType SEDict< KeyType, ValueType >::find ( const KeyType &  key,
unsigned int  offset = 0 
) const [inline]

Finds the specified key in the dictionary.

Parameters:
key Key to search. Default is to search for 0, which is the most often used key name in the Embedded API.
offset When the dictionary contains several entries with the same key, use the offset param to indicate which key you want.
Returns:
null string if the key is not found.

Definition at line 125 of file skype-dict.h.

template<class KeyType, class ValueType>
void SEDict< KeyType, ValueType >::insert ( const KeyType &  key,
const ValueType &  value 
) [inline]

Inserts the key with the value into the dictionary. Multiple items can have the same key, they are not overwritten. You can access them with the offset parameter of the find() function. If key is null, nothing is inserted.

Definition at line 89 of file skype-dict.h.

template<class KeyType, class ValueType>
KeyType SEDict< KeyType, ValueType >::keyAt ( size_t  i  )  const [inline]

Use this function to iterate through the dictionary. It doesn't make sense to use this functions outside of an iteration (i.e. a loop). See also operator[]()

Definition at line 218 of file skype-dict.h.

References SEDict< KeyType, ValueType >::size().

template<class KeyType, class ValueType>
SEList<KeyType> SEDict< KeyType, ValueType >::keys (  )  [inline]

Definition at line 265 of file skype-dict.h.

References SEDict< KeyType, ValueType >::size().

template<class KeyType, class ValueType>
SEDict<KeyType, ValueType>& SEDict< KeyType, ValueType >::operator= ( const SEDict< KeyType, ValueType > &  dict  )  [inline]

Assigns a shallow copy of dict to this dictionary and returns a reference to it. This is very fast because the dictionary isn't actually copied.

Definition at line 149 of file skype-dict.h.

template<class KeyType, class ValueType>
ValueType SEDict< KeyType, ValueType >::operator[] ( size_t  i  )  const [inline]

Use this function to iterate through the dictionary. It doesn't make sense to use this functions outside of an iteration (i.e. a loop). See also keyAt()

Definition at line 204 of file skype-dict.h.

References SEDict< KeyType, ValueType >::size().

template<class KeyType, class ValueType>
bool SEDict< KeyType, ValueType >::remove ( const KeyType &  key  )  [inline]

Definition at line 233 of file skype-dict.h.

template<class KeyType, class ValueType>
size_t SEDict< KeyType, ValueType >::size (  )  const [inline]

Returns how many elements are in the dictionary.

Definition at line 159 of file skype-dict.h.

template<class KeyType, class ValueType>
ValueType SEDict< KeyType, ValueType >::value ( const KeyType &  key  )  [inline]

Definition at line 229 of file skype-dict.h.

References SEDict< KeyType, ValueType >::find().


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

(c) Skype Technologies S.A. Confidential/Proprietary

Last updated: Fri Jan 27 2012