All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
kanzi::Metaclass Class Referenceabstract

Metaclass provides type inspection mechanism for Kanzi classes. More...

#include <kanzi/object/metaclass.hpp>

Inheritance diagram for kanzi::Metaclass:
kanzi::MetaclassAbstractImpl< TClass > kanzi::MetaclassImpl< TClass > kanzi::MetaclassStaticImpl< TClass >

Public Types

typedef
MetaclassContainer::const_iterator 
MetaclassIterator
 
typedef
PropertyTypeContainer::const_iterator 
PropertyTypeIterator
 
typedef
MessageTypeContainer::const_iterator 
MessageTypeIterator
 

Public Member Functions

virtual bool isMetaclassOf (const Object &object) const =0
 Checks whether this metaclass describes the class of an object instance. More...
 
virtual shared_ptr< Objectcreate (Domain *domain, string_view name) const =0
 
template<typename Type >
shared_ptr< Type > create (Domain *domain, string_view name) const
 Creates the instance of a class this metaclass describes. More...
 
bool isAbstract () const
 Returns true if the class described by the metaclass is abstract, false otherwise. More...
 
bool isSealed () const
 Internal function. More...
 
void seal ()
 Internal function. More...
 
const MetaclassgetBase () const
 Returns the metaclass of the base class. More...
 
bool isDerivedFrom (const Metaclass *metaclass) const
 Determines whether the class this metaclass describes derives from a class described by specified metaclass. More...
 
void addPropertyType (AbstractPropertyType propertyType)
 
void addMessageType (AbstractMessageType messageType)
 
void addNestedMetaclass (const Metaclass *metaclass)
 
void addMixin (const Metaclass *metaclass)
 
MetaclassIterator beginNestedMetaclasses () const
 
MetaclassIterator endNestedMetaclasses () const
 
MetaclassIterator beginMixinMetaclasses () const
 
MetaclassIterator endMixinMetaclasses () const
 
PropertyTypeIterator beginPropertyTypes () const
 
PropertyTypeIterator endPropertyTypes () const
 
MessageTypeIterator beginMessageTypes () const
 
MessageTypeIterator endMessageTypes () const
 
string getName () const
 
void setEditorInfo (PropertyTypeEditorInfoSharedPtr editorInfo)
 
PropertyTypeEditorInfoSharedPtr getEditorInfo () const
 

Protected Member Functions

 Metaclass (const Metaclass *baseClass, string_view name)
 
 ~Metaclass ()
 
void checkSealed () const
 
void setAbstract ()
 

Friends

class ObjectFactory
 

Detailed Description

Metaclass provides type inspection mechanism for Kanzi classes.

Classes deriving from Object can register information about their type, properties, messages by using Metaclass and accompanying macros. Such information is used by serialization, scripting and to display friendly type information in Kanzi Studio.

Use KZ_METACLASS_BEGIN and KZ_METACLASS_END inside your class body to declare a metaclass. Serialization and functions instantiating objects use metaclass name to identify types. Use KZ_METACLASS_PROPERTY_TYPE to register a property type of your class to the metaclass. Use KZ_METACLASS_MESSAGE_TYPE to register a message type of your class to the metaclass.

Member Typedef Documentation

typedef MetaclassContainer::const_iterator kanzi::Metaclass::MetaclassIterator
typedef PropertyTypeContainer::const_iterator kanzi::Metaclass::PropertyTypeIterator
typedef MessageTypeContainer::const_iterator kanzi::Metaclass::MessageTypeIterator

Constructor & Destructor Documentation

kanzi::Metaclass::Metaclass ( const Metaclass baseClass,
string_view  name 
)
inlineexplicitprotected
kanzi::Metaclass::~Metaclass ( )
inlineprotected

Member Function Documentation

virtual bool kanzi::Metaclass::isMetaclassOf ( const Object object) const
pure virtual

Checks whether this metaclass describes the class of an object instance.

Implemented in kanzi::MetaclassStaticImpl< TClass >, kanzi::MetaclassAbstractImpl< TClass >, and kanzi::MetaclassImpl< TClass >.

virtual shared_ptr<Object> kanzi::Metaclass::create ( Domain domain,
string_view  name 
) const
pure virtual
template<typename Type >
shared_ptr<Type> kanzi::Metaclass::create ( Domain domain,
string_view  name 
) const
inline

Creates the instance of a class this metaclass describes.

bool kanzi::Metaclass::isAbstract ( ) const
inline

Returns true if the class described by the metaclass is abstract, false otherwise.

bool kanzi::Metaclass::isSealed ( ) const
inline

Internal function.

void kanzi::Metaclass::seal ( )
inline

Internal function.

const Metaclass* kanzi::Metaclass::getBase ( ) const
inline

Returns the metaclass of the base class.

bool kanzi::Metaclass::isDerivedFrom ( const Metaclass metaclass) const
inline

Determines whether the class this metaclass describes derives from a class described by specified metaclass.

void kanzi::Metaclass::addPropertyType ( AbstractPropertyType  propertyType)
inline
void kanzi::Metaclass::addMessageType ( AbstractMessageType  messageType)
inline
void kanzi::Metaclass::addNestedMetaclass ( const Metaclass metaclass)
inline
void kanzi::Metaclass::addMixin ( const Metaclass metaclass)
inline
MetaclassIterator kanzi::Metaclass::beginNestedMetaclasses ( ) const
inline
MetaclassIterator kanzi::Metaclass::endNestedMetaclasses ( ) const
inline
MetaclassIterator kanzi::Metaclass::beginMixinMetaclasses ( ) const
inline
MetaclassIterator kanzi::Metaclass::endMixinMetaclasses ( ) const
inline
PropertyTypeIterator kanzi::Metaclass::beginPropertyTypes ( ) const
inline
PropertyTypeIterator kanzi::Metaclass::endPropertyTypes ( ) const
inline
MessageTypeIterator kanzi::Metaclass::beginMessageTypes ( ) const
inline
MessageTypeIterator kanzi::Metaclass::endMessageTypes ( ) const
inline
string kanzi::Metaclass::getName ( ) const
inline
void kanzi::Metaclass::setEditorInfo ( PropertyTypeEditorInfoSharedPtr  editorInfo)
inline
PropertyTypeEditorInfoSharedPtr kanzi::Metaclass::getEditorInfo ( ) const
inline
void kanzi::Metaclass::checkSealed ( ) const
protected
void kanzi::Metaclass::setAbstract ( )
inlineprotected

Friends And Related Function Documentation

friend class ObjectFactory
friend

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