CORBA 2.6 Programmer's Guide for C++
Create an object implementation header file based on information found in the server skeleton header.●
Create the server main program and object implementation. Code must be written for each method declared in the
IDL interface definition.
●
Compile the server implementation code, producing an object file.●
Compile the server skeleton code produced by the IDL compiler, producing an object file.●
Link the two server implementation files (and any other object, library, or SRL files), to produce a server
program.
●
If using NonStop SQL, you may also need to do an SQL compile of the server program.●
Start the server program. It uses the NonStop CORBA ORB implementation contained in the NonStop CORBA shared
run-time library (SRL).
5.
Start the client application program. It also uses the NonStop CORBA SRL. It makes requests of the object hosted in the
server and receives replies.
6.
Tips for Building NonStop CORBA Application Components
Ensure that the $NSD_ROOT/etc/env.sh file was sourced into the OSS shell environment.1.
Run the NonStop CORBA IDL compiler on all your IDL files to produce header files, client stub files, and server
skeleton files (see Using the IDL Compiler for more information):
nsdidl -language C++ *.idl
Note: Do not modify the compiler-generated files.
Write your own header file that includes the _server.h header generated by the IDL compiler. Make
your interface implementation class inherit from the POA_interface class found in _server.h.
Implement the pure virtual functions that are declared for this class.
2.
Write the client program, server program, and object implementation. Your client program must include
language-specific header files for the objects it will use.
3.
Compile all the source code files, including generated ones, using c89 to produce .o files.4.
Build the client and server executables by linking the .o files with the NonStop CORBA shared run-time library (SRL).5.
Makefiles
The NonStop CORBA sample programs use a Makefile to perform the steps involved in building an application. The Makefile
describes the program dependencies in such a way that all you have to do is run the make command to build all the
components of the application. For example, to build the Stock sample application, be sure you are in the directory containing
the copy of the Stock sample, type:
make
This command builds the interface, the server, the implementation, and finally the client.
To see examples of how you might use Makefiles, refer to the sample programs shipped with the NonStop CORBA product.
The source code for all the samples is in the samples directory. The directory for each sample contains a file called Readme,
which describes how to build, configure, and execute that sample program.
The sample Makefiles use two files that are shipped with NonStop CORBA, macros.mk and rules.mk, which reside in
the $NSD_ROOT/etc directory. The macros.mk file defines macros, and rules.mk defines dependency rules that are
useful for building any NonStop CORBA application.
The samples vary in complexity and illustrate how to use different NonStop CORBA features, such as the Naming and Event