Public Member Functions

# SEPtrIntDict Class Reference

SEPtrIntDict is a dictionary class of pointers associated to integers. More...

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

List of all members.

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

## Detailed Description

SEPtrIntDict is a dictionary class of pointers associated to integers.

Definition at line 12 of file skype-ptrint-dict.h.

## Constructor & Destructor Documentation

SEPtrIntDict::SEPtrIntDict | ( |  | ) |

Creates an empty dictionary of pointers.

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

SEPtrIntDict::SEPtrIntDict | ( | const SEPtrIntDict & | dict | ) |

Constructs an implicitly shared copy of dict.

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

SEPtrIntDict::~SEPtrIntDict | ( |  | ) |

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

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

## Member Function Documentation

const void *& SEPtrIntDict::find | ( | const int | key,
|  | 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 91 of file skype-ptrint-dict.cpp.

References SIZE.

void SEPtrIntDict::insert | ( | const int | 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-ptrint-dict.cpp.

References SIZE.

int SEPtrIntDict::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 277 of file skype-ptrint-dict.cpp.

References size().

SEIntList SEPtrIntDict::keys | ( |  | ) |

Definition at line 321 of file skype-ptrint-dict.cpp.

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

SEPtrIntDict & SEPtrIntDict::operator= | ( | const SEPtrIntDict & | 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 116 of file skype-ptrint-dict.cpp.

const void *& SEPtrIntDict::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 264 of file skype-ptrint-dict.cpp.

References size().

bool SEPtrIntDict::remove | ( | const int | key | ) |

Definition at line 288 of file skype-ptrint-dict.cpp.

size_t SEPtrIntDict::size | ( |  | ) | const

Returns how many elements are in the dictionary.

Definition at line 222 of file skype-ptrint-dict.cpp.

const void*& SEPtrIntDict::value | ( | const int | key | ) | `[inline]`

Definition at line 64 of file skype-ptrint-dict.h.

References find().

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

- skype-ptrint-dict.h
- skype-ptrint-dict.cpp

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

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

Last updated: Fri Mar 16 2012