XDA 4.1 Tutorial: Compiling the geom ontology for the tutorials
Purpose: To compile the geom ontology using the
XDA ontology compiler. The generated code will be used in some of the other
tutorials.
Tutorial requirements: Click here
to get descriptions of the software and environment variables.
|
Software | Required |
| Forte |
No |
| .NET |
No |
| Java |
No |
| ACE+TAO |
No |
| JAC |
No |
| ANT |
No |
|
Environment Variable | Required |
| XDA_ROOT |
Yes |
| ACE_ROOT |
No |
| TAO_ROOT |
No |
| ANT_HOME |
No |
| JAVA_HOME |
No |
| JACORB_HOME |
No |
Procedure:
-
Type
ant
in $(XDA_ROOT)/share/onts to provide usage on how to compile
ontologies using the built-in ANT scripts.
-
From the
$(XDA_ROOT)/share/onts directory, type the following.
On windows:
ant cpp -Dont=XDAexamples\geom_ont.gto -Dout.dir=%XDA_ROOT%\XDA\examples\ont -Dinc.dir=%XDA_ROOT%\XDA\examples\ont
On unix:
ant cpp -Dont=XDAexamples/geom_ont.gto -Dout.dir=$XDA_ROOT/XDA/examples/ont -Dinc.dir=$XDA_ROOT/XDA/examples/ont
Where each flag stands for the following
- cpp -- create C++ code
- -Dont -- the ontology that requires compiling
- -Dout.dir -- the location where the .cpp files will be located
- -Dinc.dir -- the location where the .h files will be located
Or, via the ANT-less method
-
This example is run in $(XDA_ROOT)/share/onts. In Windows, run the
following command:
%XDA_ROOT%\XDA\bin\cmplont.exe -out %XDA_ROOT%\XDA\examples\ont -check
%XDA_ROOT%\share\onts\XDAexamples\geom_ont.gto
In Unix, run the following command:
$XDA_ROOT/XDA/bin/cmplont -out $XDA_ROOT/XDA/examples/ont -check
$XDA_ROOT/share/onts/XDAexamples/geom_ont.gto
-
The following files will be genereated in the $(XDA_ROOT)/XDA/examples/ont
directory.
geom_NODE_TYPE.h
geom_POLY_TYPE.h
geom__init.cpp
geom_exp.cpp
geom_exp.h
geom_exp2.cpp
geom_exp2.h
geom_namespace.h
geom_point.cpp
geom_point.h
geom_point_node.cpp
geom_point_node.h
geom_poly.cpp
geom_poly.h
geom_simple_node.cpp
geom_simple_node.h
geom_tagged_point.cpp
geom_tagged_point.h
Discussion: The XDA ontology compiler reads an
ontology definition file as input and outputs header and source files
containing C++ code used to handle generic transport objects (GTOs) belonging
to that ontology.