Next: Setting and checking mask
Up: Accessing the mask from
Previous: Accessing the mask from
Contents
Registering a new type
Bits of the mask are allocated to a new type using the function:
An appropriate number of bits of the mask are allocated to
hold a unique value for the states specified by the nstates
argument. The registration must take place before the type can be
used, so for instance, this could be scheduled at CCTK_STARTUP. The
function returns a if the required states cannot be allocated
(for example, if there are not enough free bits remaining in the
mask), otherwise it returns .
It is possible to allocate a portion of the mask without assigning
names to any of the states by passing NULL as the state_list.
This is useful when some integer number of states is required for a
given type, but the number of states and appropriate names are not
known at compile time. States which are allocated in this way can be
accessed using the SpaceMask_GetStateBitsList().
New states can be added to an already allocated type using the
function:
A number of new bits will be added to the specified type
appropriate to hold the number of existing states plus the extra
states. The allocated bits need not be contiguous within the mask.
The function returns if successful, otherwise a if the new
states could not be allocated.
Next: Setting and checking mask
Up: Accessing the mask from
Previous: Accessing the mask from
Contents
|