/***********************************************************************
THIS FILE IS AUTOMATICALLY GENERATED. DO NOT MODIFY
DEVELOPER: Zihan Chen(vczh)
***********************************************************************/
#include "VlppOS.h"
#include "Vlpp.h"
#include "VlppRegex.h"
/***********************************************************************
.\DESCRIPTABLEOBJECT.H
***********************************************************************/
/***********************************************************************
Author: Zihan Chen (vczh)
Licensed under https://github.com/vczh-libraries/License
***********************************************************************/
#ifndef VCZH_REFLECTION_DESCRIPTABLEOBJECT
#define VCZH_REFLECTION_DESCRIPTABLEOBJECT
#if (defined VCZH_DEBUG_NO_REFLECTION) && (defined VCZH_DEBUG_METAONLY_REFLECTION)
static_assert(false, "Preprocessor VCZH_DEBUG_NO_REFLECTION and VCZH_DEBUG_METAONLY_REFLECTION could not be defined at the same time.")
#endif
#if !(defined VCZH_DEBUG_NO_REFLECTION) && !(defined VCZH_DEBUG_METAONLY_REFLECTION)
#define VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
#endif
namespace vl
{
namespace reflection
{
namespace description
{
class ITypeDescriptor;
}
/***********************************************************************
DescriptableObject
***********************************************************************/
///
/// Base class of all reflectable value types (class).
/// If you want to create a reflectable class, you should inherit from [T:vl.reflection.Description`1].
///
/// Inheriting from [T:vl.reflection.Description`1] is necessary even if you turned on "VCZH_DEBUG_NO_REFLECTION" preprocessor definition.
/// In this case, some members will be removed from this class to reduce the object size.
///
/// Ptr<DescriptableObject> is recommended to replace Ptr<Object> for holding a reflectable object.
/// When a class T inherits from [T:vl.reflection.Description`1], including DescriptableObject itself,
/// Ptr<T> is safe to be created directly from a T* hold by another Ptr<T>.
/// This is not allowed for all classes that do not inherit from [T:vl.reflection.Description`1].
///
/// When a class in Workflow script inherits from a class in C++,
/// since it is not possible to actually create a class in runtime,
/// so the created object from this Workflow class is multiple DescriptableObject grouping together.
///
/// This is called aggregation.
///
/// In this case,
/// To allow a C++ class to be aggregated,
/// use [T:vl.reflection.AggregatableDescription`1] instead of [T:vl.reflection.Description`1],
/// and call Get the type descriptor that describe the real type of this object. Only available when VCZH_DEBUG_NO_REFLECTION is off.
/// The order does not matter, because content of types are lazily loaded. ///
////// Everything below should be put in vl::reflection::description namespaces. ///
/// class: /// It doesn't necessary mean a class in C++. /// Classes in reflection and Workflow script mean reference types. ///
////// Here are all macros that register content of classes ///
/// (), NO_PARAMETER)
///
/// // 05) Constructor with arguments.
/// CLASS_MEMBER_CONSTRUCTOR(Ptr
/// If the code compiles, the class should look like this:
///
/// {
/// public:
/// MyClass();
/// MyClass(int numberParameter, const WString& stringParameter);
///
/// int MyFunction1();
/// int MyFunction2(int parameter1, const WString& parameter2);
/// int MyFunction3();
/// int MyFunction3(int parameter);
/// int MyFunction3(int parameter1, const WString& parameter2);
///
/// static int MyFunction4();
/// static int MyFunction5(int parameter1, const WString& parameter2);
/// static int MyFunction6();
/// static int MyFunction6(int parameter);
/// static int MyFunction6(int parameter1, const WString& parameter2);
///
/// Event
/// interface: /// A C++ class can be registered as a reflectable interface if: ///
/// Suppose you have an interface like this:
///
/// {
/// public:
/// int GetX();
/// void SetX(int value);
/// };
/// ]]>
/// If you want to allow a Workflow script class implement this interface, you should first add a proxy like this:
///
/// And then use this code to register the interface:
///
/// Everything else is the same as registering classes. /// Use BEGIN_INTERFACE_MEMBER_NOPROXY to register an interface without a proxy, /// which means a Workflow script class cannot implement this interface. ///
///AddTypeLoader(new MyTypeLoader);
/// ]]>Only available when VCZH_DEBUG_NO_REFLECTION is off.
///Only available when VCZH_DEBUG_NO_REFLECTION is off.
///Only available when VCZH_DEBUG_NO_REFLECTION is off.
///Only available when VCZH_DEBUG_NO_REFLECTION is off.
///Only available when VCZH_DEBUG_NO_REFLECTION is off.
///Only available when VCZH_DEBUG_NO_REFLECTION is off.
///Only available when VCZH_DEBUG_NO_REFLECTION is off.
///Only available when VCZH_DEBUG_NO_REFLECTION is off.
///Only available when VCZH_DEBUG_NO_REFLECTION is off.
///Only available when VCZH_DEBUG_NO_REFLECTION is off.
///Only available when VCZH_DEBUG_NO_REFLECTION is off.
///Only available when VCZH_DEBUG_NO_REFLECTION is off.
///Only available when VCZH_DEBUG_NO_REFLECTION is off.
///
/// This function is similar to
/// This function is very useful for unit testing. /// In each test case, you can first register all types, /// and after the test case is finished, call this function to reset all types. /// You can do this again and again in the other test cases, /// so that these test cases don't affect each other. ///
///Methods are the same to
/// When an item is being inserted to the list, /// QueryInsert will be called to determine if this item can be inserted, /// BeforeInsert will be called before inserting, /// AfterInsert will be called after inserting. ///
////// When an item is being removed from the list, /// QueryRemove will be called to determine if this item can be removed, /// BeforeRemove will be called before removing, /// AfterRemove will be called after removing. ///
////// When an item is being replaced, it is considered as removing the original item and inserting the new item. ///
///
/// After any changing happens, NotifyUpdateInternal is called.
/// Arguments is exactly the same as
/// This is useful when the container is not actually changed, but data in some items are changed. /// For example, in an observable list of shared pointers, /// properties of elements are changed does not trigger callbacks because it doesn't change pointers in the list. ///
////// If subscribers need to know about such change, calling this function is an easy way to do it. ///
///Event that is triggered whenever items are changed.
///The first argument is the index of the first item that is changed.
///The second argument is the number of original items that are replaced by new items.
///The third argument is the number of new items that replace original items.
///If an item is changed, oldCount and newCount are both 1.
///If several items are removed from the list, newCount is 0.
///If several items are inserted to the list, oldCount is 0.
///This event is triggered when the updating is done, original items are not possible to access at the moment.
///