OBJECT GETDATA()

From Recital Documentation Wiki
Jump to: navigation, search

PURPOSE

Return a pointer to a user defined data area


SYNONYM

None


SYNOPSIS

#include "dbapi.h"
 
OBJECT_GETDATA()
 
<input parameters>
None
 
<output parameters>
none


DESCRIPTION

The OBJECT_GETDATA() macro is used to return a pointer to a user defined data area in an instantiated object. This function returns the data area from the method's associated object.


EXAMPLE

The following example gets the data area from an object instantiated from the class clsMyClass. The object is passed with the DISPATCH_PROPERTYGET() macro.

Example Recital program:

test = newobject("myclass")
? test.numvalue

Example in 'C' object:

#include "dbapi.h"
 
/* Define get property method */
DEFINE_PROPERTYGET(clsMyClass, NumValue)
{
	struct example_data *objectData = (struct example_data *)OBJECT_GETDATA();
 
	if (objectData == NULL) return(-1);
 
	OBJECT_RETPROPERTY('N', objectData->prop_numvalue);
}


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_GETOBJECT(), OBJECT_GETPARAMETER(), OBJECT_GETPROPERTY(), OBJECT_GETTYPE(), OBJECT_GETVALUE(), OBJECT_NEW(), OBJECT_RETERROR(), OBJECT_RETPROPERTY(), OBJECT_RETRESULT(), OBJECT_SETARG(), OBJECT_SETDATA(), OBJECT_SETPROPERTY()