![]() |
Overview The create_string operation is used to create a new StringDef to represent a bounded string. Original interface Repository Interface Exceptions CORBA::SystemException
Intended Usage
The create_string operation returns a new StringDef with the specified bound, that must be non-zero.
Note: Unbounded strings are represented by using the get_primitive operation to create a PrimitiveDef with a kind of CORBA::pk_string.
IDL Syntax
StringDef create_string (in unsigned long bound);
Input parameters
- bound
- The bound parameter represents the bound (the maximum number of characters in the string) of the bounded string. The value must be greater than zero.
Return values
- StringDef_ptr
- The returned value is a pointer to a CORBA::StringDef object with the specified bound. The memory associated with the object is owned by the caller and can be released by invoking CORBA::release.
Example
// C++ // assume that 'repository_ptr' has already been initialized CORBA::Repository * repository_ptr; // create a bounded string with a bound of 51 CORBA::ULong bound_of_string = 51; CORBA::StringDef * string_def_ptr; string_def_ptr = repository_ptr-> create_string (bound_of_string);