11.2 The Fundamental Data Structures within FieldUtils

This sections aim to provide a detailed description of the data structures within the FieldUtils directory and how they are used by FieldConvert.

11.2.1 Overview of how modules work

A specific module is identified by a ModuleKey, a type defined as a std::pair consisting of a ModuleType and std::string. ModuleType is an enum that has members eInputModule, eProcessModule, and eOutputModule, corresponding to whether it is an input, process, or output module respectively. The std::string is referred to in this document as the module string. 1 For example, for the InputFld module, the ModuleType is eInputModule, and the module string is fld. The instantiation of a particular module follows the factory pattern, with the ModuleKey and a shared pointer to a Field object passed as arguments to Module::GetModuleFactory().CreateInstance. This shared pointer to the Field object is stored as a member variable of Module called m_f.

Some modules have configuration options, which are stored in the m_config member variable of Module, which is a std::map with the key being a string holding the option name and the value being a ConfigOption object (described below). The configuration options for the input and output modules simply refer to the name of the input and output file respectively m_config is initialised in the module’s constructor by calling the ConfigOption constructor, and its value is set by Module::RegisterConfig. The Moduel::SetDefaults function sets default configuration options for those which have not been set.

Each module has a function named Process, whether defined in its own class definition or in that of its parent class, which implements the main functionality of the module. To run a module refers to calling Process. Process typically operates on member variables of m_f. Each module also has a certain priority, which dictates in what order it should be run in relation to other modules, which is captured by a member of the ModulePriority enum, defined in Module.h. The available module priorities are eCreateGraph, eCreateFieldData, eModifyFieldData, eCreateExp, eFillExp, eModifyExp, eBndExtraction, eCreatePts,eConvertExpToPts, eModifyPts, and eOutput.

What follows is detailed description of the member variables and functions of Module, InputModule, ProcessModule, and OutputModule.

11.2.2 Module

Member variables

Member functions

11.2.3 InputModule

Member variables

Member functions

11.2.4 ProcessModule

Member functions

11.2.5 OutputModule

Member variables

Member functions

11.2.6 ConfigOption

This struct is defined Module.h. It represents the properties of a module option.

Member variables

Member functions

11.2.7 The Field struct

The Field struct is essentially a container to hold information about the field variables.

Member variables

Member functions