Defining CORBA bounded strings

You can define CORBA bounded strings and wstrings in your model and have them generated in .idl files.

Procedure

To define a CORBA bounded string or wstring:

  1. Add a new type to a package with the CORBAModule stereotype, or a class with the CORBAInterface stereotype.
  2. Open the Features window for the type you created, and set the Kind field to Typedef.
  3. On the Details tab of the Features window, set the Basic type to string or wstring from the CORBA predefined types.
  4. For the type created, set the value of the CORBA::Type::StringMaximumSize property to the maximum string length that you want to allow. The value can be any positive integer. If you leave the value of the property blank, an unbounded string definition is generated.

Example

If you have followed these steps to define a bounded string, the generated code will resemble the following code:

typedef string<22> lastName;