![]() |
Overview The create_interface operation is used to create a new interface definition (InterfaceDef) within the Interface Repository. Original interface CORBA module: Container Interface Exceptions CORBA::SystemException
Intended Usage
The create_interface operation returns a new empty InterfaceDef with the specified base_interfaces. Type, exception, and constant definitions can be added using the Container::create_, Container::create_exception, and Container::create_constant operations respectively on the new InterfaceDef. OperationDefs can be added using InterfaceDef::create_operation and AttributeDefs can be added using Interfacedef::create_attribute. Definitions can also be added using the Contained::move operation.
IDL Syntax
InterfaceDef create_interface (in RepositoryId id, in Identifier name, in VersionSpec version, in InterfaceDefSeq base_interfaces);
Input parameters
- name
- The name that will be associated with this InterfaceDef object in the Interface Repository.
- base_interface
- The base_interfaces parameter lists all of the interfaces from which this interface inherits.
- id
- The id represents the CORBA::RepositoryId that will uniquely identify this InterfaceDef within the Interface Repository.
- version
- The version number that will be associated with this InterfaceDef object in the Interface Repository.
Return values
- InterfaceDef_ptr
- A pointer to the created InterfaceDef object is returned to the caller. The memory associated with this object can later be released by invoking CORBA::release.
Example
// C++ // assume that 'module_1', 'interface_A', and 'interface_B' // have already been initialized CORBA::ModuleDef * module_1; CORBA::InterfaceDef * interface_A; CORBA::InterfaceDef * interface_B; // establish the id, name, and version values for the interface CORBA::RepositoryId rep_id; CORBA::Identifier name; CORBA::VersionSpec version; rep_id = CORBA::string_dup ("unique RepositoryID for my interface"); name = CORBA::string_dup ("interface_C"); version = CORBA::string_dup ("1.0"); // establish the base interfaces from which the new interface will // inherit CORBA::InterfaceDefSeq base_interfaces; base_interfaces.length(2); base_interfaces[0] = CORBA::InterfaceDef::_duplicate (interface_A); base_interfaces[1] = CORBA::InterfaceDef::_duplicate (interface_B); // create a new interface 'interface_C' . . . CORBA::InterfaceDef * interface_C; interface_C = module_1-> create_interface (rep_id, name, version, base_interfaces);