CORBA 2.6 Programmer's Guide for C++
Services, stateful and stateless objects, application data in a NonStop SQL/MP database, and writing multithreaded
applications.
Note:
The make utility is vital in combining your program modules into a coherent application and enabling you to
maintain individual modules. For detailed information, refer to the Open System Services User's Guide and to the
Make (1) utility reference page either online or in the Open System Services Shell and Utilities Reference Manual.
Special Considerations for Building Transactional Clients and Servers
When building a transactional CORBA application with the Object Transaction Service (OTS), it is necessary to have access to
the CosTransactions::Current interface and a communications stub for the NonStop Transaction Manager (NSotsTM
process). During development you accomplish access by including declarations from the file CosTransactions.idl and
deriving objects that execute within transactional boundaries from TransactionalObject. Note that
TransactionalObject will be replaced in the future by the OTSPolicy component.
When building a C++ application, you accomplish access by including the file $NSD_ROOT/lib/nsdots.o in the link
step. To see an example of building a transactional client and server, consult the ots_bank sample program.
See Managing Transactions for additional information and design considerations for transactional applications.
Using the IDL Compiler
This section describes the NonStop CORBA Interface Definition Language (IDL) compiler. You use the IDL compiler to
generate language bindings from the interface definitions you have written in IDL for your CORBA application. (The NonStop
CORBA 2.6 IDL compiler was implemented using the ANTLR parser-generator. For information about ANTLR see
www.antlr.org.)
IDL Compiler Processing
To simply run the NonStop CORBA IDL compiler alone, you invoke the $NSD_ROOT/bin/nsdidl script with options and
specify one or more IDL files. These files contain IDL definitions and can also include preprocessor directives. Refer to IDL
Compiler Syntax for a complete description of the nsdidl command and associated options.
Preprocessing
OMG IDL preprocessing uses an ANSI C++ preprocessor to provide macro substitution, conditional compilation, and
source-file inclusion. Preprocessor directives can also provide line numbering for diagnostic messages and symbolic
debugging, and support implementation-dependent actions (the #pragma directive). Preprocessing directives begin with a
pound sign (#). Consult your ANSI C++ preprocessor documentation for further information.
The default preprocessor invoked by the IDL compiler is called cfe. You can use the -preprocessor flag to specify a
different preprocessor to be invoked by the IDL compiler.
To use the default preprocessor, the directory containing cfe must be in the PATH environment variable. For example, to use
the /usr/lib/cfe preprocessor, execute the following command from the command line or add it to your OSS .profile
or env.sh file:
export PATH=$PATH:/usr/lib
Note:
If you change your .profile file, be sure to source it in for the changes to take effect.
IDL Compiler Syntax
Preliminary IDL Compiler Setup
The IDL compiler is a Java application packaged in the $NSD_ROOT/idl/nsdidl.jar file. This jar file contains all
necessary compiler class files.