Gnash  0.8.11dev
Public Member Functions | List of all members
gnash::ScopedPtr< T > Class Template Reference

#include <GnashScopedPtr.h>

Inheritance diagram for gnash::ScopedPtr< T >:

Public Member Functions

 ScopedPtr (T *ptr, DeleterT d)
 
T & operator* () const
 Dereferences the managed pointer and returns a reference. More...
 
T * operator-> () const
 Dereference the contained pointer. More...
 
T * get () const
 Obtain the contained pointer. More...
 
 ~ScopedPtr ()
 

Detailed Description

template<typename T>
class gnash::ScopedPtr< T >

ScopedPtr is very similar to scoped_ptr, but includes the Deleter functionality from shared_ptr. ScopedPtr can be used to implement the RAII pattern for C APIs, which frequently have their own deallocation strategy, when shared_ptr semantics are not desirable. ScopedPtr is similar to C++11's unique_ptr, but the deleter is not part of the type.

Constructor & Destructor Documentation

template<typename T>
gnash::ScopedPtr< T >::ScopedPtr ( T *  ptr,
DeleterT  d 
)
inlineexplicit

Construct a ScopedPtr and provide a deleter.

the pointer to exclusively manage. the deleter to call when this object goes out of scope. The expression d(ptr) must be well-formed.

template<typename T>
gnash::ScopedPtr< T >::~ScopedPtr ( )
inline

Member Function Documentation

template<typename T>
T* gnash::ScopedPtr< T >::get ( ) const
inline

Obtain the contained pointer.

Referenced by gnash::Socket::connect().

template<typename T>
T& gnash::ScopedPtr< T >::operator* ( ) const
inline

Dereferences the managed pointer and returns a reference.

template<typename T>
T* gnash::ScopedPtr< T >::operator-> ( ) const
inline

Dereference the contained pointer.


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