SDK Overview of Level 4

From Recital Documentation Wiki
Revision as of 12:57, 27 March 2009 by Yvonnemilne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

SEE ALSO

DEFINE_CLASS(), DEFINE_METHOD(), DEFINE_PROPERTYGET(), DEFINE_PROPERTYSET(), DISPATCH_FACTORY(), DISPATCH_METHOD(), DISPATCH_PROPGET(), DISPATCH_PROPSET(), OBJECT_ASSIGN(), OBJECT_DELETE(), OBJECT_GETARG(), OBJECT_GETARGC(), OBJECT_GETDATA(), OBJECT_GETOBJECT(), OBJECT_GETPARAMETER(), OBJECT_GETPROPERTY(), OBJECT_GETTYPE(), OBJECT_GETVALUE(), OBJECT_NEW(), OBJECT_RETERROR(), OBJECT_RETPROPERTY(), OBJECT_RETRESULT(), OBJECT_SETARG(), OBJECT_SETDATA(), OBJECT_SETPROPERTY()


Macros

Level 4 DEFINE_XXX macros are used for defining classes and their associated methods that can be instantiated from the Recital 4GL. The DISPATCH_XXX macros are used to dispatch method calls in an OBJARG format to the specified methods. The OBJECT_XXX macros are use to access and return values passed to and from the object.


OBJARG

The OBJARG format is stored in a string in the format "X:ASCII" where 'X' can be any one of the following:


TYPE DESCRIPTION
E Error
C Character
N Numeric
L Logical
D Date
T Datetime
Y Currency
O Object


OBJPTR

This macro is the pointer to an instantiated object defined by the class.


Object Data Structures

Public properties and methods need to be defined a structure for introspection called public_properties and public_methods. The structures are in an OBJARG format except for the last item which must be defined as an empty string. The string part of the OBJARG is defined as "Name;Type;Description", for example:


static	char	*public_properties[] = {
	"C:CHARVALUE;C;Character property value",
	"C:NUMVALUE;N;Numeric property value",
	"C:LOGVALUE;L;Logical property value",
	"C:DATEVALUE;D;Date property value",
	"C:TIMEVALUE;T;DateTime property value",
	"C:CURRVALUE;Y;Currency property value",
	"C:OBJVALUE;O;Object property value", "",
};
 
static	char	*public_methods[] = {
	"C:DEFINE;L;Define settings in exception",
	"",
};


Return codes

The macros OBJECT_ERROR and OBJECT_SUCCESS are defined to be used to return the result of a method call.