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

sobj_env Struct Reference
[Environments]

#include <sobject.h>

Collaboration diagram for sobj_env:

Collaboration graph
[legend]

Detailed Description

A simple object environment.

Environment objects provide a set of callback functions, class definitions and state information for an environment handling simple objects.

Note:
The structure allocated by new_sobj_env() is actually larger than this public structure. You should not use the sizeof operator to determine the size of an environment object. Used sobj_env_sizeof() instead.


Data Fields

volatile sobj_refcount_t so_refcount
 Reference counter.
void(* so_del )(void *)
 Destructor.
volatile bool so_error
 Flag indicating an error condition.
const char *volatile so_error_id
 The message ID of the message associated with the error, null for none.
sobj_dict *volatile so_error_args
 The message arguments of the error.
int(* so_message )(void *so_owner, int so_type, const char *so_id, struct sobj_dict *so_args, const char *so_message)
 Message output callback function.
char *(* so_str )(void *so_owner, struct sobj *so_obj)
 Callback for generating a string representation of a simple object.
sobj *(* so_vref )(void *so_owner, const char *so_ref)
 Callback for resolving a variable reference.
char *(* so_vref_str )(void *so_owner, const char *so_ref)
 Callback for resolving variable reference in strings.
void * so_owner
 The owner object of the environment.
void(* so_owner_del )(void *so_owner)
 The destructor functions for the owner object.


Field Documentation

void(* sobj_env::so_del)(void *)
 

Destructor.

volatile bool sobj_env::so_error
 

Flag indicating an error condition.

struct sobj_dict* volatile sobj_env::so_error_args
 

The message arguments of the error.

const char* volatile sobj_env::so_error_id
 

The message ID of the message associated with the error, null for none.

If not null, this should point to a constant static buffer.

int(* sobj_env::so_message)(void *so_owner, int so_type, const char *so_id, struct sobj_dict *so_args, const char *so_message)
 

Message output callback function.

This function is called whenever a message is generated by the simple objects library. A null-pointer indicates that a simple message text should be sent to the standard error of the running process.

Parameters:
so_owner The so_owner field of the environment object.
so_type The message type. Message types are:
  • 1. Error message.
  • 2. Waring message.
  • 3. Info message.
  • 4. Debugging message.
These values correspond to the numeric values of the enumeration constants of enum sobj_msg_type.
so_id The message identifiers string.
so_args Dictionary of message arguments.
so_message A message string containing all relevant information. This string is suitable for debugging output.
Return values:
-1 The message was not processed. The default message processing should be performed.
0 The message was processed.

void* sobj_env::so_owner
 

The owner object of the environment.

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

void(* sobj_env::so_owner_del)(void *so_owner)
 

The destructor functions for the owner object.

This may be a null-pointer.

volatile sobj_refcount_t sobj_env::so_refcount
 

Reference counter.

char*(* sobj_env::so_str)(void *so_owner, struct sobj *so_obj)
 

Callback for generating a string representation of a simple object.

A null-pointer indicates that the default string representation should be used.

Parameters:
so_owner The so_owner field of the environment object.
so_obj The object to be converted to a string.
Returns:
The function should return a heap allocated string representing the value of the simple object. The simple object library will take care of releasing the storage for the returned string. If the function returns a null-pointer, the default string processing is performed.

struct sobj*(* sobj_env::so_vref)(void *so_owner, const char *so_ref)
 

Callback for resolving a variable reference.

A null-pointer indicates that variable references should not be resolved.

Parameters:
so_owner The so_owner field of the environment object.
so_ref The reference string to be resolved. This is a UTF-8 encoded UNICODE string (i.e. not an extended string).
Returns:
The resolved object. A null-pointer indicates that the variable reference should not be resolved.

char*(* sobj_env::so_vref_str)(void *so_owner, const char *so_ref)
 

Callback for resolving variable reference in strings.

A null-pointer indicates that the function callbacks so_str() and so_vref() should be used to generated the string representation. If so_vref is also a null-pointer, a default string representation is generated (which is a text serialization of the variable reference).

Parameters:
so_owner The so_owner field of the environment object.
so_ref The reference string to be resolved. This is a UTF-8 encoded UNICODE string (i.e. not an extended string).
Note:
This function callback may be used to speed-up variable resolution in strings or to implement a different variable resolution for strings and vref objects.
Returns:
A heap allocated UTF-8 encoded UNICODE string representing the replacement string for the variable reference. The simple object library takes care of releasing the storage for the string buffer returned. A null-pointer indicates that so_str() and so_vref() should be used to create the string representation.


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