libqi-api  2.1.4.13
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
qi::SharedPtr< T > Class Template Reference

Lightweight implementation of shared pointers. More...

#include <shared_ptr.hpp>

Public Member Functions

 SharedPtr (T *ptr)
 Initialization of the SharedPtr with the pointer it will manage. More...
 
 ~SharedPtr ()
 Destruct the shared pointer and the pointer if current SharedPtr is the last one to hold the pointer. More...
 
 SharedPtr (const SharedPtr< T > &sp)
 Copy shared pointer. More...
 
SharedPtroperator= (SharedPtr< T > &sp)
 Link current SharedPtr to a new pointer. If old pointer was only held by the current SharedPtr, it is freed. More...
 
T & operator* () const
 Value accessor. More...
 
T * operator-> () const
 Pointer accessor. More...
 

Detailed Description

template<typename T>
class qi::SharedPtr< T >

Lightweight implementation of shared pointers.

Definition at line 19 of file shared_ptr.hpp.

Constructor & Destructor Documentation

template<typename T>
qi::SharedPtr< T >::SharedPtr ( T *  ptr)
inline

Initialization of the SharedPtr with the pointer it will manage.

Parameters
ptrpointer to the managed data.

Definition at line 23 of file shared_ptr.hpp.

template<typename T>
qi::SharedPtr< T >::~SharedPtr ( )
inline

Destruct the shared pointer and the pointer if current SharedPtr is the last one to hold the pointer.

Definition at line 31 of file shared_ptr.hpp.

template<typename T>
qi::SharedPtr< T >::SharedPtr ( const SharedPtr< T > &  sp)
inline

Copy shared pointer.

Parameters
spshared pointer also holding the pointer.

Definition at line 41 of file shared_ptr.hpp.

Member Function Documentation

template<typename T>
T& qi::SharedPtr< T >::operator* ( ) const
inline

Value accessor.

Definition at line 89 of file shared_ptr.hpp.

template<typename T>
T* qi::SharedPtr< T >::operator-> ( ) const
inline

Pointer accessor.

Definition at line 95 of file shared_ptr.hpp.

template<typename T>
qi::SharedPtr< T >::operator= ( SharedPtr< T > &  sp)
inline

Link current SharedPtr to a new pointer. If old pointer was only held by the current SharedPtr, it is freed.

Parameters
spshared pointer also holding the pointer.

Definition at line 66 of file shared_ptr.hpp.


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