Difference between revisions of "SDK Overview of Level 4"

From Recital Documentation Wiki
Jump to: navigation, search
m (Overview of Level 4 moved to SDK Overview of Level 4)
 
(No difference)

Latest revision as of 14:15, 30 March 2009

Level 4 Functions

Function level 4 Description
DEFINE_CLASS() Define a class
DEFINE_PROPERTYGET() Define a get property
DEFINE_PROPERTYSET() Define a set property
DEFINE_METHOD() Define a method
DISPATCH_FACTORY() Dispatch a factory method
DISPATCH_PROPGET() Dispatch a get property
DISPATCH_PROPSET() Dispatch a set property
DISPATCH_METHOD() Dispatch a method
OBJECT_ASSIGN() Assign a new object
OBJECT_DELETE() Delete an existing object
OBJECT_GETARG() Get argument value
OBJECT_GETARGC() Get the number of arguments
OBJECT_GETDATA() Get object's data area
OBJECT_GETOBJECT() Get an object
OBJECT_GETPARAMETER() Get parameter value
OBJECT_GETPROPERTY() Get property value
OBJECT_GETTYPE() Get parameter type
OBJECT_GETVALUE() Get value to set property to
OBJECT_NEW() Create a new object
OBJECT_RETERROR() Return error
OBJECT_RETPROPERTY() Return property value
OBJECT_RETRESULT() Return the value of a result
OBJECT_SETARG() Set argument value
OBJECT_SETDATA() Set object's data area
OBJECT_SETPROPERTY() Set property value


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.