PreviousNext

Multiple Interfaces and Local Objects: a C++ Enhancement

The bind( ) member function that takes an object reference also works for local interfaces and objects. This means that you can use IDL to specify, implement, and test combinations of local interfaces without the overhead of remote procedure calls. You may find this a useful approach when designing, prototyping, and debugging your interfaces and implementations. The steps are as follows:

1. Create your IDL files by using the uuid and local attributes in the interface headers.

2. Use the IDL compiler with the -lang cxx option to compile the interfaces. The IDL compiler generates only the header files for each interface when the interface has the local attribute. No stubs are generated.

3. Develop the manager class, manager implementations, and static member functions as you would for typical servers.

4. Create a client that includes the idl-generated header files. The client also calls the idl-generated bind( ) function that binds by object reference, to switch between local interfaces.

5. Link together the machine object code for the client, manager class, manager code, and static functions.

6. Test the client application program.