Up: conditions custom   [Contents][Index]


6.15.1 Plain exceptional-condition objects

The error_1 exceptional–condition object–type descriptor has the purpose of describing an error. The descriptor of this type has cce_condition_runtime_error_t as parent.

NOTE This is the documentation of the example code under the directory examples of the source distribution of CCExceptions, defining a new exceptional–condition object–type. We can take the source of this section from the source distribution of CCExceptions.

Struct Typedef: my_descriptor_error_1_t

Structure type representing the exceptional–condition object–type descriptor. This descriptor has the descriptor cce_descriptor_runtime_error_t as parent. It has the following public fields:

cce_descriptor_t descriptor

Core values of the exceptional–condition object–type descriptor.

Struct Typedef: cce_condition_error_1_t

Structure type representing the exceptional–condition object; this struct type can be instantiated and subtyped. It has the following public fields:

cce_condition_runtime_error_t runtime_error

The runtime exceptional–condition object.

int * data

Pointer to the data.

Function: cce_condition_t const * my_condition_new_error_1 (cce_destination_t L, int data)

Return a pointer to a newly built exceptional–condition object of type my_condition_error_1_t. If an error occurs: raise an exception by performing a non–local exit to L.

Function: bool my_condition_is_error_1 (cce_condition_t const * C)

Return true if the exceptional–condition object referenced by C is of type my_condition_error_1_t or it is derived from it; otherwise return false.

Facilities to derive an exceptional–condition object subtype

When deriving a subtype from cce_condition_error_1_t we need the following functions.

Function: void cce_descriptor_set_parent_to(cce_descriptor_error_1_t) (cce_descriptor_t * D)

Mutate the exceptional–condition object–type descriptor referenced by D so that its parent is the descriptor of cce_descriptor_error_1_t. We should call this function in the initialisation module of the derived type.

Function: void cce_condition_init_error_1 (cce_destination_t L, cce_condition_error_1_t * C, int data)

Initialise an already allocated exceptional–condition object. We should call this function from the initialisation function of the derived type. If an error occurs: raise an exception by performing a non–local exit to L.


Up: conditions custom   [Contents][Index]

This document describes version 0.9.0-devel.3 of CCExceptions.