36 #ifndef FIELDUTILS_MODULE
37 #define FIELDUTILS_MODULE
56 namespace po = boost::program_options;
91 : m_isBool(isBool), m_beenSet(false), m_value(), m_defValue(defValue),
96 : m_isBool(false), m_beenSet(false), m_value(), m_defValue(), m_desc()
104 template <
typename T> T
as()
108 return boost::lexical_cast<T>(m_value);
110 catch (
const exception &e)
112 cerr << e.what() << endl;
140 : m_f(p_f), m_requireEquiSpaced(false)
143 virtual void Process(po::variables_map &vm) = 0;
145 virtual std::string GetModuleName() = 0;
153 return m_requireEquiSpaced;
158 m_requireEquiSpaced = pVal;
242 : CommSerial(argc, argv)
246 m_type =
"FieldConvert parallel";
252 m_type =
"FieldConvert parallel";
260 m_commRow = boost::shared_ptr<FieldConvertComm>(
boost::shared_ptr< InputModule > InputModuleSharedPtr
ConfigOption(bool isBool, string defValue, string desc)
Construct a new configuration option.
map< string, ConfigOption > m_config
List of configuration values.
virtual ~FieldConvertComm()
Represents a command-line configuration option.
T as()
Re-interpret the value stored in #value as some type using boost::lexical_cast.
std::ostream & operator<<(std::ostream &os, const ModuleKey &rhs)
LibUtilities::NekFactory< ModuleKey, Module, FieldSharedPtr > ModuleFactory
string m_desc
Description of the configuration option.
pair< ModuleType, string > ModuleKey
FieldConvertComm(int argc, char *argv[], int size, int rank)
FIELD_UTILS_EXPORT bool GetRequireEquiSpaced(void)
boost::shared_ptr< Module > ModuleSharedPtr
const char *const ModuleTypeMap[]
bool v_TreatAsRankZero(void)
boost::shared_ptr< Field > FieldSharedPtr
boost::shared_ptr< Expansion > ExpansionSharedPtr
string m_value
The value of the configuration option.
#define FIELD_UTILS_EXPORT
ofstream m_fldFile
Output stream.
void v_SplitComm(int pRows, int pColumns)
string m_defValue
Default value of the configuration option.
bool m_beenSet
True if the configuration option has been set at command line. If false, the default value will be pu...
FieldConvertComm(int size, int rank)
Abstract base class for processing modules.
FIELD_UTILS_EXPORT void SetRequireEquiSpaced(bool pVal)
bool m_isBool
True if the configuration option is a boolean (thus does not need additional arguments).
bool v_RemoveExistingFiles(void)
Abstract base class for output modules.
ProcessModule(FieldSharedPtr p_f)
Provides a generic Factory class.
ModuleFactory & GetModuleFactory()
FIELD_UTILS_EXPORT Module(FieldSharedPtr p_f)