CoreComponents 3.0.0
A Modern C++ Toolkit
|
Member definitions, default values and child protocol More...
#include <cc/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 MetaProtocol & | protocol () 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 | |
Variant & | operator() (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 MetaObject & | operator[] (long index) const |
Convenience method to get the child at index | |
MetaObject & | operator[] (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 > | |
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 State & | me () const |
Protected Member Functions inherited from MetaObject | |
MetaObject (State *newState) | |
Initialize internal state. | |
State & | me () |
const State & | me () const |
Protected Member Functions inherited from Object | |
template<class T > | |
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) | |
Object & | operator= (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< State > | me |
Internal object state | |
Member definitions, default values and child protocol
|
explicit |
Create a meta-prototype for the class className.
MetaPrototype | ( | const String & | className, |
const MetaProtocol & | protocol ) |
Create a meta-prototype.
className | Name of the object class |
protocol | Allowed types for children |
|
default |
Create a null meta-prototype.
|
explicitprotected |
Initialize internal state.
const MetaProtocol & protocol | ( | ) | const |
Children protocol: allowed types for children