Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

sobj_env_class Struct Reference
[Environments]

#include <sobject.h>

Collaboration diagram for sobj_env_class:

Collaboration graph
[legend]

Detailed Description

A simple object environment class.

An environment class provides callback methods for operations specific to a simple object class name. An environment object (sobj_env) holds a dictionary of environment class objects and a default environment class object.


Data Fields

volatile sobj_refcount_t so_refcount
 Reference counter.
void(* so_del )(void *)
 Destructor.
const char * so_name
 Name of the class.
sobj *(* so_pack )(void *so_owner, struct sobj *so_obj, struct sobj_env *so_env)
 Callback for packing objects.
sobj *(* so_unpack )(void *so_owner, struct sobj *so_obj, struct sobj_env *so_env)
 Callback for unpacking object.
sobj *(* so_call )(void *so_owner, struct sobj *so_obj, struct sobj *so_sel, struct sobj *so_args, struct sobj_env *so_env)
 Method call callback function.
sobj *(* so_eval )(void *so_owner, struct sobj *so_obj, struct sobj_env *so_env)
 Evaluation callback.
void * so_owner
 The owner object of the environment class.
void(* so_owner_del )(void *so_owner)
 The destructor functions for the owner object.


Field Documentation

struct sobj*(* sobj_env_class::so_call)(void *so_owner, struct sobj *so_obj, struct sobj *so_sel, struct sobj *so_args, struct sobj_env *so_env)
 

Method call callback function.

This function is called by sobj_call() to perform a method call. A null-pointer indicates that the class does not support method calls.

Parameters:
so_owner The so_owner field from the environment class object.
so_obj The called object.
so_sel The method selector.
so_args The argument vector. This is always an object of type array.
so_env The environment object. This is never a null-pointer.
Returns:
The result of the method call (on success) and a null-pointer on error.

void(* sobj_env_class::so_del)(void *)
 

Destructor.

struct sobj*(* sobj_env_class::so_eval)(void *so_owner, struct sobj *so_obj, struct sobj_env *so_env)
 

Evaluation callback.

This function is called by sobj_eval() to perform an expression evaluation. A null-pointer indicates that the class does not support expression evaluation.

Parameters:
so_owner The so_owner field from the environment class object.
so_obj The called object. This is always an object of type expr.
so_env The environment object. This is never a null-pointer.
Returns:
The result of the evaluation. If the object can or should no be evaluated, the function should return the parameter so_obj as is. It is a fatal runtime error if the function returns a null-pointer.

const char* sobj_env_class::so_name
 

Name of the class.

This is a null-pointer for the default environment class. The class name should never change for an environment class used by an environment object.

void* sobj_env_class::so_owner
 

The owner object of the environment class.

This value is passed as the first parameter to all callback functions.

void(* sobj_env_class::so_owner_del)(void *so_owner)
 

The destructor functions for the owner object.

This may be a null-pointer.

struct sobj*(* sobj_env_class::so_pack)(void *so_owner, struct sobj *so_obj, struct sobj_env *so_env)
 

Callback for packing objects.

This function is called before a simple object is serialized. A null-pointer indicates that no pre-serialization translation is required for this class.

Parameters:
so_owner The so_owner field from the environment class object.
so_obj The object to be serialized.
so_env The environment object. This is never a null-pointer.
Returns:
The (possibly modified) object to be serialized.

volatile sobj_refcount_t sobj_env_class::so_refcount
 

Reference counter.

struct sobj*(* sobj_env_class::so_unpack)(void *so_owner, struct sobj *so_obj, struct sobj_env *so_env)
 

Callback for unpacking object.

This function is called after an object is de-serialized. A null-pointer indicates the plain de-serialized objects should be used.

Parameters:
so_owner The so_owner field from the environment class object.
so_obj The plain de-serialized object.
so_env The environment object. This is never a null-pointer.
Returns:
The (possibly modified) de-serialized object.


The documentation for this struct was generated from the following file:
Generated on Sat Jul 23 16:06:36 2005 for sobject by  doxygen 1.3.9.1