PreviousNext

IDL-Generated Classes as Part of Your Hierarchy

The interface definition is compiled with the following IDL compiler command to generate an intermediate C++ header file, client stub, server stub, and manager class header file: idl -lang cxx matrix.idl

The IDL compiler then automatically invokes the local language compiler by default. In this case it invokes the C++ compiler to create binary stub files that are used in the development of clients and servers.

The IDL compiler automatically uses an Attribute Configuration File (ACF) if one is available in its search directories. C++ applications use an ACF to specify features such as static member functions, implementation class names, a lookup function for named or persistent objects, and header files for inclusion in stub files.

Class hierarchies are created by the IDL compiler and made part of the clients and servers. The hierarchies include an RPC base class that encapsulates the distributed nature of objects. An abstract interface class is also created by the IDL compiler and derived from the RPC base class. The interface class includes the data types and nonstatic member functions of the interface definition and is the common interface used by clients and servers. The interface class contains no implementation. Therefore, clients and servers each need to derive implementation classes from the interface class. Clients have an idl-generated implementation class generated for them, called a proxy class. Servers have an idl-generated class generated for them called a manager class.

Server developers must implement the manager class functions by either modifying the generated manager class header file or deriving an application-specific class from the manager class. The manager class name generated by the IDL compiler is a combination of the interface name and Mgr. For example, the manager class for our Matrix interface is MatrixMgr. The generated class is placed in a header file with a name created from the combination the interface file name and the _mgr suffix. For example, matrix_mgr.h.

If you decide to implement the manager by modify the generated manager class, you want to be sure that any subsequent invocation of the IDL compiler does not overwrite your manager class code.Use the -no_cxxmgr option with the IDL compiler command to suppress generating a manager class.

idl -lang cxx -no_cxxmgr matrix.idl