ACF $AcfVersion:0$
Public Types | Public Member Functions | Protected Member Functions | List of all members
icomp::TReferenceMember< Interface > Class Template Reference

Pointer to referenced component object. More...

#include <TReferenceMember.h>

Inheritance diagram for icomp::TReferenceMember< Interface >:
icomp::TAttributeMember< CReferenceAttribute > icomp::CInterfaceManipBase istd::CIdManipBase

Public Types

typedef TAttributeMember< CReferenceAttributeBaseClass
 
typedef CInterfaceManipBase BaseClass2
 
typedef Interface InterfaceType
 
- Public Types inherited from icomp::TAttributeMember< CReferenceAttribute >
typedef CReferenceAttribute AttributeType
 
typedef Attribute::ValueType AttributeValueType
 
typedef void InterfaceType
 

Public Member Functions

 TReferenceMember ()
 
void Init (const IComponent *ownerPtr, const IRealAttributeStaticInfo &staticInfo)
 
bool IsValid () const
 Check if this reference can be resolved.
 
bool EnsureInitialized () const
 Ensure that initlization process is closed.
 
Interface * GetPtr () const
 Direct cccess to internal pointer.
 
Interface * operator-> () const
 Access to internal pointer.
 
- Public Member Functions inherited from icomp::TAttributeMember< CReferenceAttribute >
 TAttributeMember ()
 
void Init (const IComponent *ownerPtr, const IRealAttributeStaticInfo &staticInfo)
 Initialize this attribute.
 
bool IsValid () const
 Check if this attribute is valid.
 
const CReferenceAttributeGetAttributePtr () const
 Access to internal attribute pointer.
 
const AttributeValueTypeGetOriginalValue () const
 Get value of attribute.
 
const CReferenceAttributeoperator-> () const
 Access to internal attribute pointer.
 
const AttributeValueTypeoperator* () const
 Get value of attribute.
 

Protected Member Functions

 TReferenceMember (const TReferenceMember &ptr)
 
- Protected Member Functions inherited from icomp::TAttributeMember< CReferenceAttribute >
void SetAttribute (const CReferenceAttribute *attributePtr)
 
bool InitInternal (const IComponent *ownerPtr, const IRealAttributeStaticInfo &staticInfo, const IComponent **definitionComponentPtr)
 Internal initialize of attribute.
 

Additional Inherited Members

- Static Protected Member Functions inherited from icomp::CInterfaceManipBase
template<class Interface >
static Interface * ExtractInterface (IComponent *componentPtr, const QByteArray &subId="")
 Extract interface from component.
 
- Static Protected Member Functions inherited from istd::CIdManipBase
static bool SplitId (const QByteArray &complexId, QByteArray &baseId, QByteArray &subId)
 Split component ID into separated ID's.
 
static QByteArray JoinId (const QByteArray &baseId, const QByteArray &subId)
 Join base component ID and sub ID into composed component ID.
 

Detailed Description

template<class Interface>
class icomp::TReferenceMember< Interface >

Pointer to referenced component object.

Don't use direct this class, use macros I_REF and I_ASSIGN instead.

Thread-Safety:
This class uses double-checked locking with std::atomic for thread-safe lazy initialization. The pattern is safe because:
  • m_isInitialized is atomic with sequential consistency (default memory order)
  • m_interfacePtr is atomic
  • Once m_isInitialized is true, no further modifications occur to the cached data
  • The mutex protects the initialization phase

Definition at line 34 of file TReferenceMember.h.

Member Typedef Documentation

◆ BaseClass

template<class Interface >
typedef TAttributeMember<CReferenceAttribute> icomp::TReferenceMember< Interface >::BaseClass

Definition at line 39 of file TReferenceMember.h.

◆ BaseClass2

template<class Interface >
typedef CInterfaceManipBase icomp::TReferenceMember< Interface >::BaseClass2

Definition at line 40 of file TReferenceMember.h.

◆ InterfaceType

template<class Interface >
typedef Interface icomp::TReferenceMember< Interface >::InterfaceType

Definition at line 41 of file TReferenceMember.h.

Constructor & Destructor Documentation

◆ TReferenceMember() [1/2]

template<class Interface >
icomp::TReferenceMember< Interface >::TReferenceMember ( )

Definition at line 86 of file TReferenceMember.h.

◆ TReferenceMember() [2/2]

template<class Interface >
icomp::TReferenceMember< Interface >::TReferenceMember ( const TReferenceMember< Interface > &  ptr)
protected

Definition at line 180 of file TReferenceMember.h.

Member Function Documentation

◆ EnsureInitialized()

template<class Interface >
bool icomp::TReferenceMember< Interface >::EnsureInitialized ( ) const

Ensure that initlization process is closed.

Do the same as IsValid(), for convinience only (to provide better code clarify).

Definition at line 126 of file TReferenceMember.h.

References icomp::ICompositeComponent::GetSubcomponent(), and NULL.

◆ GetPtr()

template<class Interface >
Interface * icomp::TReferenceMember< Interface >::GetPtr ( ) const

Direct cccess to internal pointer.

Definition at line 158 of file TReferenceMember.h.

Referenced by iprm::TParamsPtrBase< ParamsSet, ParameterInterace >::Init(), and operator*().

◆ Init()

template<class Interface >
void icomp::TReferenceMember< Interface >::Init ( const IComponent ownerPtr,
const IRealAttributeStaticInfo staticInfo 
)

Definition at line 95 of file TReferenceMember.h.

◆ IsValid()

template<class Interface >
bool icomp::TReferenceMember< Interface >::IsValid ( ) const

Check if this reference can be resolved.

It calls EnsureInitialized().

Definition at line 119 of file TReferenceMember.h.

Referenced by iprm::TParamsPtrBase< ParamsSet, ParameterInterace >::Init().

◆ operator->()

template<class Interface >
Interface * icomp::TReferenceMember< Interface >::operator-> ( ) const

Access to internal pointer.

Definition at line 167 of file TReferenceMember.h.

References NULL.


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