Support classes

Support classes are tools that complement the resource classes: they make life easier for the application programmer and thus add value to the object model.

Figure 1. Support classes
  • IccBase
    • IccBuf
    • IccEvent
    • IccException
    • IccMessage
    • IccRecordIndex
    • IccKey
    • IccRBA
    • IccRRN
    • IccResource
    • IccTime
    • IccAbsTime
    • IccTimeInterval
    • IccTimeOfDay
Table 1. Functions provided by support classes
Class Description
IccAbsTime Absolute time (milliseconds since January 1 1900)
IccBuf Data buffer (makes manipulating data areas easier)

The IccBuf class allows easy manipulation of buffers, such as file record buffers, transient data record buffers, and COMMAREAs. For more information about IccBuf class, see Buffer objects.

IccEvent Event (the outcome of a CICS® command)

The IccEvent class allows a programmer to gain access to information relating to a particular CICS event (command).

IccException Foundation Class exception (supports the C++ exception handling model)

IccException objects are thrown from many of the methods in the Foundation Classes when an error is encountered.

IccMessage IccMessage class is used primarily by IccException class to encapsulate a description of why an exception was thrown. The application programmer can also use IccMessage to create their own message objects.
IccTimeInterval Time interval (for example, five minutes)
IccTimeOfDay Time of day (for example, five minutes past six)

Time measurements and example

IccAbsTime, IccTimeInterval and IccTimeOfDay classes make it simpler for the application programmer to specify time measurements as objects within an application program. IccTime is a base class; IccAbsTime, IccTimeInterval, and IccTimeOfDay are derived from IccTime.

Consider method delay in class IccTask, whose signature is as follows:
void delay(const IccTime& time, const IccRequestId*
reqId = 0);
To request a delay of 1 minute and 7 seconds (that is, a time interval), the application programmer can do this:
IccTimeInterval time(0, 1, 7);
task()->delay(time);
Alternatively, to request a delay until 10 minutes past twelve (lunchtime?), the application programmer can do this:
IccTimeOfDay lunchtime(12, 10);
task()->delay(lunchtime);
Note: The task method is provided in class IccControl and returns a pointer to the application's task object.