ComponentDescriptor Class Reference 系统

#include <objectbase.h>

详细描述

ComponentDescriptor describes a component implementation (created by MAXON_COMPONENT and MAXON_COMPONENT_ONLY_REGISTER) at runtime. It is an EntityDefinition object, the component descriptor can be published as an object via MAXON_DECLARATION.

公共成员函数

  ComponentDescriptor ()
  ~ComponentDescriptor ()
template<typename C , typename REG >
  ComponentDescriptor (C *ctype, LiteralId &&cid, TranslationUnit *unit, const Char *file, EntityBase::FLAGS flags, REG *registry)
const Id GetId () const
Result < void >  初始化 (const Id &cause) const
String   ToString (const FormatStatement *fs=nullptr) const
const EntityDefinition &  GetDefinition () const
const ComponentDescriptor GetClassProxy () const
const Block < const InterfaceReference *const > &  GetInterfaces () const
EntityBase::FLAGS  GetFlags () const
Int   GetSize () const

静态公共成员函数

static const ComponentDescriptor NullValue ()

Public Attributes

Result < void >(*)(const DataSerializeInterface &)  GetDescribeIO () const

私有成员函数

  ComponentDescriptor ( Bool dummy, const ComponentDescriptor &base)
  ComponentDescriptor ( LiteralId &&cid, TranslationUnit *unit, const Char *file, EntityBase::FLAGS flags)
template<typename C >
void  Construct ()

Private Attributes

EntityDefinition  _super
void(*  _construct )(void *component)
void(*  _destruct )(void *component)
Result < void >(*  _init )(void *component)
void(*  _free )(void *component)
Result < void >(*  _copyFrom )(void *destComp, const void *srcObject)
Bool (*  _constructMTable )( ClassInfo *info, Int offset, void *supervtable)
Result < void >(*  _initImplementation )()
void(*  _freeImplementation )()
Result < void >(*  _describeIO )(const DataSerializeInterface &)
Block < const InterfaceReference *const >  _interfaces
Int   _size
Int   _alignment
Int   _superMTableSize
UInt   _hashCode
Int   _selfPtrOffset
Int   _simpleMTableSize
Id   _registry
const ComponentDescriptor _classProxy
void *  _implementedMethods
const PrivateSuperCallBase _supercalls

Friends

class  ObjectModel
class  ObjectInterface
class  PrivateSuperCallBase
class  ClassInfo
class  ClassImpl
class  VirtualInterfaceInfo
struct  VirtualInterfaceVersion

构造函数 & 析构函数文档编制

◆  ComponentDescriptor() [1/4]

ComponentDescriptor ( )

◆  ~ComponentDescriptor()

~ ComponentDescriptor ( )

◆  ComponentDescriptor() [2/4]

ComponentDescriptor ( C *  ctype ,
LiteralId &&  cid ,
TranslationUnit *  unit ,
const Char file ,
EntityBase::FLAGS  flags ,
REG *  registry  
)

Constructs the ComponentDescriptor object and adds it to the definition list of the current translation unit. Class C is used as implementation class of the component.

参数
[in] ctype Dummy parameter, this is only needed to determine template parameter C.
[in] cid The unique component identifier.
[in] unit The translation unit containing the component implementation.
[in] file Source file name.
[in] flags PROXY may be set here.
[in] registry Dummy parameter to pass the registry.
Template Parameters
C Implementation class of the component.

◆  ComponentDescriptor() [3/4]

ComponentDescriptor ( Bool   dummy ,
const ComponentDescriptor base  
)
private

◆  ComponentDescriptor() [4/4]

ComponentDescriptor ( LiteralId &&  cid ,
TranslationUnit *  unit ,
const Char file ,
EntityBase::FLAGS  flags  
)
private

成员函数文档编制

◆  GetId()

const Id & GetId ( ) const

Returns the component identifier of this descriptor.

返回
Unique identifier.

◆  Initialize()

Result <void> Initialize ( const Id cause ) const

Initializes the component descriptor. This is invoked by the object system after all other entity objects on which the component depends have been initialized. If the descriptor has been initialized already, or if such a previous attempt failed, no further initialization is done. All references to the descriptor object (given by MAXON_DECLARATION) will be initialized, too.

参数
[in] cause Identifier of another entity which caused the initialization of this descriptor. This is only for informative purpose.
返回
Success of initialization.

◆  NullValue()

static const ComponentDescriptor & NullValue ( )
static

◆  ToString()

String ToString ( const FormatStatement fs = nullptr ) const

◆  GetDefinition()

const EntityDefinition& GetDefinition ( ) const

◆  GetClassProxy()

const ComponentDescriptor * GetClassProxy ( ) const

◆  GetInterfaces()

const Block <const InterfaceReference* const>& GetInterfaces ( ) const

◆  GetFlags()

EntityBase::FLAGS GetFlags ( ) const

◆  GetSize()

Int GetSize ( ) const

◆  Construct()

void Construct ( )
private

Used by the constructors to initialize function pointers and other implementation-specific values from the component implementation class C.

Template Parameters
C Implementation class of the component.

Friends And Related Function Documentation

◆  ObjectModel

friend class ObjectModel friend

◆  ObjectInterface

friend class ObjectInterface
friend

◆  PrivateSuperCallBase

friend class PrivateSuperCallBase friend

◆  ClassInfo

friend class ClassInfo friend

◆  ClassImpl

friend class ClassImpl friend

◆  VirtualInterfaceInfo

friend class VirtualInterfaceInfo friend

◆  VirtualInterfaceVersion

friend struct VirtualInterfaceVersion friend

Member Data Documentation

◆  GetDescribeIO

Result <void>(*)(const DataSerializeInterface &) GetDescribeIO() const

◆  _super

EntityDefinition _super private

Base definition object.

◆  _construct

void(* _construct(void *component) private

Constructor of component.

◆  _destruct

void(* _destruct(void *component) private

Destructor of component.

◆  _init

Result <void>(* _init(void *component)
private

Pointer for InitComponent function.

◆  _free

void(* _free(void *component) private

Pointer for FreeComponent function.

◆  _copyFrom

Result <void>(* _copyFrom(void *destComp, const void *srcObject)
private

Pointer for CopyFrom function.

◆  _constructMTable

Bool (* _constructMTable( ClassInfo *info, Int offset, void *supervtable)
private

Pointer for ConstructMTable function of component implementation class.

◆  _initImplementation

Result <void>(* _initImplementation()
private

Pointer for InitImplementation function of component implementation class.

◆  _freeImplementation

void(* _freeImplementation() private

Pointer for FreeImplementation function of component implementation class.

◆  _describeIO

Result <void>(* _describeIO(const DataSerializeInterface &)
private

This function is used to describe the component for I/O operations.

◆  _interfaces

Block <const InterfaceReference* const> _interfaces
private

The list of implemented interfaces (excluding base interfaces).

◆  _size

Int _size
private

Size of component object data.

◆  _alignment

Int _alignment
private

Alignment of component object data.

◆  _superMTableSize

Int _superMTableSize
private

Size of super-vtable of component.

◆  _hashCode

UInt _hashCode
private

Hash code of component descriptor. This will be less than ClassInfo::HASH_TABLE_SIZE.

◆  _selfPtrOffset

Int _selfPtrOffset
private

Offset of the self pointer within the component.

◆  _simpleMTableSize

Int _simpleMTableSize
private

Size of the simple method table if this component implements a simple virtual interface, 0 otherwise.

◆  _registry

Id _registry
private

Id of a registry at which this component descriptor shall be registered.

◆  _classProxy

const ComponentDescriptor * _classProxy
private

For a proxy component, this points to the corresponding class proxy component.

◆  _implementedMethods

void* _implementedMethods private

Pointer to internal information about the set of implemented methods.

◆  _supercalls

const PrivateSuperCallBase * _supercalls
mutable private

Singly-linked list of super calls which are needed by this component.