Main Page | Modules | Data Structures

Irmo Method Call Interface


Typedefs

typedef _IrmoMethodData IrmoMethodData
 Method Callback Data.

typedef void(* IrmoInvokeCallback )(IrmoMethodData *data, void *user_data)
 Callback function for methods.


Functions

IrmoCallbackirmo_world_method_watch (IrmoWorld *world, char *method_name, IrmoInvokeCallback method, void *user_data)
 Set a callback function to be invoked when a method is called.

char * irmo_method_arg_string (IrmoMethodData *data, char *argname)
 Retrieve a method argument.

unsigned int irmo_method_arg_int (IrmoMethodData *data, char *argname)
 Retrieve a method argument.

IrmoClientirmo_method_get_source (IrmoMethodData *data)
 Find the client which invoked a method.

void irmo_world_method_call (IrmoWorld *world, char *method,...)
 Call a method.

void irmo_world_method_call2 (IrmoWorld *world, char *method, IrmoValue *arguments)
 Call a method.


Detailed Description

Method calls can be defined and invoked on IrmoWorld objects. Callback functions can be set to be called when methods are invoked. The methods and their arguments are declared in the Interface Specification for the World.

Typedef Documentation

typedef void(* IrmoInvokeCallback)(IrmoMethodData *data, void *user_data)
 

Callback function for methods.

When a method invocation is received from a client, a callback function of this type is invoked.

Parameters:
data A IrmoMethodData object holding data about the invoked method.
user_data A pointer to user defined piece of memory specified in the irmo_world_method_watch call used to set the callback.

typedef struct _IrmoMethodData IrmoMethodData
 

Method Callback Data.

When a callback function attached to a method is invoked, it is passed an object of this type containing data relevant to the method. For example, the object can be used to retrieve the values of method arguments, and the client which invoked the method.


Function Documentation

unsigned int irmo_method_arg_int IrmoMethodData data,
char *  argname
 

Retrieve a method argument.

Get the value of an integer argument to a method from the method callback function.

Parameters:
data A IrmoMethodData object containing information about the method call
argname The name of the method argument
Returns:
The value of the method argument

char* irmo_method_arg_string IrmoMethodData data,
char *  argname
 

Retrieve a method argument.

Get the value of a string argument to a method from the method callback function.

Parameters:
data A IrmoMethodData object containing information about the method call
argname The name of the method argument
Returns:
The value of the method argument (constant string)

IrmoClient* irmo_method_get_source IrmoMethodData data  ) 
 

Find the client which invoked a method.

This function returns a reference to the IrmoClient object of the client which invoked the method. If it was invoked by a function in the local program, it returns NULL.

void irmo_world_method_call IrmoWorld world,
char *  method,
... 
 

Call a method.

Invoke a method. If the world is a local copy of a world served from a remote machine the call will be forwarded to the remote machine.

Following the function arguments are the method arguments, in the order specified in the interface specification.

Parameters:
world The world object on which to invoke the method
method The name of the method
See also:
irmo_world_method_call2

void irmo_world_method_call2 IrmoWorld world,
char *  method,
IrmoValue arguments
 

Call a method.

Invoke a method. This is the same as irmo_world_method_call except it takes an array of IrmoValue structures for the arguments instead of using the C varargs mechanism.

IrmoCallback* irmo_world_method_watch IrmoWorld world,
char *  method_name,
IrmoInvokeCallback  method,
void *  user_data
 

Set a callback function to be invoked when a method is called.

Parameters:
world The world to set the watch.
method_name The name of the method to watch
method A callback function to call when the method is invoked.
user_data User data to be passed to the callback function
Returns:
A IrmoCallback object representing the watch.


Generated on Tue Dec 30 04:04:46 2003 for Irmo by doxygen 1.3.4