|
ACF $AcfVersion:0$
|
A wrapper for managed and unmanaged interface pointers. More...
#include <TOptInterfacePtr.h>
Public Types | |
| typedef InterfaceType | Interface |
| typedef istd::TUniqueInterfacePtr< InterfaceType > | UniqueInterfacePtr |
| typedef istd::TSharedInterfacePtr< InterfaceType > | SharedInterfacePtr |
Public Member Functions | |
| TOptInterfacePtr (TOptInterfacePtr &&) noexcept=default | |
| TOptInterfacePtr & | operator= (TOptInterfacePtr &&) noexcept=default |
| TOptInterfacePtr ()=default | |
| TOptInterfacePtr (Interface *unamangedPtr)=delete | |
| TOptInterfacePtr (SharedInterfacePtr managedPtr) | |
| TOptInterfacePtr (UniqueInterfacePtr &managedPtr) | |
| void | SetUnmanagedPtr (Interface *ptr) |
| void | SetManagedPtr (SharedInterfacePtr managedPtr) |
| void | AdoptRawPtr (Interface *rawPtr) |
| Adopts ownership of a raw pointer.The pointer must be allocated in a manner compatible with SharedInterfacePtr's deleter. | |
| template<typename T > | |
| bool | AdoptCastedRawPtr (T *rawPtr) |
| template<class T > | |
| bool | SetCastedPtr (TSharedInterfacePtr< T > &source) |
| void | TakeOver (TOptInterfacePtr &ptr) |
| template<class T > | |
| bool | TakeOver (TUniqueInterfacePtr< T > &source) |
| template<class T > | |
| bool | TakeOver (TUniqueInterfacePtr< T > &&source) |
| bool | IsValid () const |
| bool | IsManaged () const |
| bool | IsUnmanaged () const |
| void | Reset () |
| template<typename InterfaceCast = InterfaceType> | |
| const InterfaceCast * | GetPtr () const |
| template<typename InterfaceCast = InterfaceType> | |
| InterfaceCast * | GetPtr () |
| const Interface * | operator-> () const |
| Interface * | operator-> () |
| const Interface & | operator* () const |
| Interface & | operator* () |
| TOptInterfacePtr (const TOptInterfacePtr &ptr) | |
| Copy constructor. | |
| TOptInterfacePtr & | operator= (const TOptInterfacePtr &ptr) |
| Assign operator. | |
| operator bool () const noexcept | |
Static Public Member Functions | |
| static TOptInterfacePtr | FromUnmanaged (InterfaceType *ptr) |
A wrapper for managed and unmanaged interface pointers.
TOptInterfacePtr is a versatile smart pointer that can hold either:
This is useful in scenarios where:
Key characteristics:
| InterfaceType | The interface type to expose. |
Example:
Definition at line 65 of file TOptInterfacePtr.h.
| typedef InterfaceType istd::TOptInterfacePtr< InterfaceType >::Interface |
Definition at line 68 of file TOptInterfacePtr.h.
| typedef istd::TSharedInterfacePtr<InterfaceType> istd::TOptInterfacePtr< InterfaceType >::SharedInterfacePtr |
Definition at line 70 of file TOptInterfacePtr.h.
| typedef istd::TUniqueInterfacePtr<InterfaceType> istd::TOptInterfacePtr< InterfaceType >::UniqueInterfacePtr |
Definition at line 69 of file TOptInterfacePtr.h.
|
defaultnoexcept |
|
default |
|
delete |
|
inlineexplicit |
Definition at line 91 of file TOptInterfacePtr.h.
|
inlineexplicit |
Definition at line 97 of file TOptInterfacePtr.h.
References istd::TSharedInterfacePtr< InterfaceType, RootIntefaceType >::FromUnique().
|
inline |
Copy constructor.
Definition at line 356 of file TOptInterfacePtr.h.
|
inline |
Definition at line 138 of file TOptInterfacePtr.h.
References istd::TOptInterfacePtr< InterfaceType >::AdoptRawPtr(), and istd::TOptInterfacePtr< InterfaceType >::Reset().
|
inline |
Adopts ownership of a raw pointer.The pointer must be allocated in a manner compatible with SharedInterfacePtr's deleter.
Do NOT pass stack pointers or memory owned elsewhere.
Definition at line 127 of file TOptInterfacePtr.h.
Referenced by istd::TOptInterfacePtr< InterfaceType >::AdoptCastedRawPtr().
|
inlinestatic |
Definition at line 81 of file TOptInterfacePtr.h.
References istd::TOptInterfacePtr< InterfaceType >::SetUnmanagedPtr().
|
inline |
Definition at line 297 of file TOptInterfacePtr.h.
References istd::TInterfacePtr< InterfaceType, PolymorphicPointerImpl >::GetPtr(), and istd::TInterfacePtr< InterfaceType, PolymorphicPointerImpl >::IsValid().
|
inline |
Definition at line 272 of file TOptInterfacePtr.h.
References istd::TInterfacePtr< InterfaceType, PolymorphicPointerImpl >::GetPtr(), and istd::TInterfacePtr< InterfaceType, PolymorphicPointerImpl >::IsValid().
Referenced by istd::TOptInterfacePtr< InterfaceType >::operator*(), istd::TOptInterfacePtr< InterfaceType >::operator*(), istd::TOptInterfacePtr< InterfaceType >::operator->(), and istd::TOptInterfacePtr< InterfaceType >::operator->().
|
inline |
Definition at line 251 of file TOptInterfacePtr.h.
References istd::TInterfacePtr< InterfaceType, PolymorphicPointerImpl >::IsValid().
|
inline |
Definition at line 257 of file TOptInterfacePtr.h.
|
inline |
Definition at line 245 of file TOptInterfacePtr.h.
References istd::TInterfacePtr< InterfaceType, PolymorphicPointerImpl >::IsValid().
Referenced by istd::TOptInterfacePtr< InterfaceType >::operator bool().
|
inlineexplicitnoexcept |
Definition at line 377 of file TOptInterfacePtr.h.
References istd::TOptInterfacePtr< InterfaceType >::IsValid().
|
inline |
Definition at line 345 of file TOptInterfacePtr.h.
References istd::TOptInterfacePtr< InterfaceType >::GetPtr().
|
inline |
Definition at line 337 of file TOptInterfacePtr.h.
References istd::TOptInterfacePtr< InterfaceType >::GetPtr().
|
inline |
Definition at line 329 of file TOptInterfacePtr.h.
References istd::TOptInterfacePtr< InterfaceType >::GetPtr().
|
inline |
Definition at line 321 of file TOptInterfacePtr.h.
References istd::TOptInterfacePtr< InterfaceType >::GetPtr().
|
inline |
Assign operator.
Definition at line 367 of file TOptInterfacePtr.h.
|
defaultnoexcept |
|
inline |
Definition at line 263 of file TOptInterfacePtr.h.
References istd::TSharedInterfacePtr< InterfaceType, RootIntefaceType >::Reset().
Referenced by istd::TOptInterfacePtr< InterfaceType >::AdoptCastedRawPtr(), istd::TOptInterfacePtr< InterfaceType >::SetCastedPtr(), istd::TOptInterfacePtr< InterfaceType >::TakeOver(), and istd::TOptInterfacePtr< InterfaceType >::TakeOver().
|
inline |
|
inline |
Definition at line 113 of file TOptInterfacePtr.h.
|
inline |
Definition at line 103 of file TOptInterfacePtr.h.
References istd::TSharedInterfacePtr< InterfaceType, RootIntefaceType >::Reset().
Referenced by istd::TOptInterfacePtr< InterfaceType >::FromUnmanaged().
|
inline |
Definition at line 179 of file TOptInterfacePtr.h.
References istd::TSharedInterfacePtr< InterfaceType, RootIntefaceType >::Reset().
|
inline |
|
inline |