Setting and Getting Values of Parameter Objects 

For all parameter classes ( CRfcSimpleParam, CRfcStructParam, CRfcTableParam), setting or getting individual field values is done through use of an auxiliary class, CRfcData.

A CRfcData class object represents a single value of an RFC data type. It carries in itself some type-related information, such as the data type, the number of bytes the type needs, and the number of decimal points. The CRfcData object also carries a pointer to a block of memory where the value of the data it represents resides.

The CRfcData class has two sets of operators to enable it to represent any RFC data type and to allow automatic type conversion when setting or getting values of the data it represents.

One set of operators are assignment operators (operator =) that take various types of data as right-hand-side values. These include:

These operators allow values to be written into the data represented by the CRfcData object. Data type-checking is done automatically. For example, operator = with const char* on the right-hand-side is only allowed when the data type carried with the CRfcData object is of a character string type.

The other set of operators are conversion operators that take various types of variables as left-hand-side parameters:

These operators allow values to be read from the data represented by the CRfcData object and assigned to the user-provided left-hand-side variable. Data type-checking is again automatically done. For example, operator RFC_INT is only allowed when the data type carried with the CRfcData object is of the RFC_INT type.

The method names for setting and getting actual values of the three basic types of parameters are:

Each of these methods finds out the necessary type information related to the parameter/field in question, sets up an CRfcData object with the type information, points the CRfcData object’s inner data pointer to the appropriate memory, and returns a reference to this object, whose appropriate operator is then called depending on the operation.