Public Member Functions

# SEPtrDict Class Reference

SEPtrDict is a dictionary class of pointers associated to strings. More...

`#include <skype-ptr-dict.h>`

List of all members.

## Public Member Functions
| SEPtrDict ()
| SEPtrDict (const SEPtrDict &dict)
| ~SEPtrDict ()
void | insert (const SEString &key, const void *new_value)
const void *& | find (const SEString &key="0", unsigned int offset=0) const
SEPtrDict & | operator= (const SEPtrDict &dict)
size_t | size () const
const void *& | operator[] (size_t i) const
SEString | keyAt (size_t i) const
const void *& | value (const SEString &key)
SEStringList | keys ()

## Detailed Description

SEPtrDict is a dictionary class of pointers associated to strings.

Definition at line 13 of file skype-ptr-dict.h.

## Constructor & Destructor Documentation

SEPtrDict::SEPtrDict | ( |  | ) |

Creates an empty dictionary of pointers.

Definition at line 49 of file skype-ptr-dict.cpp.

SEPtrDict::SEPtrDict | ( | const SEPtrDict & | dict | ) |

Constructs an implicitly shared copy of dict.

Definition at line 55 of file skype-ptr-dict.cpp.

SEPtrDict::~SEPtrDict | ( |  | ) |

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

Definition at line 61 of file skype-ptr-dict.cpp.

## Member Function Documentation

const void *& SEPtrDict::find | ( | const SEString & | key = `"0"`,
|  | unsigned int | offset = `0` |
| ) |  |  | const

Finds the specified key in the dictionary.

Parameters:

  | key | Key to search.
  | offset | When the dictionary contains several entries with the same key, use the offset param to indicate which key you want.

Returns:
  null if the key is not found.

Definition at line 94 of file skype-ptr-dict.cpp.

References SEString::hash(), and SIZE.

void SEPtrDict::insert | ( | const SEString & | key,
|  | const void * | new_value |
| ) |  |  |

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 66 of file skype-ptr-dict.cpp.

References SEString::hash(), SEString::isNull(), and SIZE.

SEString SEPtrDict::keyAt | ( | size_t | i | ) | const

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 271 of file skype-ptr-dict.cpp.

References size().

SEStringList SEPtrDict::keys | ( |  | ) |

Definition at line 282 of file skype-ptr-dict.cpp.

References SEStringList::append(), and size().

SEPtrDict & SEPtrDict::operator= | ( | const SEPtrDict & | dict | ) |

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 119 of file skype-ptr-dict.cpp.

const void *& SEPtrDict::operator[] | ( | size_t | i | ) | const

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 258 of file skype-ptr-dict.cpp.

References size().

size_t SEPtrDict::size | ( |  | ) | const

Returns how many elements are in the dictionary.

Definition at line 216 of file skype-ptr-dict.cpp.

const void*& SEPtrDict::value | ( | const SEString & | key | ) | `[inline]`

Definition at line 63 of file skype-ptr-dict.h.

References find().

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

- skype-ptr-dict.h
- skype-ptr-dict.cpp

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

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

Last updated: Fri Jan 27 2012