Classes | Namespaces | Macros | Functions
CComponentBase.h File Reference
#include <istd/CClassInfo.h>
#include <iattr/TAttribute.h>
#include <iattr/TMultiAttribute.h>
#include <icomp/IComponent.h>
#include <icomp/ICompositeComponent.h>
#include <icomp/IRealComponentStaticInfo.h>
#include <icomp/TInterfaceRegistrator.h>
#include <icomp/TAttributeMember.h>
#include <icomp/TMultiAttributeMember.h>
#include <icomp/TReferenceMember.h>
#include <icomp/TMultiReferenceMember.h>
#include <icomp/TFactoryMember.h>
#include <icomp/TMultiFactoryMember.h>
#include <icomp/TAttributeStaticInfo.h>
#include <icomp/TComponentStaticInfo.h>
#include <icomp/TSubelementStaticInfo.h>
#include <icomp/CBaseComponentStaticInfo.h>
#include <icomp/CRelatedInfoRegistrator.h>

Go to the source code of this file.

Classes

class  icomp::CComponentBase
 Base class for component implementation. More...
 

Namespaces

 icomp
 Package with interfaces and class used for components concept.
 

Macros

#define I_REGISTER_SUBELEMENT_INTERFACE_T(ElementName, InterfaceType, extractorFunction)
 Register interface extractor for some subelement with template extractor function. More...
 
#define I_TEXTATTR(member)
 Declare translatable text attribute member. More...
 
#define I_MULTITEXTATTR(member)
 Declare translatable multiple text attribute member. More...
 
#define I_TFACT(interfaceType, member)
 
#define I_ASSIGN_BASE(member, id, description, isObligatory)
 Used to assign value for single parameter (attribute, reference or factory). More...
 
#define I_ASSIGN_MULTI_BASE(member, id, description, isObligatory, defaultValue)
 Used to assign value for multiply parameters (attributes, references or factories). More...
 
#define I_TASSIGN_BASE(member, id, description, isObligatory)
 Used to assign value for single parameter with template type (attribute, reference or factory). More...
 
#define I_TASSIGN_MULTI_BASE(member, id, description, isObligatory, defaultValue)
 Used to assign value for multiply parameters with template type (attributes, references or factories). More...
 

Functions

template<class Dest >
Dest * CompCastPtr (istd::IPolymorphic *objectPtr)
 Cast to specified interface trying to use component interface query. More...
 
template<class Dest >
const Dest * CompCastPtr (const istd::IPolymorphic *objectPtr)
 Cast to specified interface trying to use component interface query. More...
 

Macro Definition Documentation

#define I_ASSIGN_BASE (   member,
  id,
  description,
  isObligatory 
)
Value:
static icomp::TAttributeStaticInfo<member##_AttrType> member##_Info(staticInfo, id, description, &member##_Default, isObligatory? member##_AttrType::DAF_OBLIGATORY: member##_AttrType::DAF_OPTIONAL, istd::CClassInfo::GetInfo<typename member##_Type::InterfaceType>());\
if (componentPtr != NULL){\
componentPtr->member.Init(componentPtr, member##_Info);\
}
#define NULL
Definition: istd.h:64

Used to assign value for single parameter (attribute, reference or factory).

Definition at line 322 of file CComponentBase.h.

#define I_ASSIGN_MULTI_BASE (   member,
  id,
  description,
  isObligatory,
  defaultValue 
)
Value:
static member##_AttrType member##_Default(int(sizeof(member##_DefaultElements) / sizeof(member##_AttrType::ValueType)), member##_DefaultElements);\
I_ASSIGN_BASE(member, id, description, isObligatory)
#define I_ASSIGN_BASE(member, id, description, isObligatory)
Used to assign value for single parameter (attribute, reference or factory).

Used to assign value for multiply parameters (attributes, references or factories).

Definition at line 341 of file CComponentBase.h.

#define I_REGISTER_SUBELEMENT_INTERFACE_T (   ElementName,
  InterfaceType,
  extractorFunction 
)
Value:
{\
subelementInfo_##ElementName,\
extractorFunction<InterfaceType>);\
Q_UNUSED(staticRegistrator);\
}

Register interface extractor for some subelement with template extractor function.

Parameters
ElementNamename of subelement.
InterfaceTypetype of registered interface.
extractorFunctionfunction returning pointer to casted type (must be 'InterfaceType* Foo(MyComponent& component)')".

Definition at line 185 of file CComponentBase.h.

#define I_TASSIGN_BASE (   member,
  id,
  description,
  isObligatory 
)
Value:
static icomp::TAttributeStaticInfo<member##_AttrType> member##_Info(staticInfo, id, description, &member##_Default, isObligatory? member##_AttrType::DAF_OBLIGATORY: member##_AttrType::DAF_OPTIONAL, istd::CClassInfo::GetInfo<typename member##_Type::InterfaceType>());\
if (componentPtr != NULL){\
componentPtr->member.Init(componentPtr, member##_Info);\
}
#define NULL
Definition: istd.h:64

Used to assign value for single parameter with template type (attribute, reference or factory).

Definition at line 395 of file CComponentBase.h.

#define I_TASSIGN_MULTI_BASE (   member,
  id,
  description,
  isObligatory,
  defaultValue 
)
Value:
static member##_AttrType member##_Default(int(sizeof(member##_DefaultElements) / sizeof(member##_AttrType::ValueType)), member##_DefaultElements);\
I_TASSIGN_BASE(member, id, description, isObligatory)
#define I_TASSIGN_BASE(member, id, description, isObligatory)
Used to assign value for single parameter with template type (attribute, reference or factory)...

Used to assign value for multiply parameters with template type (attributes, references or factories).

Definition at line 411 of file CComponentBase.h.

#define I_TFACT (   interfaceType,
  member 
)
Value:
typedef icomp::TFactoryMember<interfaceType> member##_Type;\
typedef typename icomp::TFactoryMember<interfaceType>::AttributeType member##_AttrType;\
icomp::TFactoryMember<interfaceType> member
Special attribute used to store referenced component ID.
Factory of components used as component member.

Definition at line 305 of file CComponentBase.h.

Function Documentation

template<class Dest >
Dest* CompCastPtr ( istd::IPolymorphic objectPtr)

Cast to specified interface trying to use component interface query.

It extends standard dynamic_cast functinality when you use composed components.

Definition at line 469 of file CComponentBase.h.

References icomp::IComponent::GetInterface(), icomp::IComponent::GetParentComponent(), and NULL.

template<class Dest >
const Dest* CompCastPtr ( const istd::IPolymorphic objectPtr)

Cast to specified interface trying to use component interface query.

It extends standard dynamic_cast functinality when you use composed components. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 494 of file CComponentBase.h.

References icomp::IComponent::GetInterface(), icomp::IComponent::GetParentComponent(), and NULL.

© 2007-2017 Witold Gantzke and Kirill Lepskiy