Previous Table of Contents Next


10.5.23 OperationDef


   An OperationDef represents the information needed to define an operation of an interface.

   module CORBA { enum OperationMode {OP_NORMAL, OP_ONEWAY}; enum ParameterMode {PARAM_IN, PARAM_OUT, PARAM_INOUT}; struct ParameterDescription {

Identifier name;
TypeCode type;
IDLType type_def;
ParameterMode mode;
};

   typedef sequence <ParameterDescription> ParDescriptionSeq;

   typedef Identifier ContextIdentifier; typedef sequence <ContextIdentifier> ContextIdSeq;

   typedef sequence <ExceptionDef> ExceptionDefSeq; typedef sequence <ExceptionDescription> ExcDescriptionSeq;

   interface OperationDef : Contained { readonly attribute TypeCode result; attribute IDLType result_def; attribute ParDescriptionSeq params; attribute OperationMode mode; attribute ContextIdSeq contexts; attribute ExceptionDefSeq exceptions;

   };

   struct OperationDescription { Identifier name; RepositoryId id; RepositoryId defined_in; VersionSpec version; TypeCode result; OperationMode mode; ContextIdSeq contexts; ParDescriptionSeq parameters; ExcDescriptionSeq exceptions; };

   };

   10.5.23.1 Read Interface

   The result attribute is a TypeCode describing the type of the value returned by the operation. The result_def attribute identifies the definition of the returned type.

   The params attribute describes the parameters of the operation. It is a sequence of ParameterDescription structures. The order of the ParameterDescriptions in the sequence is significant. The name member of each structure provides the parameter name. The type member is a TypeCode describing the type of the parameter. The type_def member identifies the definition of the type of the parameter. The mode member indicates whether the parameter is an in, out, or inout parameter.

   The operation’s mode is either oneway (i.e., no output is returned) or normal.

   The contexts attribute specifies the list of context identifiers that apply to the operation.

   The exceptions attribute specifies the list of exception types that can be raised by the operation.

   The inherited describe operation for an OperationDef object returns an OperationDescription.

   10.5.23.2 Write Interface

   Setting the result_def attribute also updates the result attribute.

   The mode attribute can be set to OP_ONEWAY only if the result is TC_void and all elements of params have a mode of PARAM_IN, and the list of exceptions is empty. If the mode is set to OP_ONEWAY when these conditions do not hold, a BAD_PARAM exception is raised with minor code 31.

   10.5.24 InterfaceDef

   An InterfaceDef object represents interface definition. It can contain constants, typedefs, exceptions, operations, and attributes.

   module CORBA { interface InterfaceDef; typedef sequence <InterfaceDef> InterfaceDefSeq; typedef sequence <RepositoryId> RepositoryIdSeq; typedef sequence <OperationDescription> OpDescriptionSeq; typedef sequence <AttributeDescription> AttrDescriptionSeq;

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

   attribute InterfaceDefSeq base_interfaces;

   // read interface boolean is_a (in RepositoryId interface_id); struct FullInterfaceDescription {

Identifier name;
RepositoryId id;
RepositoryId defined_in;
VersionSpec version;
OpDescriptionSeq operations;
AttrDescriptionSeq attributes;
RepositoryIdSeq base_interfaces;
TypeCode type;
};

   FullInterfaceDescription describe_interface();

   // write interface

   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 InterfaceDescription { Identifier name; RepositoryId id; RepositoryId defined_in; VersionSpec version; RepositoryIdSeq base_interfaces;

   }; };

   10.5.24.1 Read Interface

   The base_interfaces attribute lists all the interfaces from which this interface inherits.

   The is_a operation returns TRUE if the interface on which it is invoked either is identical to or inherits, directly or indirectly, from the interface identified by its interface_id parameter. Otherwise it returns FALSE. If the value of interface_id is IDL:omg.org/CORBA/Object:1.0, is_a returns TRUE signifying the fact that all interfaces are implicitly derived from the base type Object.

   The describe_interface operation returns a FullInterfaceDescription describing the interface, including its operations and attributes. The operations and attributes fields of the FullInterfaceDescription structure include descriptions of all of the operations and attributes in the transitive closure of the inheritance graph of the interface being described.

   The inherited describe operation for an InterfaceDef returns an InterfaceDescription.

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

   10.5.24.2 Write Interface

   Setting the base_interfaces attribute causes a BAD_PARAM exception with minor code 5 to be raised if the name attribute of any object contained by this InterfaceDef conflicts with the name attribute of any object contained by any of the specified base InterfaceDefs.

   The create_attribute operation returns a new AttributeDef contained in the InterfaceDef 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 InterfaceDef. 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 InterfaceDef.

   The create_operation operation returns a new OperationDef contained in the InterfaceDef 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 InterfaceDef. 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 InterfaceDef.

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

   10.5.25 ExtInterfaceDef

   An ExtInterfaceDef object represents interface definition. It can contain constants, typedefs, exceptions, operations, and attributes with exceptions.

   module CORBA { interface InterfaceAttrExtension {

   // read interface

   struct ExtFullInterfaceDescription {

Identifier name;
RepositoryId id;
RepositoryId defined_in;
VersionSpec version;
OpDescriptionSeq operations;
ExtAttrDescriptionSeq attributes;
RepositoryIdSeq base_interfaces;
TypeCode type;
};

   ExtFullInterfaceDescription describe_ext_interface();

   // write interfaceExtAttributeDef 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 ); };

   interface ExtInterfaceDef : InterfaceDef, InterfaceAttrExtension { }; };

   10.5.25.1 Read Interface

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

   The inherited describe_ext_interfaces operation returns the ExtFullInterfaceDescription structure that contains information about attributes with exceptions, in addition to the information found in FullInterfaceDescription.

   10.5.25.2 Write Interface

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

   The inherited create_ext_attribute operation returns a new ExtAttributeDef contained in the ExtInterfaceDef 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 ExtInterfaceDef. 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 ExtInterfaceDef.