Subsections

Examples

Using the CCM to model IDL statements

This section shows the practical usage of the CCM metamodel library (both the Base IDL and the Component IDL). In its current state, the library can be used to create CCM models in memory and to navigate within these models to get information about the model entities.

Each IDL statement can be modeled using the CCM metamodel library. For example, a parser can read IDL source code and generate the corresponding CCM model. Normally, this CCM model gets passed to a code generator tool to create some sort of component implementation code written in a language like C++, Java, or Python.

Base IDL examples

All examples in this section can be implemented using just the Base IDL library. Only classic CORBA statements may be put into CCM models that only use the Base IDL.


IDL Enum

Example 2.3.1 shows the creation of an IDL enum type. After creating the model, the toString() method is used to print out the model of the enum.


\begin{Example}
% latex2html id marker 494\begin{lrbox}{\fmbox}\begin{minipage...
...x}}\caption{Example enumeration instantiation using the Base IDL.}
\end{Example}


IDL Struct

Example 2.3.2 shows the creation of an IDL struct and two exception types in the method createModel(). The printModel() method in Example 2.3.3 iterates through the model and prints the contained items.





Component IDL examples

All examples in this section require both the Base IDL and Component IDL libraries.

2003-11-09