10.4.6 Repository Interface
Repository (shown below) is an interface that provides global
access to the Interface Repository. The Repository object can
contain constants, typedefs, exceptions, interfaces, value types,
value boxes, native types, and modules. As it inherits from
Container, it can be used to look up any definition (whether
globally defined or defined within a module or an interface) either
by name
or by id
.
Since the Repository derives only from Container and not from
Contained, it does not have a RepositoryId associated with it. By
default, it is deemed to have the RepositoryId
“”
(the empty string) for purposes of
assigning a value to the defined_in field of the description
structure of ModuleDef, InterfaceDef, ValueDef, ValueBoxDef,
TypedefDef, ExceptionDef, and ConstantDef that are contained
immediately in the Repository object.
module CORBA {
interface Repository : Container {
Contained lookup_id (in RepositoryId search_id);
TypeCode get_canonical_typecode(in TypeCode tc);
PrimitiveDef get_primitive (in PrimitiveKind kind);
};
};
The lookup_id
operation is used to look up an
object in a Repository, given its RepositoryId
. If the
Repository does not contain a definition for
search_id
, a nil object reference is returned.
The get_canonical_typecode
operation looks up the
TypeCode in the Interface Repository and returns an equivalent
TypeCode that includes all repository IDs, names, and member_names.
If the top level TypeCode does not contain a RepositoryId, such as
array and sequence TypeCodes, or TypeCodes from older ORBs, or if
it contains a RepositoryId that is not found in the target
Repository, then a new TypeCode is constructed by recursively
calling get_canonical_typecode
on each member TypeCode
of the original TypeCode.
The get_primitive
operation returns a reference to
a PrimitiveDef with the specified kind attribute. All PrimitiveDefs
are immutable and are owned by the Repository.
Parent topic: Interface Repository Interfaces