C12Adapter Opensource C++ Interface
|
Root object that establishes dynamic class information, dynamic property and method handling and marshaling. More...
Public Member Functions | |
virtual | ~MObject () |
Object destructor. | |
virtual const MClass * | GetClass () const =0 |
Get the final class of the object. More... | |
virtual unsigned | GetEmbeddedSizeof () const |
For embedded object types, return the size of the class. More... | |
bool | IsEmbeddedObject () const |
Tell if the object is of embedded kind. More... | |
SHOW_INTERNAL MVariant | Call (const MStdString &name, const MVariant ¶ms) |
Call the object service with parameters, given as variant. More... | |
MVariant | Call0 (const MStdString &name) |
Call the object service with no parameters. More... | |
MVariant | Call1 (const MStdString &name, const MVariant &p1) |
Call the object service with one parameter. More... | |
MVariant | Call2 (const MStdString &name, const MVariant &p1, const MVariant &p2) |
Call the object service with two parameter. More... | |
MVariant | Call3 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3) |
Call the object service with three parameter. More... | |
MVariant | Call4 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3, const MVariant &p4) |
Call the object service with four parameter. More... | |
MVariant | Call5 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3, const MVariant &p4, const MVariant &p5) |
Call the object service with five parameter. More... | |
MVariant | Call6 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3, const MVariant &p4, const MVariant &p5, const MVariant &p6) |
Call the object service with six parameter. More... | |
virtual MVariant | CallV (const MStdString &name, const MVariant::VariantVector ¶ms) |
Call the object service with parameters, given as variant vector. More... | |
virtual bool | IsPropertyPresent (const MStdString &name) const |
Tell if the property with the given name exists. | |
virtual bool | IsServicePresent (const MStdString &name) const |
Tell if the service with the given name exists. | |
virtual MVariant | GetProperty (const MStdString &name) const |
Get the property value using name of the property. More... | |
virtual void | SetProperty (const MStdString &name, const MVariant &value) |
Set the property using name of the property, and value. More... | |
virtual MStdStringVector | GetAllPropertyNames () const |
Return the list of publicly available properties, persistent or not. More... | |
virtual MStdStringVector | GetAllPersistentPropertyNames () const |
Return the list of persistent properties. More... | |
virtual void | SetPersistentPropertiesToDefault () |
Set the persistent properties of the object to their default values. More... | |
virtual MVariant | GetPersistentPropertyDefaultValue (const MStdString &name) const |
Get the default value of persistent property with the name given. More... | |
virtual void | SetPersistentPropertyToDefault (const MStdString &name) |
Set the persistent property with the name given to default value. More... | |
virtual const char * | GetType () const |
Get the name of the type for the object (could be the same as class name). | |
virtual void | SetType (const MStdString &) |
Intentionally, it will set the name of the type for the object, but the service will not allow setting the name to anything other than the current name. More... | |
virtual void | Validate () |
Validate internal structures of the object. More... | |
Static Public Member Functions | |
static const MClass * | GetStaticClass () |
Get the declared class of this particular object. More... | |
static bool | IsClassPresent (const MStdString &name) |
Tells if the given class name is available. More... | |
Static Public Attributes | |
static const MClass | s_class |
Class of MObject. | |
Protected Member Functions | |
MObject () | |
Object constructor, protected as the class is abstract. | |
void | DoSetPersistentPropertiesToDefault (const MClass *staticClass) |
Set the persistent properties to their default values for one object provided the class for that object. More... | |
Root object that establishes dynamic class information, dynamic property and method handling and marshaling.
The class is an abstract base.
The derived objects have type names available from the abstract service GetType.
This class allows for having a number of properties and methods to be publicly defined, and available through their names. This is done by implementation of the the dynamic dispatching mechanism alternative to the semi-static virtual C++ dispatching.
The children of this class should have a macro M_DECLARE_*_CLASS at the end of their declaration, and a set of M_PROPERTY_ macros in the implementation CPP file. They should define the properties publicly available.
Here is an example of some MObject abstract child:
Here is an example of some MObject child:
The _EXACT class declarations do not add M prefix to their names given. The _TYPED class declarations make type and class names different for the class definition.
There is one property defined for the class. This is TYPE, which gives the standard string, representation of the type (class).
SHOW_INTERNAL MVariant MObject::Call | ( | const MStdString & | name, |
const MVariant & | params | ||
) |
Call the object service with parameters, given as variant.
Parameters can be Empty variant, which will mean no parameters; a variant vector, which will be the vector of parameters; or it can be one single parameter.
MVariant MObject::Call0 | ( | const MStdString & | name | ) |
Call the object service with no parameters.
MVariant MObject::Call1 | ( | const MStdString & | name, |
const MVariant & | p1 | ||
) |
Call the object service with one parameter.
The clients have to provide CallV as implementation.
MVariant MObject::Call2 | ( | const MStdString & | name, |
const MVariant & | p1, | ||
const MVariant & | p2 | ||
) |
Call the object service with two parameter.
The clients have to provide CallV as implementation.
MVariant MObject::Call3 | ( | const MStdString & | name, |
const MVariant & | p1, | ||
const MVariant & | p2, | ||
const MVariant & | p3 | ||
) |
Call the object service with three parameter.
The clients have to provide CallV as implementation.
MVariant MObject::Call4 | ( | const MStdString & | name, |
const MVariant & | p1, | ||
const MVariant & | p2, | ||
const MVariant & | p3, | ||
const MVariant & | p4 | ||
) |
Call the object service with four parameter.
The clients have to provide CallV as implementation.
MVariant MObject::Call5 | ( | const MStdString & | name, |
const MVariant & | p1, | ||
const MVariant & | p2, | ||
const MVariant & | p3, | ||
const MVariant & | p4, | ||
const MVariant & | p5 | ||
) |
Call the object service with five parameter.
The clients have to provide CallV as implementation.
MVariant MObject::Call6 | ( | const MStdString & | name, |
const MVariant & | p1, | ||
const MVariant & | p2, | ||
const MVariant & | p3, | ||
const MVariant & | p4, | ||
const MVariant & | p5, | ||
const MVariant & | p6 | ||
) |
Call the object service with six parameter.
The clients have to provide CallV as implementation.
|
virtual |
Call the object service with parameters, given as variant vector.
Reimplemented in MAutomation.
|
protected |
Set the persistent properties to their default values for one object provided the class for that object.
This service is for calling it from constructors. A typical parameter is the static class of the object. The parameters for the parent properties are not touched. This is not a virtual service!
staticClass | Pointer to a class of this object, typically m_class |
|
virtual |
Return the list of persistent properties.
Reimplemented in MCOMObject.
|
virtual |
Return the list of publicly available properties, persistent or not.
Reimplemented in MCOMObject.
|
pure virtual |
Get the final class of the object.
Do not overload this service explicitly. It is done automatically within the appropriate implementation macros.
|
virtual |
For embedded object types, return the size of the class.
For regular, not embedded types, this is zero, which is the default implementation.
Reimplemented in MTime, MVersion, MTimeRecurrentYearly, MTimeSpan, MGuid, and MTimer.
|
virtual |
Get the default value of persistent property with the name given.
|
virtual |
Get the property value using name of the property.
The service allows extensions in children objects.
Reimplemented in MAutomation.
|
inlinestatic |
Get the declared class of this particular object.
This service is defined explicitly with the reflection support macros.
|
inlinestatic |
Tells if the given class name is available.
The call uses the reflection mechanism to tell if the class name exists
name | Class name to test |
|
inline |
Tell if the object is of embedded kind.
Embedded objects are value types, those that can be copied and compared by simple memory copy and comparison.
|
virtual |
Set the persistent properties of the object to their default values.
Also look at DoSetPersistentPropertiesToDefault that is typically used in constructors of MObject parents that have persistent properties.
|
virtual |
Set the persistent property with the name given to default value.
If the persistent property does exist, the error never results from setting the value to this property, as it is the duty of the application developer to ensure that the value is correct (the assertion is in place for debug version).
|
virtual |
Set the property using name of the property, and value.
The service allows extensions in children objects.
Reimplemented in MAutomation.
|
virtual |
Intentionally, it will set the name of the type for the object, but the service will not allow setting the name to anything other than the current name.
|
virtual |
Validate internal structures of the object.