Overview | The value read and write operations allow the access and update of the value attribute of a ConstantDef. |
Original interface | CORBA module: ConstantDef Interface |
Exceptions | CORBA::SystemException |
Intended Usage
The value attribute contains the value of the constant, not the computation of the value (for example, the fact that it was defined as "1+2"). Read and write value operations are provided with parameters as defined below.
Syntax
any value;
Read operations
The returned pointer to a CORBA::Any data type represents the value attribute of the constant. The object memory belongs to the caller, and can be removed by invoking delete.
Write operations
The value parameter is a reference to a CORBA::Any data type that provides the constant value to change the value attribute of the ConstantDef. When setting the value attribute, the TypeCode of the supplied CORBA::Any must be equal to the type attribute of the ConstantDef.
Example
// C++ // assume that 'constant_409' has already been initialized CORBA::ConstantDef * constant_409; // set the value '409' in the Any, // and invoke the value operation to update the constant CORBA::Any new_value; new_value <<= (CORBA::Long) 409; constant_409-> value (new_value); // read the constant value from the ConstantDef CORBA::Any * returned_value; returned_value = constant_409-> value ();