ScummVM API documentation
Common::DisposablePtr< T, DL > Class Template Reference
Inheritance diagram for Common::DisposablePtr< T, DL >:
Common::NonCopyable Common::SafeBool< DisposablePtr< T, DL > > Common::impl::no_base< DisposablePtr< T, DL > >

Public Types

typedef T ValueType
 
typedef T * PointerType
 
typedef T & ReferenceType
 

Public Member Functions

 DisposablePtr (PointerType o, DisposeAfterUse::Flag dispose)
 
 DisposablePtr (SharedPtr< T > o)
 
 DisposablePtr (DisposablePtr< T, DL > &&o)
 
ReferenceType operator* () const
 
PointerType operator-> () const
 
bool operator_bool () const
 
void reset (PointerType o, DisposeAfterUse::Flag dispose)
 
void reset ()
 
template<class T2 >
bool isDynamicallyCastable ()
 
template<class T2 , class DL2 = DefaultDeleter<T2>>
DisposablePtr< T2, DL2 > moveAndDynamicCast ()
 
PointerType get () const
 
- Public Member Functions inherited from Common::SafeBool< DisposablePtr< T, DL > >
 operator bool_type () const
 
 operator bool_type ()
 

Member Function Documentation

◆ operator_bool()

template<typename T, class DL = DefaultDeleter<T>>
bool Common::DisposablePtr< T, DL >::operator_bool ( ) const
inline

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

◆ reset() [1/2]

template<typename T, class DL = DefaultDeleter<T>>
void Common::DisposablePtr< T, DL >::reset ( PointerType  o,
DisposeAfterUse::Flag  dispose 
)
inline

Resets the pointer with the new value. Old object will be destroyed

◆ reset() [2/2]

template<typename T, class DL = DefaultDeleter<T>>
void Common::DisposablePtr< T, DL >::reset ( )
inline

Clears the pointer. Old object will be destroyed

◆ get()

template<typename T, class DL = DefaultDeleter<T>>
PointerType Common::DisposablePtr< T, DL >::get ( ) const
inline

Returns the plain pointer value.

Returns
the pointer the DisposablePtr manages

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