OSF DCE Application Development Guide--Introduction and Style Guide
RPC Parameters
The size of the array data marshalled is determined in one of two ways. In a conformant
array, the size of the array is not declared in the IDL declaration, and one of the max_is
or size_is attributes is used to determine the size of the marshalled data at runtime. In a
varying array, the size of the array is declared in the .idl file, but one or more of the other
field attributes determines what range of elements is actually marshalled. Arrays may be
both conformant and varying at the same time.
Each field attribute is associated with some variable whose value is known at runtime.
The scope of this association is within either an operation declaration or a structure
declaration. That is, when the array is a parameter of an operation, the field attribute
variables must also be parameters of the same operation. Similarly, when the array is a
member of a structure, the field attribute variables must be members of the same
structure.
The following samples show a series of array declarations using some of the many
possible forms:
/* An array of fixed size */
typedef char char5array[5];
typedef char5array *char5ptr;
void array_test1(
[in] handle_t handle,
[in] char5ptr a_pointer,
[out] error_status_t *status);
/* A conformant array: the size is determined at runtime */
void array_test2(
[in] handle_t handle,
[in] unsigned32 size,
[in, size_is(size)] char an_array[],
[out] error_status_t *status);
/*
* A varying array: the portion of the array transmitted is
* determined at runtime
*/
typedef struct{
unsigned32 first;
unsigned32 length;
[first_is(first), length_is(length)] char array[0..10];
}v_struct;
void array_test3(
[in] handle_t handle,
[in] v_struct v_array,
[out] error_status_t *status);
/*
* A conformant and varying array: both size and the portion
* transmitted are determined at runtime
124246 Tandem Computers Incorporated 6− 19