InterfaceDef describes an IDL interface definition. It may contain lists of constants, types, exceptions, operations and attributes and inherits from both Container and Contained.
// IDL
typedef sequence <OperationDescription> OpDescriptionSeq;
typedef sequence <AttributeDescription> AttrDescriptionSeq;
typedef sequence <RepositoryId> RepositoryIdSeq;
interface InterfaceDef : Container, Contained {
attribute RepositoryIdSeq base_interfaces;
struct FullInterfaceDescription {
Identifier name;
RepositoryId id;
RepositoryId defined_in;
OpDescriptionSeq operations;
AttrDescriptionSeq attributes;
};
FullInterfaceDescription describe_interface();
};
ContainedContainer
attribute RepositoryIdSeq base_interfaces;
Container::describe() returns a structure of type Contained::Description:
// IDL
struct Description {
Identifier name;
any value
};
The name member of this structure contains the string "InterfaceDescription".The
TypeCode of the value member is:
_tc_InterfaceDescriptionThe
value of the any is a structure of type:
// IDL
struct InterfaceDescription {
Identifier name;
Repository id;
RepositoryId defined_in;
};
Contained::describe()
Container::describe_contents() is a combination of the operations Container::contents() and Contained::describe() and can be used to iterate through the items declared directly in the interface.It returns a sequence of
Container::Descripton structures, where each returned structure has the following fields:
contained_object: the object reference, of type Contained, of one of the objects contained directly in the module or interface.
name: the name of this top level contained object, for example, InterfaceDescription, ConstantDescription and so on.
value: a description, of type any, of this contained object. following two members:
TypeCode of the any will be a TypeCode corresponding to the type of this top level object, for example, _tc_OperationDescriptionThe
value of the any will be a structure of the relevant type, for example, OperationDescription, ConstantDescription, and so on.
Contained::describe() Container::contents()
FullInterfaceDescription describe_interface();
This function provides a straightforward way to obtain a description of an interface's operations and attributes. However,
Container::describe_contents() (or a combination of Container::contents() and Contained::describe()) must be used to get a description of its constants, typedefs and exceptions.
Container::describe_contents()Container::contents()Contained::describe()