ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

Common::ScopedPtr< T, D > Class Template Reference

#include <ptr.h>

Inheritance diagram for Common::ScopedPtr< T, D >:
Collaboration diagram for Common::ScopedPtr< T, D >:

List of all members.

Public Types

typedef T ValueType
typedef T * PointerType
typedef T & ReferenceType

Public Member Functions

 ScopedPtr (PointerType o=nullptr)
ReferenceType operator* () const
PointerType operator-> () const
bool operator_bool () const
 Implicit conversion operator to bool for convenience, to make checks like "if (scopedPtr) ..." possible.
 ~ScopedPtr ()
void reset (PointerType o=nullptr)
 Resets the pointer with the new value.
PointerType get () const
 Returns the plain pointer value.
PointerType release ()
 Returns the plain pointer value and releases ScopedPtr.

Private Attributes

PointerType _pointer

Detailed Description

template<typename T, class D = DefaultDeleter<T>>
class Common::ScopedPtr< T, D >

Definition at line 230 of file ptr.h.


Member Typedef Documentation

template<typename T, class D = DefaultDeleter<T>>
typedef T* Common::ScopedPtr< T, D >::PointerType

Definition at line 233 of file ptr.h.

template<typename T, class D = DefaultDeleter<T>>
typedef T& Common::ScopedPtr< T, D >::ReferenceType

Definition at line 234 of file ptr.h.

template<typename T, class D = DefaultDeleter<T>>
typedef T Common::ScopedPtr< T, D >::ValueType

Definition at line 232 of file ptr.h.


Constructor & Destructor Documentation

template<typename T, class D = DefaultDeleter<T>>
Common::ScopedPtr< T, D >::ScopedPtr ( PointerType  o = nullptr  )  [inline, explicit]

Definition at line 236 of file ptr.h.

template<typename T, class D = DefaultDeleter<T>>
Common::ScopedPtr< T, D >::~ScopedPtr (  )  [inline]

Definition at line 247 of file ptr.h.


Member Function Documentation

template<typename T, class D = DefaultDeleter<T>>
PointerType Common::ScopedPtr< T, D >::get (  )  const [inline]

Returns the plain pointer value.

Returns:
the pointer the ScopedPtr manages

Definition at line 264 of file ptr.h.

template<typename T, class D = DefaultDeleter<T>>
ReferenceType Common::ScopedPtr< T, D >::operator* (  )  const [inline]

Definition at line 238 of file ptr.h.

template<typename T, class D = DefaultDeleter<T>>
PointerType Common::ScopedPtr< T, D >::operator-> (  )  const [inline]

Definition at line 239 of file ptr.h.

template<typename T, class D = DefaultDeleter<T>>
bool Common::ScopedPtr< T, D >::operator_bool (  )  const [inline]

Implicit conversion operator to bool for convenience, to make checks like "if (scopedPtr) ..." possible.

Definition at line 245 of file ptr.h.

template<typename T, class D = DefaultDeleter<T>>
PointerType Common::ScopedPtr< T, D >::release (  )  [inline]

Returns the plain pointer value and releases ScopedPtr.

After release() call you need to delete object yourself

Returns:
the pointer the ScopedPtr manages

Definition at line 272 of file ptr.h.

template<typename T, class D = DefaultDeleter<T>>
void Common::ScopedPtr< T, D >::reset ( PointerType  o = nullptr  )  [inline]

Resets the pointer with the new value.

Old object will be destroyed

Definition at line 254 of file ptr.h.


Member Data Documentation

template<typename T, class D = DefaultDeleter<T>>
PointerType Common::ScopedPtr< T, D >::_pointer [private]

Definition at line 279 of file ptr.h.


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


Generated on Sat May 25 2019 05:05:18 for ResidualVM by doxygen 1.7.1
curved edge   curved edge