Previous | Table of Contents | Next |
The base interface Contained is inherited by all Interface Repository interfaces that are contained by other IR objects. All
objects within the Interface Repository, except the root object (Repository) and definitions of anonymous (ArrayDef, StringDef,
WstringDef, FixedDef and SequenceDef), and primitive types are contained by
other objects.module CORBA {typedef string VersionSpec;interface Contained : IRObject {// read/write interfaceattribute RepositoryIdattribute Identifierattribute VersionSpec// read interfacereadonly attribute Containerreadonly attribute ScopedNamereadonly attribute Repositorystruct Description {DefinitionKindany};Description describe ();// write interfacevoid move ( |
|||||
id; | |||||
name; | |||||
version; | |||||
defined_in; | |||||
absolute_name; | |||||
containing_repository; | |||||
kind; | |||||
value; | |||||
in Container new_container, in Identifier new_name, in VersionSpec new_version
); }; };
10.5.3.1 Read Interface
An object that is contained by another object has an id attribute that identifies it globally, and a name attribute that identifies
it uniquely within the enclosing Container object. It also has a version attribute that distinguishes it from other versioned
objects with the same name. IRs are not required to support simultaneous containment of multiple versions of the same named
object. Supporting multiple versions will require mechanisms and policy not specified in this document.
Contained objects also have a defined_in attribute that identifies the Container within which they are defined. Objects can
be contained either because they are defined within the containing object (for example, an interface is defined within a module)
or because they are inherited by the containing object (for example, an operation may be contained by an interface because
the interface inherits the operation from another interface). If an object is contained through inheritance, the defined_in
attribute identifies the InterfaceDef or ValueDef from which the object is inherited.
The absolute_name attribute is an absolute ScopedName that identifies a Contained object uniquely within its enclosing Repository.
If this object’s defined_in attribute references a Repository, the absolute_name is formed by concatenating the string “::?
and this object’s name attribute. Otherwise, the absolute_name is formed by concatenating the absolute_name attribute of the
object referenced by this object’s defined_in attribute, the string “::?, and this object’s name attribute.
The containing_repository attribute identifies the Repository that is eventually reached by recursively following the object’s
defined_in attribute.
The within operation returns the list of objects that contain the object. If the object is an interface or module it can be
contained only by the object that defines it. Other objects can be contained by the objects that define them and by the objects
that inherit them.
The describe operation returns a structure containing information about the interface. The description structure associated
with each interface is provided below with the interface’s definition. The kind of definition described by name of the structure
returned is provided with the returned structure. The kind field of the returned Description struct shall give the DefinitionKind
for the most derived type of the object. For example, if the describe operation is invoked on an attribute object, the kind
field contains dk_Attribute name field contains “AttributeDescription? and the value field contains an any, which contains
the AttributeDescription structure. The kind field in this must contain dk_attribute and not the kind of any IRObject from
which the attribute object is derived. For example returning dk_all would be an error.
10.5.3.2 Write Interface
Setting the id attribute changes the global identity of this definition. A BAD_PARAM exception is raised with minor code 2
if an object with the specified id attribute already exists within this object’s Repository.
Setting the name attribute changes the identity of this definition within its Container. A BAD_PARAM exception is raised with
minor code 1 if an object with the specified name attribute already exists within this object’s Container. The absolute_name
attribute is also updated, along with any other attributes that reflect the name of the object. If this object is a Container,
the absolute_name attribute of any objects it contains are also updated.
The move operation atomically removes this object from its current Container, and adds it to the Container specified by new_container
must satisfy the following conditions:
• It must be in the same Repository. If it is not, then BAD_PARAM exception is raised with minor code 4.
• It must be capable of containing this object’s type (see Section 10.4.4, “Structure and Navigation of the Interface Repository,? on page 10-8). If it is not, then BAD_PARAM exception is raised with minor code 4.
• It must not already contain an object with this object’s name (unless multiple versions are supported by the IR). If this condition is not satisfied, then BAD_PARAM exception is raised with minor code 3.
The name attribute is changed to new_name, and the version attribute is changed to new_version.
The defined_in and absolute_name attributes are updated to reflect the new container and name. If this object is also a Container,
the absolute_name attributes of any objects it contains are also updated.