Overview | The create_enum operation creates a new enumeration definition (EnumDef) in the Interface Repository. |
Original interface | CORBA module: Container Interface |
Exceptions | CORBA::SystemException |
Intended Usage
The create_enum operation creates a new enumeration definition in the Interface Repository persistent database, and returns a pointer to a new EnumDef object associated with the enumeration definition.
Syntax
EnumDef create_enum (in RepositoryId id, in Identifier name, in VersionSpec version, in EnumMemberSeq members);
Input parameters
Return values
Example
// C++ // assume that 'repository_ptr' had already been intitialized . . . CORBA::Repository * repository_ptr; // establish the id, name, and version values for the enumeration CORBA::RepositoryId rep_id; CORBA::Identifier name; CORBA::VersionSpec version; rep_id = CORBA::string_dup ("unique RepositoryID for my enumeration"); name = CORBA::string_dup ("enumeration new"); version = CORBA::string_dup ("1.0"); /// instantiate an EnumMemberSeq and set the length to 2 CORBA::EnumMemberSeq enum_members; enum_members.length(2); // establish the EnumMemberSeq to represent an enumeration with two // elements enum_members[0] = (char *) CORBA::string_dup ("enum_value_0"); enum_members[1] = (char *) CORBA::string_dup ("enum_value_1"); // create the new enumeration . . . CORBA::EnumDef * new_enum; new_enum = repository_ptr-> create_enum (rep_id, name, version, enum_members);