ACF $AcfVersion:0$
Public Types | Public Member Functions | Friends | List of all members
istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType > Class Template Reference

Unique ownership smart pointer for interface types. More...

#include <TInterfacePtr.h>

Inheritance diagram for istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >:
istd::TInterfacePtr< InterfaceType, PolymorphicPointerImpl >

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
 
TUniqueInterfacePtroperator= (const TUniqueInterfacePtr &ptr)=delete
 
template<typename DerivedType >
 TUniqueInterfacePtr (TUniqueInterfacePtr< DerivedType > &&ptr) noexcept
 Move constructor from unique pointer for the derived or same type.
 
TUniqueInterfacePtroperator= (TUniqueInterfacePtr &&ptr) noexcept
 Move assignment.
 
template<typename DerivedType >
TUniqueInterfacePtroperator= (TUniqueInterfacePtr< DerivedType > &&ptr) noexcept
 Move assignment from derived type.
 
TUniqueInterfacePtroperator= (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
 
RootObjectPtrGetBasePtr () noexcept
 
const RootObjectPtrGetBasePtr () 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
 
TInterfacePtroperator= (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
 
TInterfacePtroperator= (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
 
TInterfacePtroperator= (TInterfacePtr &&ptr) noexcept
 
- Protected Attributes inherited from istd::TInterfacePtr< InterfaceType, PolymorphicPointerImpl >
RootObjectPtr m_rootPtr
 
InterfaceType * m_interfacePtr = nullptr
 

Detailed Description

template<class InterfaceType, class RootIntefaceType = istd::IPolymorphic>
class istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >

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:

Template Parameters
InterfaceTypeThe interface type to expose.
RootIntefaceTypeThe root type that owns the object (default: istd::IPolymorphic).
Note
RootIntefaceType must derive from istd::IPolymorphic and have a virtual destructor.
See also
TSharedInterfacePtr, TOptInterfacePtr

Example:

// Create a unique pointer
ptr->DoSomething();
// Transfer ownership via move
// ptr is now invalid, ptr2 owns the object
Unique ownership smart pointer for interface types.

Definition at line 273 of file TInterfacePtr.h.

Member Typedef Documentation

◆ BaseClass

template<class InterfaceType , class RootIntefaceType = istd::IPolymorphic>
typedef TInterfacePtr<InterfaceType, std::unique_ptr<RootIntefaceType> > istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::BaseClass

Definition at line 280 of file TInterfacePtr.h.

◆ ExtractInterfaceFunc

template<class InterfaceType , class RootIntefaceType = istd::IPolymorphic>
typedef BaseClass::ExtractInterfaceFunc istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::ExtractInterfaceFunc

Definition at line 281 of file TInterfacePtr.h.

Constructor & Destructor Documentation

◆ TUniqueInterfacePtr() [1/7]

template<class InterfaceType , class RootIntefaceType = istd::IPolymorphic>
istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::TUniqueInterfacePtr ( )
inlinenoexcept

Definition at line 290 of file TInterfacePtr.h.

◆ TUniqueInterfacePtr() [2/7]

template<class InterfaceType , class RootIntefaceType = istd::IPolymorphic>
istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::TUniqueInterfacePtr ( InterfaceType *  interfacePtr)
inlinenoexcept

Definition at line 295 of file TInterfacePtr.h.

◆ TUniqueInterfacePtr() [3/7]

template<class InterfaceType , class RootIntefaceType = istd::IPolymorphic>
template<typename T >
istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::TUniqueInterfacePtr ( std::unique_ptr< T > &&  ptr)
inlinenoexcept

Definition at line 301 of file TInterfacePtr.h.

◆ TUniqueInterfacePtr() [4/7]

template<class InterfaceType , class RootIntefaceType = istd::IPolymorphic>
istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::TUniqueInterfacePtr ( RootIntefaceType *  rootPtr,
const ExtractInterfaceFunc extractInterface 
)
inlineexplicitnoexcept

Definition at line 307 of file TInterfacePtr.h.

◆ TUniqueInterfacePtr() [5/7]

template<class InterfaceType , class RootIntefaceType = istd::IPolymorphic>
istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::TUniqueInterfacePtr ( RootIntefaceType *  rootPtr,
InterfaceType *  interfacePtr 
)
inlineexplicitnoexcept

Definition at line 312 of file TInterfacePtr.h.

◆ TUniqueInterfacePtr() [6/7]

template<class InterfaceType , class RootIntefaceType = istd::IPolymorphic>
istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::TUniqueInterfacePtr ( const TUniqueInterfacePtr< InterfaceType, RootIntefaceType > &  ptr)
delete

◆ TUniqueInterfacePtr() [7/7]

template<class InterfaceType , class RootIntefaceType = istd::IPolymorphic>
template<typename DerivedType >
istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::TUniqueInterfacePtr ( TUniqueInterfacePtr< DerivedType > &&  ptr)
inlinenoexcept

Move constructor from unique pointer for the derived or same type.

Definition at line 324 of file TInterfacePtr.h.

Member Function Documentation

◆ MoveCastedPtr() [1/2]

template<class InterfaceType , class RootIntefaceType = istd::IPolymorphic>
template<class SourceInterfaceType >
bool istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::MoveCastedPtr ( TUniqueInterfacePtr< SourceInterfaceType > &&  source)
inlinenoexcept

◆ MoveCastedPtr() [2/2]

template<class InterfaceType , class RootIntefaceType = istd::IPolymorphic>
template<class SourceInterfaceType >
bool istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::MoveCastedPtr ( TUniqueInterfacePtr< SourceInterfaceType > &  source)
inlinenoexcept

◆ operator=() [1/4]

template<class InterfaceType , class RootIntefaceType = istd::IPolymorphic>
TUniqueInterfacePtr & istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::operator= ( const TUniqueInterfacePtr< InterfaceType, RootIntefaceType > &  ptr)
delete

◆ operator=() [2/4]

template<class InterfaceType , class RootIntefaceType = istd::IPolymorphic>
TUniqueInterfacePtr & istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::operator= ( std::nullptr_t  )
inlinenoexcept

Definition at line 357 of file TInterfacePtr.h.

◆ operator=() [3/4]

template<class InterfaceType , class RootIntefaceType = istd::IPolymorphic>
TUniqueInterfacePtr & istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::operator= ( TUniqueInterfacePtr< InterfaceType, RootIntefaceType > &&  ptr)
inlinenoexcept

Move assignment.

Definition at line 334 of file TInterfacePtr.h.

◆ operator=() [4/4]

template<class InterfaceType , class RootIntefaceType = istd::IPolymorphic>
template<typename DerivedType >
TUniqueInterfacePtr & istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::operator= ( TUniqueInterfacePtr< DerivedType > &&  ptr)
inlinenoexcept

Move assignment from derived type.

Definition at line 347 of file TInterfacePtr.h.

◆ PopInterfacePtr()

template<class InterfaceType , class RootIntefaceType = istd::IPolymorphic>
InterfaceType * istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::PopInterfacePtr ( )
inlinenoexcept

Intelligent pop of interface pointer.

Caller takes ownership of the raw pointer.

Automatically chooses the correct extraction method based on internal pointer state:

  1. If m_rootPtr == m_interfacePtr (simple objects): extracts interface pointer
  2. If m_interfacePtr != nullptr && m_rootPtr == nullptr: extracts interface pointer
  3. If m_rootPtr != m_interfacePtr and both != nullptr (composite components): extracts root and casts to interface
Returns
Interface pointer with ownership transferred to caller.

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().

◆ PopPtr()

template<class InterfaceType , class RootIntefaceType = istd::IPolymorphic>
InterfaceType * 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.

Returns
Interface pointer with ownership transferred to caller.

Definition at line 435 of file TInterfacePtr.h.

References istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::PopInterfacePtr().

◆ PopRootPtr()

template<class InterfaceType , class RootIntefaceType = istd::IPolymorphic>
RootIntefaceType * istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::PopRootPtr ( )
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().

◆ TakeOver()

template<class InterfaceType , class RootIntefaceType = istd::IPolymorphic>
void istd::TUniqueInterfacePtr< InterfaceType, RootIntefaceType >::TakeOver ( TUniqueInterfacePtr< InterfaceType > &  from)
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().

Friends And Related Symbol Documentation

◆ TUniqueInterfacePtr

template<class InterfaceType , class RootIntefaceType = istd::IPolymorphic>
template<typename U , typename R >
friend class TUniqueInterfacePtr
friend

Definition at line 277 of file TInterfacePtr.h.


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