Previous Table of Contents Next


10.5.8 ConstantDef


   A ConstantDef object defines a named constant.

   module CORBA { interface ConstantDef : Contained {

};

readonly attribute TypeCode type; attribute IDLType type_def; attribute any value;

str uct ConstantDescription { Identifier name; RepositoryId id;

   RepositoryId defined_in; VersionSpec version; TypeCode type; any value;

   }; };

   10.5.8.1 Read Interface

   The type attribute specifies the TypeCode describing the type of the constant. The type of a constant must be one of the primitive types allowed in constant declarations (see Section 3.10, “Constant Declaration,? on page 3-32). The type_def attribute identifies the definition of the type of the constant.

   The value attribute contains the value of the constant, not the computation of the value (e.g., the fact that it was defined as “1+2?).

   The describe operation for a ConstantDef object returns a ConstantDescription.

   10.5.8.2 Write Interface

   Setting the type_def attribute also updates the type attribute.

   When setting the value attribute, the TypeCode of the supplied any must be equal to the type attribute of the ConstantDef.