ZFFramework
|
reflectable type define More...
#include "ZFStyleable.h"
#include "ZFProgressable.h"
#include "ZFMethodUserRegister.h"
#include "ZFMethodFuncUserRegister.h"
#include "ZFMethodFuncDeclare.h"
#include "ZFObjectUtil.h"
#include "ZFSerializableUtil.h"
#include "ZFSerializableDataSerializableConverter.h"
#include "ZFObjectRetain.h"
Go to the source code of this file.
Classes | |
class | ZFTypeIdWrapper |
dummy base for all wrapper types, see ZFTypeId::Value More... | |
Macros | |
#define | ZFTYPEID_DECLARE(ZFLIB_, TypeName, Type) |
register a type | |
#define | ZFTYPEID_DECLARE_WITH_CUSTOM_WRAPPER(ZFLIB_, TypeName, Type) |
declare a type id with custom type wrapper | |
#define | ZFTYPEID_DEFINE(TypeName, Type, serializeFromAction, serializeToAction, convertFromStringAction, convertToStringAction) |
see ZFTYPEID_DECLARE | |
#define | ZFTYPEID_DEFINE_WITH_CUSTOM_WRAPPER(TypeName, Type, serializeFromAction, serializeToAction, convertFromStringAction, convertToStringAction) |
see ZFTYPEID_DECLARE | |
#define | ZFTYPEID_DEFINE_BY_STRING_CONVERTER(TypeName, Type, convertFromStringAction, convertToStringAction) |
see ZFTYPEID_DECLARE | |
#define | ZFTYPEID_DEFINE_BY_STRING_CONVERTER_WITH_CUSTOM_WRAPPER(TypeName, Type, convertFromStringAction, convertToStringAction) |
see ZFTYPEID_DECLARE | |
#define | ZFTYPEID_DEFINE_BY_SERIALIZABLE_CONVERTER(TypeName, Type, serializeFromAction, serializeToAction) |
see ZFTYPEID_DECLARE | |
#define | ZFTYPEID_DEFINE_BY_SERIALIZABLE_CONVERTER_WITH_CUSTOM_WRAPPER(TypeName, Type, serializeFromAction, serializeToAction) |
see ZFTYPEID_DECLARE | |
#define | ZFTYPEID_ACCESS_ONLY_DECLARE(ZFLIB_, TypeName, Type) |
declare a type that reflectable and accessable, but not serializable | |
#define | ZFTYPEID_ACCESS_ONLY_DEFINE(TypeName, Type) |
see ZFTYPEID_ACCESS_ONLY_DECLARE | |
#define | ZFTYPEID_ACCESS_ONLY_DEFINE_UNCOMPARABLE(TypeName, Type) |
see ZFTYPEID_ACCESS_ONLY_DECLARE | |
#define | ZFTYPEID_ALIAS_DECLARE(ZFLIB_, AliasToTypeName, AliasToType, TypeName, Type) |
alias an existing type to another type, see ZFTYPEID_DECLARE | |
#define | ZFTYPEID_ALIAS_DEFINE(AliasToTypeName, AliasToType, TypeName, Type) |
see ZFTYPEID_ALIAS_DECLARE | |
#define | ZFTYPEID_ALIAS_DECLARE_CUSTOM(ZFLIB_, AliasToTypeName, AliasToType, TypeName, Type, TypeIdValueConversion) |
see ZFTYPEID_ALIAS_DECLARE | |
#define | ZFTYPEID_DISABLE(Type) |
explicitly mark the type can not be reflected when used in ZFMETHOD_INLINE_0 or ZFPROPERTY_ASSIGN | |
#define | ZFTYPEID_PROGRESS_DEFINE(TypeName, Type, progressUpdateAction) |
register Type's progress update logic | |
#define | ZFTYPEID_PROGRESS_DEFINE_BY_VALUE(TypeName, Type) |
util macro to declare ZFTYPEID_PROGRESS_DEFINE by raw value calculating | |
reflectable type define
#define ZFTYPEID_DECLARE | ( | ZFLIB_, | |
TypeName, | |||
Type ) |
register a type
usually for implementation use only, ZFFramework would supply most of the types, however you may use this to register your own types
typical code to register a type:
once registered, your type can be used as ZFPROPERTY_ASSIGN which benefits from the powerful automatic serialization logic, or, can be used as reflectable param or return type for ZFMETHOD_INLINE_0
ADVANCED:
#define ZFTYPEID_DECLARE_WITH_CUSTOM_WRAPPER | ( | ZFLIB_, | |
TypeName, | |||
Type ) |
declare a type id with custom type wrapper
by default, all of your type should be registered by ZFTYPEID_DECLARE series, for some special case, you may need to register your type manually, to achieve this, you must:
#define ZFTYPEID_ACCESS_ONLY_DECLARE | ( | ZFLIB_, | |
TypeName, | |||
Type ) |
declare a type that reflectable and accessable, but not serializable
by default, all return types and method types in ZFMethod must be registered by ZFTYPEID_DECLARE for advanced reflection logic
if you simply want basic method declaration, you may use this macro to disable your type explicitly
see ZFTYPEID_DECLARE for more info
#define ZFTYPEID_ALIAS_DECLARE | ( | ZFLIB_, | |
AliasToTypeName, | |||
AliasToType, | |||
TypeName, | |||
Type ) |
alias an existing type to another type, see ZFTYPEID_DECLARE
the original type must be declared by ZFTYPEID_DECLARE or ZFTYPEID_ACCESS_ONLY_DECLARE
the newly aliased type would share same type id, serializable converter and string converter, with the original exist one
see ZFTYPEID_DECLARE for more info
which would cause bad performance during reflection
if performance matters, you should consider supply custom type id specializations (by ZFTYPEID_ALIAS_DECLARE_CUSTOM), or, prevent to use aliased type for reflectable method
#define ZFTYPEID_ALIAS_DECLARE_CUSTOM | ( | ZFLIB_, | |
AliasToTypeName, | |||
AliasToType, | |||
TypeName, | |||
Type, | |||
TypeIdValueConversion ) |
the TypeIdValueConversion must supply as macro expansion with these proto type:
#define ZFTYPEID_DISABLE | ( | Type | ) |
explicitly mark the type can not be reflected when used in ZFMETHOD_INLINE_0 or ZFPROPERTY_ASSIGN
by default, all return types and method types in ZFMethod must be registered by ZFTYPEID_DECLARE for advanced reflection logic
if you simply want basic method declaration, you may use this macro to disable your type explicitly
see ZFTYPEID_DECLARE for more info
#define ZFTYPEID_PROGRESS_DEFINE | ( | TypeName, | |
Type, | |||
progressUpdateAction ) |
register Type's progress update logic
a progress update means, the type can be changed by timeline by supply a "from/to" value range
for example, an float type with range "[0.5, 3.0]" and progress "0.3", would result "0.5 + (3.0 - 0.5) * 0.3", which is 1.25
this is useful to make a property change with animation
to use this, register your type by this macro, with this proto type:
then use them by ZFProgressable::progressUpdate
to register:
or use ZFTYPEID_PROGRESS_DEFINE_BY_VALUE for short