![]() |
Overview The contents operation returns the list of objects directly contained by or inherited into the object. Original interface CORBA module: Container Interface Exceptions CORBA::SystemException
Intended Usage
The contents operation can be used to navigate through the hierarchy of objects. Starting with the Repository object, a client uses this operation to list all of the objects contained by the Repository, all of the objects contained by the modules within the Repository, all of the interfaces within a specific module, and so on.
IDL Syntax
ContainedSeq contents (in DefinitionKind limit_type in boolean exclude_inherited);
Input parameters
- exclude_inherited
An object can be contained within another object because it is defined within the containing object (for example, an interface is contained within a module). It may also be defined as contained because it is inherited by the containing object (for example, an operation may be contained by an interface because the interface inherits the operation from another interface).
When exclude_inherited is TRUE, inherited objects, if present, are not returned. If exclude_inherited is FALSE, all contained objects (whether contained due to inheritance or because they were defined within the object) are returned.
- limit_type
- If the limit_type is set to CORBA::dk_all, objects of all interface types are returned. For example, if this is an InterfaceDef, the attribute, operation, and exception objects are returned. If limit_type is set to a specific interface, only objects of that interface type are returned. For example, only attribute objects are returned if limit_type is set to CORBA::dk_Attribute. The accepted values for limit_type are: CORBA::dk_all, CORBA::Attribute, CORBA::dk_Constant, CORBA::dk_Exception, CORBA::dk_Interface, CORBA::dk_Module, CORBA::dk_Operation, CORBA::dk_Typedef, CORBA::dk_Alias, CORBA::dk_Struct, CORBA::dk_Union, and CORBA::dk_Enum.
Return values
- ContainedSeq *
- The returned value is a pointer to a ContainedSeq that is the list of Contained objects retrieved from the Interface Repository based upon the input criteria. The memory associated with the ContainedSeq is owned by the caller. The caller can invoke delete on the ContainedSeq * to delete the memory when no longer needed.
Example
// C++ // assume that 'repository_ptr' has already been initialized CORBA::Repository * repository_ptr; // retrieve all the objects conained by the Repository CORBA::ContainedSeq * returned_sequence; returned_sequence = repository_ptr-> contents (CORBA::dk_all, 0);