ILE C/C++ Programmer's Guide


Creating a Program with Circular References


C++ language only
A circular reference is a special case of unresolved import requests. It occurs, for example, when a service program SP1 depends on imports from a service program SP2, which in turn depends on an import from service program SP1.

Figure 14 illustrates the unresolved import requests between program A and two service programs, SP1 and SP2.

Figure 14. Unresolved Import Requests in a Program with Circular References



circref

The following import requests occur between program A and the two service programs, SP1 and SP2, that are called by programA:

  1. Program A uses function func1(), which it imports from service program SP1.
  2. Service program SP1 needs to import function func2() provided by service program SP2, in order to provide func1() to program A.
  3. Service program SP2, in turn, first needs to import func1 from service program SP1 before being able to provide func2.

To create a program with unresolved circular references, perform the following tasks:

  1. Create the source files.
  2. Compile the source files into modules.
  3. Create the binder language.
  4. Bind the modules into the program.


[ Top of Page | Previous Page | Next Page | Table of Contents ]