This document only provides a high-level explanation of the classes involved in the software. For detailed descriptions of the classes, their member functions and member data look at this .
The Preprocessor part of the PQPFVS was built to resemble the Builder Pattern (Gamma, et al. 1995). The idea behind the Builder Pattern is that an interface is specified for an operation. Then, various different ways of carrying out the operation can be implemented without impacting the other parts of the system. For the PQPFVS the interface in question is the DataFormatter class. Since it was known at the outset that a variety of different methods for formatting grids would be necessary, the DataFormatter class was made abstract. The two classes that use the DataFormatter, namely ForecastHandler and ObservationHandler interact only with the specified interface, while the actual work being done is by a subclass of DataFormatter that was specified as input to either of the handler classes.
There are two data classes that are used to pass different forms of data between classes, they are:
The requests for Grid objects come from ForecastHandler and ObservationHandler (which will be referred to as the handlers). The handlers are constructed by the user according to what Forecasts or Observations are desired. The handlers request specific Grids from the DbInterface and then ask the specified DataFormatter to format the Grids into Areas. This generally means that a particular basin is extracted from the Grid and returned in the form of an Area. These Areas are then used to construct either Forecasts or Observations depending on which handler was called. The result is that a ForecastHandler object will have a vector of Forecasts available and an ObservationHandler object will have a vector of Observations available. Both ForecastHandler and ObservationHandler are children of the GridDataHandler template class. This class implements are large amount of the common functionality between the two handler classes.
The Forecast class creates a PQPF given raw forecast data and the Observation class combines the hourly observational data into a usable format.
The DataFormatter class is an abstract base class that provides an interface for different formatting methods. Two formatting methods that have been implemented to this point are Squares and Basins. Squares simply divides a Grid into Areas in the shape of a square of specifiable size. Basins creates Areas for particular basins and sub-basins from the Grids.
Each of these classes is constructed using a ForecastHandler, an ObservationHandler and beginning and ending dates. The beginning and ending dates are used so that a subset of the days specified by the two handlers can be used for verification. This allows multiple subsets of days to be verified while only reading and formatting the data once.
The GenericException is an abstract class. The intent is that GenericException be subclassed for different types of exceptions. For instance if there is a problem reading the database an ExternalException will be thrown since the database is third-party software and external to this software. Another example would be if the number of grids returned by the data base was incorrect (say 20 observational grids for a day, and hence 4 short) a MissingDataException would be thrown. This allows for simple and flexible exception handling.
The Debug class is a simple class that allows for debug information to be written in different ways without necessitating recompilation. A value is specified in the $APPS_DEFAULTS configuration file and all debug statements with values less than or equal to the value specified will be written out.
Riemann is actually only a single function. This template function calculates the Riemann summation (integral estimation) for an arbitrary function over an arbitrary range (with the exception of handling infinity) for an arbitrary degree of precision (you're only limited by time!). The function takes a predicate class as an argument and type for the class. The operator() for this class is called by riemann() and is the function that is being integrated. Also specified in the arguments is the range over which the integration occurs and the number of slices in which to divide the range.
Tostring is another template function. This class takes any class with an operator<< defined for it, takes the output from operator<< and casts it to a string by passing it through a strstream.
Gamma, E., Helm, R., Johnson, R., Vlissides, J., 1995: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, 97-106.