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

Pointer to list of referenced component objects. More...

#include <TMultiReferenceMember.h>

Inheritance diagram for icomp::TMultiReferenceMember< Interface >:
icomp::TMultiAttributeMember< CMultiReferenceAttribute > icomp::CInterfaceManipBase istd::CIdManipBase

Public Types

typedef TMultiAttributeMember< CMultiReferenceAttributeBaseClass
 
typedef CInterfaceManipBase BaseClass2
 
typedef Interface InterfaceType
 
- Public Types inherited from icomp::TMultiAttributeMember< CMultiReferenceAttribute >
typedef CMultiReferenceAttribute AttributeType
 
typedef Attribute::ValueType AttributeValueType
 
typedef void InterfaceType
 

Public Member Functions

 TMultiReferenceMember ()
 
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 * operator[] (int index) const
 Access to interface of component at specified index.
 
- Public Member Functions inherited from icomp::TMultiAttributeMember< CMultiReferenceAttribute >
 TMultiAttributeMember ()
 
void Init (const IComponent *ownerPtr, const IRealAttributeStaticInfo &staticInfo)
 Internal initialize of attribute.
 
bool IsValid () const
 Check if this attribute is valid.
 
int GetCount () const
 Get number of attributes.
 
const AttributeValueTypeoperator[] (int index) const
 Access to object pointed by internal pointer.
 
int FindValue (const AttributeValueType &value) const
 Find attribute value.
 

Protected Member Functions

 TMultiReferenceMember (const TMultiReferenceMember &ptr)
 
- Protected Member Functions inherited from icomp::TMultiAttributeMember< CMultiReferenceAttribute >
bool InitInternal (const IComponent *ownerPtr, const IRealAttributeStaticInfo &staticInfo, const IComponent **definitionComponentPtr)
 

Additional Inherited Members

- Static Public 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.
 
- Static Protected Member Functions inherited from icomp::CInterfaceManipBase
template<class Interface >
static Interface * ExtractInterface (IComponent *componentPtr, const QByteArray &subId="")
 Extract interface from component.
 

Detailed Description

template<class Interface>
class icomp::TMultiReferenceMember< Interface >

Pointer to list of referenced component objects.

Don't use direct this class, use macros I_MULTI_REF and I_ASSIGN_MULTI_* 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)
  • Once m_isInitialized is true, no further modifications occur to m_components
  • The mutex protects the initialization phase
  • Sequential consistency ensures all writes to m_components are visible to threads that observe m_isInitialized == true

Definition at line 34 of file TMultiReferenceMember.h.

Member Typedef Documentation

◆ BaseClass

template<class Interface >
typedef TMultiAttributeMember<CMultiReferenceAttribute> icomp::TMultiReferenceMember< Interface >::BaseClass

Definition at line 37 of file TMultiReferenceMember.h.

◆ BaseClass2

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

Definition at line 38 of file TMultiReferenceMember.h.

◆ InterfaceType

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

Definition at line 39 of file TMultiReferenceMember.h.

Constructor & Destructor Documentation

◆ TMultiReferenceMember() [1/2]

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

Definition at line 88 of file TMultiReferenceMember.h.

◆ TMultiReferenceMember() [2/2]

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

Definition at line 181 of file TMultiReferenceMember.h.

Member Function Documentation

◆ EnsureInitialized()

template<class Interface >
bool icomp::TMultiReferenceMember< 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 TMultiReferenceMember.h.

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

◆ Init()

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

Definition at line 96 of file TMultiReferenceMember.h.

◆ IsValid()

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

Check if this reference can be resolved.

It calls EnsureInitialized().

Definition at line 119 of file TMultiReferenceMember.h.

◆ operator[]()

template<class Interface >
Interface * icomp::TMultiReferenceMember< Interface >::operator[] ( int  index) const

Access to interface of component at specified index.

Returns
pointer to interface or NULL if there is no associated object at this index.

Definition at line 164 of file TMultiReferenceMember.h.

References NULL.


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