Previous Table of Contents Next


10.5.31 ValueDef


   A ValueDef object represents a value definition. It can contain constants, typedefs, exceptions, operations, and attributes.

   module CORBA { interface ValueDef; typedef sequence <ValueDef> ValueDefSeq;

   struct Initializer { StructMemberSeq members; Identifier name;

   };

   typedef sequence<Initializer> InitializerSeq;

   interface ValueDef : Container, Contained, IDLType { // read/write interface

   attribute InterfaceDefSeq supported_interfaces;attribute InitializerSeq initializers;attribute ValueDef base_value;attribute ValueDefSeq abstract_base_values;attribute boolean is_abstract;attribute boolean is_custom;attribute boolean is_truncatable;

   // read interfaceboolean is_a(

   in RepositoryId id

   ); struct FullValueDescription {

Identifier name;
RepositoryId id;
boolean is_abstract;
boolean is_custom;
RepositoryId defined_in;
VersionSpec version;
OpDescriptionSeq operations;
AttrDescriptionSeq attributes;
ValueMemberSeq members;
InitializerSeq initializers;
RepositoryIdSeq supported_interfaces;
RepositoryIdSeq abstract_base_values;
boolean is_truncatable;
RepositoryId base_value;
TypeCode type;
};

   FullValueDescription describe_value();

   // write interface

   ValueMemberDef create_value_member(

   in RepositoryId id,

   in Identifier name,

   in VersionSpec version,

   in IDLType type,

   in Visibility access );

   AttributeDef create_attribute(

   in RepositoryId id,

   in Identifier name,

   in VersionSpec version,

   in IDLType type,

   in AttributeMode mode );

   OperationDef create_operation (

   in RepositoryId id,

   in Identifier name,

   in VersionSpec version,

   in IDLType result,

   in OperationMode mode,

   in ParDescriptionSeq params,

   in ExceptionDefSeq exceptions,

   in ContextIdSeq contexts );

};

struct ValueDescription {
Identifier name;
RepositoryId id;
boolean is_abstract;
boolean is_custom;
RepositoryId defined_in;
VersionSpec version;
RepositoryIdSeq supported_interfaces;
RepositoryIdSeq abstract_base_values;
boolean is_truncatable;
RepositoryId base_value;
};
};

   10.5.31.1 Read Interface

   The supported_interfaces attribute lists the interfaces that this value type supports.

   The initializers attribute lists the initializers this value type supports.

   The base_value attribute describes the value type from which this value inherits.

   The abstract_base_values attribute lists the abstract value types from which this value inherits.

   The is_abstract attribute is TRUE if the value is an abstract value type.

   The is_custom attribute is TRUE if the value uses custom marshaling.

   The is_truncatable attribute is TRUE if the value inherits “safely? (i.e., supports truncation) from another value.

   The is_a operation returns TRUE if the value on which it is invoked either is identical to or inherits, directly or indirectly, from the interface or value identified by its id parameter or if the value of id is IDL:omg.org/CORBA/ValueBase:1.0. Otherwise it returns FALSE.

   The describe_value operation returns a FullValueDescription describing the value, including its operations and attributes.

   The inherited describe operation for an ValueDef returns an ValueDescription.

   The inherited contents operation returns the list of constants, typedefs, and exceptions defined in this ValueDef and the list of attributes, operations and members either defined or inherited in this ValueDef. If the exclude_inherited parameter is set to TRUE, only attributes, operations and members defined within this value are returned. If the exclude_inherited parameter is set to FALSE, all attributes, operations and members are returned.

   10.5.31.2 Write Interface

   Setting the supported_interfaces, base_value, or abstract_base_values attribute causes a BAD_PARAM exception with minor code 5 to be raised if the name attribute of any object contained by this ValueDef conflicts with the name attribute of any object contained by any of the specified bases. If an attempt is made to set the supported_interfaces attribute to an InterfaceDefSeq that contains more than one InterfaceDef that is not an AbstractInterfaceDef, then the BAD_PARAM exception shall be raised with standard minor code 12.

   The create_value_member operation returns a new ValueMemberDef contained in the ValueDef on which it is invoked. The id, name, version, type_def, and access attributes are set as specified. The type attribute is also set. The defined_in attribute is initialized to identify the containing ValueDef. A BAD_PARAM exception with minor code 2 is raised if an object with the specified id already exists in the Repository. A BAD_PARAM exception with minor code 3 is raised if an object with the same name already exists in this ValueDef.

   The create_attribute operation returns a new AttributeDef contained in the ValueDef on which it is invoked. The id, name, version, type_def, and mode attributes are set as specified. The type attribute is also set. The defined_in attribute is initialized to identify the containing ValueDef. A BAD_PARAM exception with minor code 2 is raised if an object with the specified id already exists in the Repository. A BAD_PARAM exception with minor code 3 is raised if an object with the same name already exists in this ValueDef.

   The create_operation operation returns a new OperationDef contained in the ValueDef on which it is invoked. The id, name, version, result_def, mode, params, exceptions, and contexts attributes are set as specified. The result attribute is also set. The defined_in attribute is initialized to identify the containing ValueDef. A BAD_PARAM exception with minor code 2 is raised if an object with the specified id already exists in the Repository. A BAD_PARAM exception with minor code 3 is raised if an object with the same name already exists in this ValueDef.

   A ValueDef used as a Container may only contain TypedefDef, (including definitions derived from TypedefDef), ConstantDef, and ExceptionDef definitions.

   10.5.32 ExtValueDef

   An ExtValueDef object represents a value definition. It can contain constants, typedefs, exceptions, operations, and attributes with exceptions. Value definitions that contain initializers with user exceptions can also be represented in ExtValueDef objects.

   module CORBA {

   struct ExtInitializer { StructMemberSeq members; ExcDescriptionSeq exceptions;

   Identifier name; }; typedef sequence <ExtInitializer> ExtInitializerSeq;

   interface ExtValueDef : ValueDef {

   // read/write interfaceattribute ExtInitializerSeq ext_initializers;// read interfacestruct ExtFullValueDescription {

Identifier name;
RepositoryId id;
boolean is_abstract;
boolean is_custom;
RepositoryId defined_in;
VersionSpec version;
OpDescriptionSeq operations;
ExtAttrDescriptionSeq attributes;
ValueMemberSeq members;
ExtInitializerSeq initializers;
RepositoryIdSeq supported_interfaces;
RepositoryIdSeq abstract_base_values;
boolean is_truncatable;
RepositoryId base_value;
TypeCode type;
};

   ExtFullValueDescription describe_ext_value();

   // write interface

   ExtAttributeDef create_ext_attribute (

   in RepositoryId id,

   in Identifier name,

   in VersionSpec version,

   in IDLType type,

   in AttributeMode mode,

   in ExceptionDefSeq get_exceptions,

   in ExceptionDefSeq set_exceptions

   ); }; };

   10.5.32.1 Read Interface

   All operations and attributes inherited from ValueDef behave the same as for ValueDef. In particular, the def_kind attribute has the value dk_Value, exactly as in ValueDef.

   The ext_initializers attribute lists the initializers with exceptions that this value type supports.

   The inherited initializers attribute list the same initializers as in ext_initializers but does not have the exception information.

   The describe_ext_value operation returns the ExtFullValueDescription structure which contains information about attributes with exceptions and initializers with exceptions, in addition to the information found in FullValueDescription.

   10.5.32.2 Write Interface

   All operations and attributes inherited from ValueDef behave the same as for ValueDef.

   The create_ext_attribute operation returns a new ExtAttributeDef contained in the ExtValueDef on which it is invoked. The id, name, version, type_def, mode, get_exceptions and set_exceptions attributes are set as specified. The type attribute is also set. The defined_in attribute is initialized to identify the containing ExtValueDef. A BAD_PARAM exception with standard minor code 2 is raised if an object with the specified id already exists in the Repository. BAD_PARAM exception with standard minor code 3 is raised if an object with the same name already exists in this ExtValueDef.