The ILE C/C++ Compiler supports program development on iSeries systems in both C and C++ programming languages.
C and C++ are two of the programming languages supported by the Integrated Language Environment (ILE). C++ provides additional features to those found in the C language. These features include additional keywords, parameterized types (templates), support of object oriented programming via classes, and stricter type checking.
ILE and OS/400 Operating System Programming Features
C and C++ are two of the programming languages supported in the Integrated Language Environment (ILE). ILE, together with the OS/400 operating system, provides a wide range of support for serious program development.
ILE provides you with advantages in these areas of program development:
Support for multiple programming languages
Program and resource management
Programming Languages Supported by the OS/400 Operating System
ILE is an approach to programming on the iSeries systems. You can build mixed-language programs that are composed of modules written in any ILE programming language. The ILE family of compilers includes: ILE C++, ILE C, ILE RPG, ILE COBOL, and ILE CL. Table lists the programming languages supported by the OS/400 operating system.
Programming Languages Supported by the iSeries family
ILE program creation consists of:
Compiling source code into modules
Binding (combining) one or more modules into a program object.
You can create and maintain mixed-language programs because you can combine modules from any ILE language.
You can create a binding directory to contain the names of modules and service programs that your ILE C++ program or service program may need. A binding directory can reduce program size because modules or service programs listed in a binding directory are used only if needed.
You can bind modules into service programs (*SRVPGM). Service programs are a means of packaging callable routines (functions or procedures) into a separately bound program. The use of service programs provides modularity and improves maintainability. You can use off-the-shelf modules developed by third parties or package your own modules for third-party use. Service programs are created by a compiler option that includes the Create Service Program (CRTSRVPGM) command.
This shows the process of creating an ILE program through compiler and binder invocation.
Program Creation in ILE
Once a program is created, update it using the Update Program (UPDPGM) or Update Service Program (UPDSRVPGM) commands. These commands are useful because you only need to have the new or changed modules available when you want to update the program.
Program and Resource Management
ILE provides a common basis for:
Managing program flow
Using Application Program Interfaces (APIs)
Handling exceptions during a program’s run time
ILE programs and service programs are activated into activation groups you specify at the time you create a program. The process of getting a program or service program ready to run is known as activation. Activation allocates resources within a job so that one or more programs can run in that space. When a program is called, the system activates it into an activation group. If the specified activation group for a program does not exist when the program is called, it is created within the job to hold the program’s activation.
An activation group is the key element in governing an ILE program’s resources and behavior. You can scope commitment-control operations to the activation group level. You can scope file overrides and shared open data paths to the activation group of the running program.The behavior of a program upon termination is affected by the activation group in which the program runs.
In ILE, you can write programs in which ILE C++ programs, OPM and EPM programs interrelate through the use of dynamic program calls. When using such calls, the calling program specifies the name of the called program. This name is resolved to an address at run time, just before the calling program passes control to the called program.
You can write programs which interrelate through faster static procedure calls. A procedure is a self-contained set of code that performs a task and then returns to the caller. An ILE C++ module consists of one or more procedures. Because the procedure names are resolved at bind time (that is, when you create the program), static calls are faster than dynamic calls. Static calls allow operational descriptors. Operational descriptors are used to call bindable APIs or procedures written in other ILE languages.
In ILE, you can perform source-level debugging on any program written in one or more ILE languages, provided program was compiled with debug information. You can control the flow of a program by using debug commands while the program is running. You can set conditional and unconditional breakpoints prior to running the program. After calling the program, you can step through a specified number of statements and display or change variables. When a program stops because of a breakpoint, a step command, or a run-time error, the pertinent module is displayed at the point where the program stopped. At that point, you can enter more debug commands.
ILE offers a number of bindable APIs that supplement ILE C/C++ functions. Bindable APIs provide program calling and activation capability, condition and storage management, math functions, and dynamic screen management. The System API Reference contains information on bindable APIs.