API Guides > ConceptRT 3.x
DynamicInvocation/2.Macros/DynamicInvocationMacros.h

This is an example of how to use dynamic invocation macros. More details about this example.

#include "ConceptRTUtils.h"
using namespace ConceptRT;
class Machine : public IInvocable
{
PROPERTY_GET_SET(Int32, SerialNumber)
DYNAMIC_INVOCATION_PSEUDO_FIELD(_internalFlag, "InternalFlag")
DYNAMIC_INVOCATION_PSEUDO_FIELD_READONLY(_currentProcessLoadRatio, "CurrentLoadRatio")
public:
Machine()
{
SetSerialNumber(0);
_currentProcessLoadRatio = 0.0;
_internalFlag = false;
}
private:
Float64 _currentProcessLoadRatio;
bool _internalFlag;
};
class Child : public IInvocable
{
DYNAMIC_INVOCATION_METHOD_0(MethodA, "MethodA()");
DYNAMIC_INVOCATION_METHOD_1(MethodB, "MethodB(Int32 arg0)");
DYNAMIC_INVOCATION_METHOD_VOID_0(MethodC, "MethodC()");
DYNAMIC_INVOCATION_METHOD_VOID_2(MethodD, "MethodD(Int32 arg0, bool arg1)");
private:
void Method() {};
Int32 MethodA() { return 0; };
Int32 MethodB(Int32 arg0) { return 0; };
void MethodC() {};
void MethodD(Int32 arg0, bool arg1) {};
};
class Example : public IInvocable
{
PROPERTY_OBJECT(Machine, Machine)
Child Child1;
private:
Child _child2;
};