DISPATCH FACTORY()

From Lianjapedia
Jump to: navigation, search

PURPOSE

A macro to dispatch factory methods passed to the object

SYNONYM

None

SYNOPSIS

#include "lianja_api.h"
 
DISPATCH_FACTORY()
 
<input parameters>
none
 
<output parameters>
none

DESCRIPTION

The DISPATCH_FACTORY() macro is used to dispatch factory methods passed to the object. This macro should always be included at the top of each defined class. After a factory method is dispatched by this macro, execution is returned to Lianja. The Lianja engine uses these factory methods for introspection of the class.

EXAMPLE

The following example adds a DISPATCH_FACTORY() method to a class called clsMyClass.

Example Lianja script:

test = newobject("myclass")
// Introspect the object and display its properties and methods
display memory like test

Example in 'C' object:

#include "lianja_api.h"
 
DEFINE_CLASS(clsMyClass)
{
	/* Dispatch factory methods and return */
	DISPATCH_FACTORY();
 
	/* Dispatch constructor and return */
	DISPATCH_METHOD(clsMyClass, Constructor);
 
	/* Dispatch destructor and return */
	DISPATCH_METHOD(clsMyClass, Destructor);
}

SEE ALSO

DEFINE_CLASS(), DEFINE_METHOD(), DEFINE_PROPERTYGET(), DEFINE_PROPERTYSET(), 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()