RTOp_obj_type_vtbl_t Struct Reference
[Implementation of Reduction/Transformation Operators.]

#include <RTOp.h>

List of all members.

Public Attributes

int(* get_obj_type_num_entries )(const struct RTOp_obj_type_vtbl_t *vtbl, const void *instance_data, int *num_values, int *num_indexes, int *num_chars)
int(* obj_create )(const struct RTOp_obj_type_vtbl_t *vtbl, const void *instance_data, void **obj)
int(* obj_reinit )(const struct RTOp_obj_type_vtbl_t *vtbl, const void *instance_data, void *obj)
int(* obj_free )(const struct RTOp_obj_type_vtbl_t *vtbl, const void *instance_data, void **obj)
int(* extract_state )(const struct RTOp_obj_type_vtbl_t *vtbl, const void *instance_data, void *obj, int num_values, RTOp_value_type value_data[], int num_indexes, RTOp_index_type index_data[], int num_chars, RTOp_char_type char_data[])
int(* load_state )(const struct RTOp_obj_type_vtbl_t *vtbl, const void *instance_data, int num_values, const RTOp_value_type value_data[], int num_indexes, const RTOp_index_type index_data[], int num_chars, const RTOp_char_type char_data[], void **obj)


Detailed Description

Vitual function table for manipulating a simple object and externalizing its structure.

The functions pointed to in this table create, initialize and destroy a simple object (some struct) and also the structure of the object. Functions are also declared for allowing the state of the objects to be externalized into a simple portable format. This virtual function pointer table is used for the object instance data for RTOp_RTOp objects and also for the manipulation of reduction objects. Since it is expected that the same type of structure can be used and reused in several different contexts, they all share this same virtual function table type.

The uses of these functions and the meanings of their arguments may depend on the context of where the vtbl is used.

Definition at line 851 of file RTOp.h.


Member Data Documentation

int(* RTOp_obj_type_vtbl_t::get_obj_type_num_entries)(const struct RTOp_obj_type_vtbl_t *vtbl,const void *instance_data,int *num_values,int *num_indexes,int *num_chars)

Returns the number of entries of each type of member that defines the externalized object state.

This function returns the number of entries of values, indexes and characters (see above) that defines the externalized object state.

When this vtbl is used to handle the instance data for an RTOp_RTOp class, the function arguments have the following meaning:

When this vtbl is used to handle the reduction object the function arguments have the following meaning:

If the object is NULL and contains no data, the num_values = 0, num_indexes = 0 and num_chars = 0 on return.

Returns:
Returns 0 if successful and !=0 otherwise.

int(* RTOp_obj_type_vtbl_t::obj_create)(const struct RTOp_obj_type_vtbl_t *vtbl,const void *instance_data,void **obj)

Create (dynamically) an object of this type.

When this vtbl is used to handle the instance data for an RTOp_RTOp class, the function arguments have the following meaning:

When this vtbl is used to handle the reduction target object for an RTOp_RTOp class, the function arguments have the following meaning:

If the object is NULL and contains no data, then *obj == NULL on return.

Returns:
Returns 0 if successful and !=0 otherwise.

int(* RTOp_obj_type_vtbl_t::obj_reinit)(const struct RTOp_obj_type_vtbl_t *vtbl,const void *instance_data,void *obj)

Reinitialize an object of this type.

If get_obj_type_num_entries(ob,...) returns num_values = 0, num_indexes = 0 and num_chars = 0 then this function does nothing and obj must be set to NULL if called.

When this vtbl is used to handle the instance data for a RTOp_RTOp class, this function is optional. This function could be used in a reinitialization function for the RTOp_RTOp object to reinitialize the object's instance data obj_data. Or, the pointer to this function could be left as NULL since the client of the operator object can never directly call this function.

When this vtbl is used to handle the reduction object for an RTOp_RTOp class, the function arguments have the following meaning:

Returns:
Returns 0 if successful and !=0 otherwise.

int(* RTOp_obj_type_vtbl_t::obj_free)(const struct RTOp_obj_type_vtbl_t *vtbl,const void *instance_data,void **obj)

Destroy an object of this type.

If get_obj_type_num_entries(ob,...) returns num_values = 0, num_indexes = 0 and num_chars = 0 then this function does nothing and obj must be set to NULL if called.

When this vtbl is used to handle the instance data for an RTOp_RTOp class, this function is optional. This function could be used in a destructor function for the RTOp_RTOp class to free the object's instance data obj_data. Or, the pointer to this function could be left as NULL since the client of the operator object can never directly call this function.

When this vtbl is used to handle the reduction object for an RTOp_RTOp class, the function arguments have the following meaning:

Returns:
Returns 0 if successful and !=0 otherwise.

int(* RTOp_obj_type_vtbl_t::extract_state)(const struct RTOp_obj_type_vtbl_t *vtbl,const void *instance_data,void *obj,int num_values,RTOp_value_type value_data[],int num_indexes,RTOp_index_type index_data[],int num_chars,RTOp_char_type char_data[])

Externalize the state of the object to a portable format.

This function must be called on an initalized object. It is very important that these data contain all the information needed to perform the reduction operation using the externalized MPI compatilble operator function returned from RTOp_get_reduct_op<tt>(...) when this is used for a reduction object used in a reduction operation.

Parameters:
vtbl [in] this Virtual function table (or NULL).
instance_data [in] Points to the instance data for the RTOp operator object (or NULL).
obj [in[ Reduction object to be externalized.
num_values [in] Value returned from get_obj_type_num_entries(...).
value_data [out] Array (size num_values) of floating point data.
num_indexes [in] Value returned from get_obj_type_num_entries(...).
index_data [out] Array (size num_indexes) of integral data.
num_chars [in] Value returned from get_obj_type_num_entries(...).
char_data [out] Array (size num_chars) of character data.
Returns:
Returns 0 if successful, !=0 otherwise.

int(* RTOp_obj_type_vtbl_t::load_state)(const struct RTOp_obj_type_vtbl_t *vtbl,const void *instance_data,int num_values,const RTOp_value_type value_data[],int num_indexes,const RTOp_index_type index_data[],int num_chars,const RTOp_char_type char_data[],void **obj)

Load the state of the object from a portable format.

This function can be called on an already constructed object (*instance_data != NULL) or a NULL object (*instance_data == NULL).

Parameters:
vtbl [in] this Virtual function table (or NULL).
instance_data [in] Points to the instance data for the RTOp operator object (or NULL).
num_values [in] Value returned from get_obj_type_num_entries(...).
value_data [in] Array (size num_values) of floating point data.
num_indexes [in] Value returned from get_obj_type_num_entries(...).
index_data [in] Array (size num_indexes) of integral data.
num_chars [in] Value returned from get_obj_type_num_entries(...).
char_data [in] Array (size num_chars) of character data.
obj [in/out] On input if *obj != NULL then it will be assumed that this is an initialized object and it will be internally type casted into an expected type. If the current object pointed to by *obj has insufficient size to load the given state or *obj == NULL on input then free(*obj) will be called and then *obj = malloc(...) will be called to allocate the proper size object. Therefore, on output, the pointer *obj may be changed from its initial value if need be.
Returns:
Returns 0 if successful, !=0 otherwise.


The documentation for this struct was generated from the following file:
Generated on Wed May 12 21:56:40 2010 for MOOCHO (Single Doxygen Collection) by  doxygen 1.4.7