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

Environments
[Simple Objects C API]


Detailed Description

Functions dealing with simple object environments and class environments.


Data Structures

struct  sobj_env_class
 A simple object environment class. More...
struct  sobj_env
 A simple object environment. More...

Defines

#define SOBJ_ENV_STANDARD   ((struct sobj_env *)1)
 Special constant representing the standard environment.

Functions

sobj_env_classnew_sobj_env_class (void)
 Create a new instance of an environment class.
sobj_env_classsobj_env_class_clone (struct sobj_env_class *env_class)
 Create a clone of an environment class.
void sobj_env_class_set_name (struct sobj_env_class *env_class, const char *name)
 Set the name of an environment class.
sobj_envnew_sobj_env (void)
 Create a new instance of an environment object.
sobj_envsobj_env_clone (struct sobj_env *env)
 Create a clone of an environment object.
void sobj_env_add_class (struct sobj_env *env, struct sobj_env_class *env_class)
 Add an environment class to an environment object.
sobj_env_classsobj_env_find_class (struct sobj_env *env, const char *name)
 Find an environment class matching a specified name.
void sobj_env_clear_error (struct sobj_env *env)
 Clear the environment error indicator.
size_t sobj_env_sizeof (void)
 Return the size of an environment object.
int sobj_env_get_classes (struct sobj_env *env, struct sobj_env_class ***class_list_ptr, struct sobj_env_class **default_class_ptr)
 Get a list of all classes of an environment object.
void sobj_env_set_error (struct sobj_env *env, const char *id, struct sobj_dict *args)
 Set the error indicator of an environment.
void sobj_env_set_user_error (struct sobj_env *env, struct sobj *error)
 Set a user error object.
sobj_envsobj_env_STANDARD (void)
 Return a copy of the standard environment.


Define Documentation

#define SOBJ_ENV_STANDARD   ((struct sobj_env *)1)
 

Special constant representing the standard environment.

The standard environment is the environment returned by the sobj_env_STANDARD() constructor. Note that this constant may be used in an env parameter only if this is explicitly documented.


Function Documentation

struct sobj_env* new_sobj_env void   ) 
 

Create a new instance of an environment object.

Returns:
The new instance.

struct sobj_env_class* new_sobj_env_class void   ) 
 

Create a new instance of an environment class.

Returns:
The new instance.

void sobj_env_add_class struct sobj_env env,
struct sobj_env_class env_class
 

Add an environment class to an environment object.

Parameters:
env The environment object.
env_class The environment class to be added to the environment object env. If the environment class has no name (or an empty name) it is installed as the default environment class.
The function may be used to replace an environment class with the same name (or the default environment class if the specified environment class has no name). In this case, previously bound environment class is released.

struct sobj_env_class* sobj_env_class_clone struct sobj_env_class env_class  ) 
 

Create a clone of an environment class.

Parameters:
env_class The environment class to be cloned.
Returns:
The cloned environment class.

void sobj_env_class_set_name struct sobj_env_class env_class,
const char *  name
 

Set the name of an environment class.

Parameters:
env_class The environment class.
name The name of the environment class.

void sobj_env_clear_error struct sobj_env env  ) 
 

Clear the environment error indicator.

Parameters:
env The environment. This may be a null-pointer.

struct sobj_env* sobj_env_clone struct sobj_env env  ) 
 

Create a clone of an environment object.

Parameters:
env The environment object to be cloned.
Returns:
A clone of the specified environment object.

struct sobj_env_class* sobj_env_find_class struct sobj_env env,
const char *  name
 

Find an environment class matching a specified name.

Parameters:
env The environment. This may be a null-pointer.
name The name of the requested class.
Returns:
A new reference to the requested class. If no class matching the specified name is found, the default environment class is returned.
Note:
The function may return a null-pointer if no default class is defined. If the function returns a non-null value, the pointer will be a new reference to the class (i.e. the reference counter is increased).

int sobj_env_get_classes struct sobj_env env,
struct sobj_env_class ***  class_list_ptr,
struct sobj_env_class **  default_class_ptr
 

Get a list of all classes of an environment object.

Parameters:
env The environment object.
class_list_ptr If this is not a null-pointer, a vector of pointers to classes is allocated from the heap and assigned to *class_list_ptr. The vector will hold new references to the classes, i.e. the reference counter of all classes is increased.
default_class_ptr If this is not a null-pointer, a new reference to the default class (if defined) is stored to *default_class_ptr. If no default_class_ptr class is defined, a null-pointer is stored to *default_class_ptr.
Returns:
The function returns the number of classes of the environment, not counting the default class.

void sobj_env_set_error struct sobj_env env,
const char *  id,
struct sobj_dict args
 

Set the error indicator of an environment.

If there's already an error object associated with an environment, then the function has no effect besides dropping the specified dictionary.

This is a semi-internal function used for setting error conditions recognized by the library itself. User code should call sobj_env_set_user_error() to set error indicators.

Parameters:
env The environment. This may be a null-pointer.
id The error message ID string. This must be a pointer to a string kept in constant static storage.
args A dictionary holding the error message arguments. A null-pointer is equivalent to an empty dictionary.

void sobj_env_set_user_error struct sobj_env env,
struct sobj error
 

Set a user error object.

Parameters:
env The environment. This may be a null-pointer.
error The user error object. The function will either retain or drop the specified object.

size_t sobj_env_sizeof void   ) 
 

Return the size of an environment object.

The function returns the size of an environment object. The value returned is constant. Use this function instead of sizeof(struct sobj_env).

Returns:
The size of an environment object (in bytes).

struct sobj_env* sobj_env_STANDARD void   ) 
 

Return a copy of the standard environment.

The environment returned is a clone of the standard environment and may be modified by the caller.

Returns:
A standard environment.


Generated on Sat Jul 23 16:07:33 2005 for sobject by  doxygen 1.3.9.1