49 "Remove one of the existing fields");
54 ConfigOption(
false,
"NotSet",
"Name for field to be removed, required");
64 string fieldNames =
m_config[
"fieldname"].as<
string>();
65 vector<string> fieldName;
66 ASSERTL0(fieldNames !=
"NotSet",
"A fieldname is required");
69 "Failed to interpret fields string");
73 for (
int i = 0; i < fieldName.size(); ++i)
78 ASSERTL0(it !=
m_f->m_variables.end(),
"Field does not exist");
80 int fieldID = std::distance(
m_f->m_variables.begin(), it);
82 m_f->m_variables.erase(it);
83 m_f->m_exp.erase(
m_f->m_exp.begin() + fieldID);
85 if (
m_f->m_comm->GetSpaceComm()->TreatAsRankZero())
87 cout <<
"Field " << fieldName[i] <<
" has been erased" << endl;
#define ASSERTL0(condition, msg)
FieldSharedPtr m_f
Field object.
std::map< std::string, ConfigOption > m_config
List of configuration values.
Abstract base class for processing modules.
void v_Process(po::variables_map &vm) override
static std::shared_ptr< Module > create(FieldSharedPtr f)
Creates an instance of this class.
ProcessRemoveField(FieldSharedPtr f)
~ProcessRemoveField() override
static ModuleKey className
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static bool GenerateVector(const std::string &str, std::vector< T > &out)
Takes a comma-separated string and converts it to entries in a vector.
std::shared_ptr< Field > FieldSharedPtr
std::pair< ModuleType, std::string > ModuleKey
ModuleFactory & GetModuleFactory()
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
Represents a command-line configuration option.