CoreComponents 3.0.0
A Modern C++ Toolkit
Loading...
Searching...
No Matches
MetaPrototype Class Reference

Member definitions, default values and child protocol More...

#include <cc/MetaPrototype>

Inheritance diagram for MetaPrototype:

Classes

struct  State
 Internal state. More...
 

Public Member Functions

 MetaPrototype (const String &className)
 Create a meta-prototype for the class className.
 
 MetaPrototype (const String &className, const MetaProtocol &protocol)
 Create a meta-prototype.
 
 MetaPrototype ()=default
 Create a null meta-prototype.
 
const MetaProtocolprotocol () const
 Children protocol: allowed types for children
 
- Public Member Functions inherited from MetaObject
 MetaObject ()=default
 Create a null meta-object.
 
 MetaObject (const String &className)
 Create meta-object of class className.
 
String className () const
 Class name
 
List< MetaObject > & children ()
 List of children
 
const List< MetaObject > & children () const
 Constant list of children
 
Map< String, Variant > & members ()
 Key-value map of object properties
 
const Map< String, Variant > & members () const
 Constant key-value map of object properties
 
bool insert (const String &name, const Variant &value)
 Convenience method to add a new member.
 
void establish (const String &name, const Variant &value)
 Convenience method to establish a new member.
 
bool contains (const String &name) const
 Convenience method to check if a member of name exists.
 
bool lookup (const String &name, Out< Variant > value) const
 Convenience method to lookup the value of member name.
 
Variant operator() (const String &name) const
 Convenience method to get the value of member name
 
Variantoperator() (const String &name)
 Convenience method to get/set the value of member name
 
long count () const
 Convenience method to get the number of children
 
const MetaObjectoperator[] (long index) const
 Convenience method to get the child at index
 
MetaObjectoperator[] (long index)
 Convenience method to get the child at index
 
MetaObject produce () const
 Produce a meta-object using this meta-object as blueprint
 
void autocomplete (InOut< MetaObject > target) const
 Add all members of this meta-object to target, which are missing in target and also append all children of this meta-object to target
 
MetaObject clone () const
 Create clone of this meta-object.
 
void realize ()
 Realize a new object after deserialization.
 
bool operator== (const MetaObject &other) const
 Compare for equality with other.
 
- Public Member Functions inherited from Object
 Object ()=default
 Create a null object.
 
 operator bool () const
 Check if this is a non-null object.
 
bool isNull () const
 Check if this is a null object.
 
template<class T >
bool is () const
 Check if this object is of type T.
 
template<class T >
as () const
 Cast this object to type T.
 
bool isWeak () const
 Check if the underlying object reference is weak.
 
bool operator== (const Object &other) const
 Equality operator.
 
std::strong_ordering operator<=> (const Object &other) const
 Ordering operator.
 
long useCount () const
 Reference count.
 

Protected Member Functions

 MetaPrototype (State *newState)
 Initialize internal state.
 
const Stateme () const
 
- Protected Member Functions inherited from MetaObject
 MetaObject (State *newState)
 Initialize internal state.
 
Stateme ()
 
const Stateme () const
 
- Protected Member Functions inherited from Object
template<class T >
weak () const
 
template<class T >
void initOnce ()
 Create the object state when called the first time.
 
template<class T >
void initOncePerThread ()
 Create a distinct object state for each thread when called the first time in that thread.
 
 Object (State *newState)
 Initialize object with newState.
 
 Object (State *state, Alias)
 
 Object (State *state, Weak)
 
Objectoperator= (std::nullptr_t)
 

Additional Inherited Members

- Static Protected Member Functions inherited from Object
template<class T >
static T alias (const State *state)
 Create an alias object for the given state.
 
template<class T >
static T weak (const State *state)
 
- Protected Attributes inherited from Object
Handle< Stateme
 Internal object state
 

Detailed Description

Member definitions, default values and child protocol

See also
MetaProtocol

Constructor & Destructor Documentation

◆ MetaPrototype() [1/4]

MetaPrototype ( const String & className)
explicit

Create a meta-prototype for the class className.

◆ MetaPrototype() [2/4]

MetaPrototype ( const String & className,
const MetaProtocol & protocol )

Create a meta-prototype.

Parameters
classNameName of the object class
protocolAllowed types for children

◆ MetaPrototype() [3/4]

MetaPrototype ( )
default

Create a null meta-prototype.

◆ MetaPrototype() [4/4]

MetaPrototype ( State * newState)
explicitprotected

Initialize internal state.

Member Function Documentation

◆ protocol()

const MetaProtocol & protocol ( ) const

Children protocol: allowed types for children