- Main Page
- Related Pages
- Classes
- Files
- Examples

- File List
- File Members

# skype-ptr-vector.h

Go to the documentation of this file.

    00001
    00002 #ifndef __SKYPE_PTR_VECTOR_H
    00003 #define __SKYPE_PTR_VECTOR_H
    00004
    00005 #include <stdlib.h>
    00006 #include "skype-int-list.h"
    00007
    00008 /*! \class SEPtrVector skype-ptr-vector.h "skype-ptr-vector.h"
    00009  *  \brief Vector is an array that is reference counted.
    00010  *
    00011  * Its size is set at creation, it doesn't grow automatically.
    00012  *
    00013  * SEPtrVector makes no use of the C++ templates, therefore you have to
    00014  * explicitly cast its elements to appropriate pointer type (SEPtrVector uses void*).
    00015  */
    00016 class SEPtrVector
    00017 {
    00018 public:
    00019         /** Creates an empty vector object. */
    00020         SEPtrVector();
    00021         /** Creates a vector object of specified size. */
    00022         SEPtrVector(size_t s);
    00023         SEPtrVector(const SEPtrVector& pv);
    00024         ~SEPtrVector();
    00025
    00026         /** \cond INTERNAL */
    00027 protected:
    00028         class Data;
    00029         Data* d;
    00030         /** \endcond */
    00031
    00032 public:
    00033         /** Resizes and resets the vector */
    00034         void setnewsize(size_t s);
    00035         /** Returns how many elements are in the vector. */
    00036         size_t size() const;
    00037         /** Returns the item at position i, or NULL if there is no item at that position. */
    00038         void*& operator[](size_t n) const;
    00039         /** Assigns a shallow copy of pv to this vector and returns a reference to it.
    00040          * This is very fast because the vector isn't actually copied. */
    00041         SEPtrVector& operator=(const SEPtrVector& pv);
    00042
    00043         /** \cond INTERNAL */
    00044 protected:
    00045         void d_ref();
    00046         void d_unref();
    00047         /** \endcond */
    00048 };
    00049
    00050 #endif // __SKYPE_PTR_VECTOR_H

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

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

Last updated: Fri Mar 16 2012