Method “calcPredefinedCriterion” allows calculation of a pre-defined criterion “hard-coded” in C++. The parameters of the method are:
“CritName”, a String argument that specifies which criterion is required.
“InputValues”, an Array containing the arguments for the calculation. (Each argument may be a DataBase, a String an integer, a real value, a Boolean Value, a Result object, a Group object, ...)
The method returns an Array of “OutputValues” similar to the Array of input arguments.
Note that the arguments that are passed by reference in function calcPredefinedCriterion can be modified in the predefined criterion. Each predefined criterion should be documented, and the possible side effects of the method should be clearly explained.
Some advantages of using predefined criteria are listed below:
The predefined criteria give a lower level access to the FeResPost object at C++ level. This allows operations to be performed on the objects that would be tricky with higher-level language access, and allows optimizations of the computations. (A remarkable example of optimization is presented in section IV.2.4.3.)
As the predefined criteria are provided in a compiled shared library, it becomes possible to hide the implementation to the final user of FeResPost.
Once a predefined criterion is programmed and debugged, it is easier to guarantee that the same calculation is performed with ruby extension, COM component or .NET assembly.
Of course, the adoption of pre-defined criteria has also some disadvantages:
The programming of a criterion in C++ can be difficult and errors difficult to track.
The addition of a criterion, or the modification of an existing criterion requires the re-compilation of FeResPost library.
Also, if a user has developed their own pre-defined criterion, a recompilation of each new version of FeResPost is necessary to include his criterion.
So far, only a limited number of predefined criteria have been included in FeResPost. They are presented in Appendix X.C.2.