Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
Nektar::FieldUtils::ConfigOption Struct Reference

Represents a command-line configuration option. More...

#include <Module.h>

Collaboration diagram for Nektar::FieldUtils::ConfigOption:
Collaboration graph
[legend]

Public Member Functions

 ConfigOption (bool isBool, string defValue, string desc)
 Construct a new configuration option. More...
 
 ConfigOption ()
 
template<typename T >
as ()
 Re-interpret the value stored in #value as some type using boost::lexical_cast. More...
 

Public Attributes

bool m_isBool
 True if the configuration option is a boolean (thus does not need additional arguments). More...
 
bool m_beenSet
 True if the configuration option has been set at command line. If false, the default value will be put into #value. More...
 
string m_value
 The value of the configuration option. More...
 
string m_defValue
 Default value of the configuration option. More...
 
string m_desc
 Description of the configuration option. More...
 

Detailed Description

Represents a command-line configuration option.

Definition at line 81 of file FieldUtils/Module.h.

Constructor & Destructor Documentation

Nektar::FieldUtils::ConfigOption::ConfigOption ( bool  isBool,
string  defValue,
string  desc 
)
inline

Construct a new configuration option.

Parameters
isBoolTrue if the option is boolean type.
defValueDefault value of the option.
descDescription of the option.

Definition at line 90 of file FieldUtils/Module.h.

91  : m_isBool(isBool), m_beenSet(false), m_value(), m_defValue(defValue),
92  m_desc(desc)
93  {
94  }
string m_desc
Description of the configuration option.
string m_value
The value of the configuration option.
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...
bool m_isBool
True if the configuration option is a boolean (thus does not need additional arguments).
Nektar::FieldUtils::ConfigOption::ConfigOption ( )
inline

Definition at line 95 of file FieldUtils/Module.h.

96  : m_isBool(false), m_beenSet(false), m_value(), m_defValue(), m_desc()
97  {
98  }
string m_desc
Description of the configuration option.
string m_value
The value of the configuration option.
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...
bool m_isBool
True if the configuration option is a boolean (thus does not need additional arguments).

Member Function Documentation

template<typename T >
T Nektar::FieldUtils::ConfigOption::as ( )
inline

Re-interpret the value stored in #value as some type using boost::lexical_cast.

Definition at line 104 of file FieldUtils/Module.h.

105  {
106  try
107  {
108  return boost::lexical_cast<T>(m_value);
109  }
110  catch (const exception &e)
111  {
112  cerr << e.what() << endl;
113  abort();
114  }
115  }
string m_value
The value of the configuration option.

Member Data Documentation

bool Nektar::FieldUtils::ConfigOption::m_beenSet

True if the configuration option has been set at command line. If false, the default value will be put into #value.

Definition at line 122 of file FieldUtils/Module.h.

string Nektar::FieldUtils::ConfigOption::m_defValue

Default value of the configuration option.

Definition at line 126 of file FieldUtils/Module.h.

string Nektar::FieldUtils::ConfigOption::m_desc

Description of the configuration option.

Definition at line 128 of file FieldUtils/Module.h.

bool Nektar::FieldUtils::ConfigOption::m_isBool

True if the configuration option is a boolean (thus does not need additional arguments).

Definition at line 119 of file FieldUtils/Module.h.

string Nektar::FieldUtils::ConfigOption::m_value

The value of the configuration option.

Definition at line 124 of file FieldUtils/Module.h.