#include <falcon/setup.h>
Go to the source code of this file.
Namespaces | |
namespace | Falcon |
CONST. | |
Defines | |
#define | FALCON_REFLECT_INTEGER_FROM(obj, accessor) property = (int64) obj->accessor();\ |
Little macro to automatize reflection of integers. | |
#define | FALCON_REFLECT_INTEGER_TO(obj, accessor) |
Little macro to automatize reflection of integers. | |
#define | FALCON_REFLECT_STRING_FROM(obj, accessor) |
Little macro to automatize reflection of strings. | |
#define | FALCON_REFLECT_STRING_TO(obj, accessor) |
Little macro to automatize reflection of strings. | |
Typedefs | |
typedef void(* | Falcon::reflectionFunc )(CoreObject *instance, void *user_data, Item &property, const PropEntry &entry) |
Callback function for reflective properties needing complete reflection. | |
typedef void | Falcon::reflectionFuncDecl (CoreObject *instance, void *user_data, Item &property, const PropEntry &entry) |
Enumerations | |
enum | Falcon::t_reflection { Falcon::e_reflectNone = 0, Falcon::e_reflectBool, Falcon::e_reflectByte, Falcon::e_reflectChar, Falcon::e_reflectShort, Falcon::e_reflectUShort, Falcon::e_reflectInt, Falcon::e_reflectUInt, Falcon::e_reflectLong, Falcon::e_reflectULong, Falcon::e_reflectLL, Falcon::e_reflectULL, Falcon::e_reflectFloat, Falcon::e_reflectDouble, Falcon::e_reflectFunc, Falcon::e_reflectSetGet } |
Reflection type enumeration. More... |
#define FALCON_REFLECT_INTEGER_FROM | ( | obj, | |||
accessor | ) | property = (int64) obj->accessor();\ |
Little macro to automatize reflection of integers.
obj | the object (pointer) containing the string to be reflected. | |
accessor | the name of the accessor used to read the variable. |
#define FALCON_REFLECT_INTEGER_TO | ( | obj, | |||
accessor | ) |
Value:
if ( ! property.isOrdinal() ) {\ throw new ParamError( ErrorParam( e_inv_params ).extra( "N" ) );\ }\ obj->accessor( (uint32) property.forceInteger() );\
obj | the object (pointer) containing the string to be reflected. | |
accessor | the name of the accessor used to read the variable. |
#define FALCON_REFLECT_STRING_FROM | ( | obj, | |||
accessor | ) |
Value:
if( ! property.isString() )\ property = new CoreString( obj->accessor() );\ else\ property.asString()->bufferize( obj->accessor() );
This is not a very clean programming technique, but is effective. Used inside a reflectionFunc with parameters named as the standard one (i.e. as those provided in the function declaration), it is able to correctly reflect a string property into an object which provides an accessor to a Falcon::String.
The macro raises a standard parameter error if the property is not a string during setting, and checks for the property being unchanged before resetting it to a new string during reading. As it raises a ParamError, proper .h files (falcon/error.h) must be included.
Used mainly by the engine, users may find it useful.
obj | the object (pointer) containing the string to be reflected. | |
accessor | the name of the accessor used to read the variable. |
#define FALCON_REFLECT_STRING_TO | ( | obj, | |||
accessor | ) |
Value:
if ( ! property.isString() ) {\ throw new ParamError( ErrorParam( e_inv_params ).extra( "S" ) );\ }\ obj->accessor( *property.asString() );\
This stores the data coming from the engine into the object via an accessor.
Used mainly by the engine, users may find it useful.
obj | the object (pointer) containing the string to be reflected. | |
accessor | the name of the accessor used to read the variable. |