|
ACF $AcfVersion:0$
|
Unique ownership smart pointer for interface types. More...
#include <TInterfacePtr.h>
Public Types | |
| typedef TInterfacePtr< InterfaceType, std::unique_ptr< RootIntefaceType > > | BaseClass |
| typedef BaseClass::ExtractInterfaceFunc | ExtractInterfaceFunc |
Public Types inherited from istd::TInterfacePtr< InterfaceType, PolymorphicPointerImpl > | |
| typedef PolymorphicPointerImpl | RootObjectPtr |
| typedef std::function< InterfaceType *()> | ExtractInterfaceFunc |
Public Member Functions | |
| TUniqueInterfacePtr () noexcept | |
| TUniqueInterfacePtr (InterfaceType *interfacePtr) noexcept | |
| template<typename T > | |
| TUniqueInterfacePtr (std::unique_ptr< T > &&ptr) noexcept | |
| TUniqueInterfacePtr (RootIntefaceType *rootPtr, const ExtractInterfaceFunc &extractInterface) noexcept | |
| TUniqueInterfacePtr (RootIntefaceType *rootPtr, InterfaceType *interfacePtr) noexcept | |
| TUniqueInterfacePtr (const TUniqueInterfacePtr &ptr)=delete | |
| TUniqueInterfacePtr & | operator= (const TUniqueInterfacePtr &ptr)=delete |
| template<typename DerivedType > | |
| TUniqueInterfacePtr (TUniqueInterfacePtr< DerivedType > &&ptr) noexcept | |
| Move constructor from unique pointer for the derived or same type. | |
| TUniqueInterfacePtr & | operator= (TUniqueInterfacePtr &&ptr) noexcept |
| Move assignment. | |
| template<typename DerivedType > | |
| TUniqueInterfacePtr & | operator= (TUniqueInterfacePtr< DerivedType > &&ptr) noexcept |
| Move assignment from derived type. | |
| TUniqueInterfacePtr & | operator= (std::nullptr_t) noexcept |
| RootIntefaceType * | PopRootPtr () noexcept |
| Pop the root pointer. | |
| InterfaceType * | PopInterfacePtr () noexcept |
| Intelligent pop of interface pointer. | |
| InterfaceType * | PopPtr () noexcept |
| Intelligent pop method - alias for PopInterfacePtr(). | |
| void | TakeOver (TUniqueInterfacePtr< InterfaceType > &from) noexcept |
| Transfer ownership from another unique ptr (take over raw ownership). | |
| template<class SourceInterfaceType > | |
| bool | MoveCastedPtr (TUniqueInterfacePtr< SourceInterfaceType > &&source) noexcept |
| template<class SourceInterfaceType > | |
| bool | MoveCastedPtr (TUniqueInterfacePtr< SourceInterfaceType > &source) noexcept |
Public Member Functions inherited from istd::TInterfacePtr< InterfaceType, PolymorphicPointerImpl > | |
| bool | IsValid () const noexcept |
| template<typename Interface = InterfaceType> | |
| Interface * | GetPtr () noexcept |
| template<typename Interface = InterfaceType> | |
| const Interface * | GetPtr () const noexcept |
| const InterfaceType * | operator-> () const noexcept |
| InterfaceType * | operator-> () noexcept |
| const InterfaceType & | operator* () const noexcept |
| InterfaceType & | operator* () noexcept |
| void | Reset () noexcept |
| void | SetPtr (InterfaceType *interfacePtr) |
| void | SetPtr (istd::IPolymorphic *rootPtr, const ExtractInterfaceFunc &extractInterface) |
| void | SetPtr (istd::IPolymorphic *rootPtr, InterfaceType *interfacePtr) noexcept |
| RootObjectPtr & | GetBasePtr () noexcept |
| const RootObjectPtr & | GetBasePtr () const noexcept |
| InterfaceType * | get () noexcept |
| const InterfaceType * | get () const noexcept |
| operator bool () const noexcept | |
| bool | operator== (std::nullptr_t) const noexcept |
| bool | operator!= (std::nullptr_t) const noexcept |
| TInterfacePtr & | operator= (std::nullptr_t) noexcept |
Friends | |
| template<typename U , typename R > | |
| class | TUniqueInterfacePtr |
Additional Inherited Members | |
Protected Member Functions inherited from istd::TInterfacePtr< InterfaceType, PolymorphicPointerImpl > | |
| TInterfacePtr (const TInterfacePtr &)=delete | |
| TInterfacePtr & | operator= (const TInterfacePtr &)=delete |
| TInterfacePtr () noexcept | |
| TInterfacePtr (InterfaceType *interfacePtr) noexcept | |
| TInterfacePtr (std::nullptr_t) noexcept | |
| TInterfacePtr (istd::IPolymorphic *rootPtr, const ExtractInterfaceFunc &extractInterface) noexcept | |
| TInterfacePtr (istd::IPolymorphic *rootPtr, InterfaceType *interfacePtr) noexcept | |
| TInterfacePtr (TInterfacePtr &&ptr) noexcept | |
| TInterfacePtr & | operator= (TInterfacePtr &&ptr) noexcept |
Protected Attributes inherited from istd::TInterfacePtr< InterfaceType, PolymorphicPointerImpl > | |
| RootObjectPtr | m_rootPtr |
| InterfaceType * | m_interfacePtr = nullptr |
Unique ownership smart pointer for interface types.
TUniqueInterfacePtr provides exclusive ownership of an object with automatic memory management. It is similar to std::unique_ptr but specialized for ACF's interface-based architecture where the root object and interface pointer may differ.
Key characteristics:
| InterfaceType | The interface type to expose. |
| RootIntefaceType | The root type that owns the object (default: istd::IPolymorphic). |
Example:
Definition at line 273 of file TInterfacePtr.h.
| typedef TInterfacePtr<InterfaceType, std::unique_ptr<RootIntefaceType> > istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::BaseClass |
Definition at line 280 of file TInterfacePtr.h.
| typedef BaseClass::ExtractInterfaceFunc istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::ExtractInterfaceFunc |
Definition at line 281 of file TInterfacePtr.h.
|
inlinenoexcept |
Definition at line 290 of file TInterfacePtr.h.
|
inlinenoexcept |
Definition at line 295 of file TInterfacePtr.h.
|
inlinenoexcept |
Definition at line 301 of file TInterfacePtr.h.
|
inlineexplicitnoexcept |
Definition at line 307 of file TInterfacePtr.h.
|
inlineexplicitnoexcept |
Definition at line 312 of file TInterfacePtr.h.
|
delete |
|
inlinenoexcept |
Move constructor from unique pointer for the derived or same type.
Definition at line 324 of file TInterfacePtr.h.
|
inlinenoexcept |
Definition at line 450 of file TInterfacePtr.h.
Referenced by istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::MoveCastedPtr().
|
inlinenoexcept |
Definition at line 463 of file TInterfacePtr.h.
References istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::MoveCastedPtr().
|
delete |
|
inlinenoexcept |
Definition at line 357 of file TInterfacePtr.h.
|
inlinenoexcept |
Move assignment.
Definition at line 334 of file TInterfacePtr.h.
|
inlinenoexcept |
Move assignment from derived type.
Definition at line 347 of file TInterfacePtr.h.
|
inlinenoexcept |
Intelligent pop of interface pointer.
Caller takes ownership of the raw pointer.
Automatically chooses the correct extraction method based on internal pointer state:
Definition at line 383 of file TInterfacePtr.h.
References istd::TInterfacePtr< InterfaceType, PolymorphicPointerImpl >::get(), and istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::PopRootPtr().
Referenced by istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::PopPtr().
|
inlinenoexcept |
Intelligent pop method - alias for PopInterfacePtr().
Automatically chooses the correct extraction method based on internal pointer state. See PopInterfacePtr() for details.
Definition at line 435 of file TInterfacePtr.h.
References istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::PopInterfacePtr().
|
inlinenoexcept |
Pop the root pointer.
Caller takes ownership of the raw pointer.
Definition at line 366 of file TInterfacePtr.h.
Referenced by istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::PopInterfacePtr().
|
inlinenoexcept |
Transfer ownership from another unique ptr (take over raw ownership).
Alternatively move assignment operator can be used.
Definition at line 444 of file TInterfacePtr.h.
Referenced by iprm::CParamsSet::ParameterInfo::ParameterInfo().
|
friend |
Definition at line 277 of file TInterfacePtr.h.