CASM
1.1.0
A Clusters Approach to Statistical Mechanics
|
#include <Handlers.hh>
This is the base class to be used for every casm option. The purpose of this is to provide a way to generate standard suboptions, such as requesting a supercell name, specifying a coordinate mode, or asking for an output file. Derived classes will hold all the required variables for po::options_description construction that get passed by referenced and parsed from command line input.
Shortcuts:
Definition at line 229 of file Handlers.hh.
Public Member Functions | |
OptionHandlerBase (const std::string &init_option_tag) | |
Define the name of the command during construction. More... | |
OptionHandlerBase (const std::string &init_option_tag, const std::string &init_descriptor) | |
More explicit initialization. More... | |
po::variables_map & | vm () |
Get the variables map. More... | |
const po::variables_map & | vm () const |
Get the variables map. More... | |
const po::options_description & | desc () |
Get the program options, filled with the initialized values. More... | |
const po::options_description & | desc () const |
Get the program options, filled with the initialized values. More... | |
const std::string & | tag () const |
Protected Member Functions | |
virtual void | initialize ()=0 |
Fill in the options descriptions accordingly. More... | |
void | add_selection_suboption (const fs::path &_default="MASTER") |
Add –selection suboption (defaults to MASTER) More... | |
void | add_selection_no_default_suboption () |
Add –selection suboption (no default) More... | |
void | add_configlist_suboption (const fs::path &_default="MASTER") |
Add –config suboption (defaults to MASTER) More... | |
const fs::path & | selection_path () const |
Returns the string corresponding to add_config_suboption() More... | |
void | add_selections_suboption (const fs::path &_default="MASTER") |
Add –selections suboption (defaults to MASTER) More... | |
void | add_configlists_suboption (const fs::path &_default="MASTER") |
Add –configs suboption (defaults to MASTER) More... | |
const std::vector< fs::path > & | selection_paths () const |
Returns the string corresponding to add_config_suboption() More... | |
void | add_prim_path_suboption (const fs::path &_default="") |
Add –prim suboption. More... | |
const fs::path & | prim_path () const |
Returns the string corsresponding to add_prim_path_suboption() More... | |
void | add_file_path_suboption (const fs::path &_default="") |
Add –path suboption (defaults to MASTER) More... | |
const fs::path & | file_path () const |
Returns the string corsresponding to add_file_path_suboption() More... | |
void | add_configlist_nodefault_suboption () |
Add –config suboption (no default) More... | |
void | add_configlists_nodefault_suboption () |
Add –configs suboption (no default) More... | |
void | add_configtype_suboption (std::string _default, std::set< std::string > _configtype_opts) |
Add –type suboption (default, set of short_name of allowed ConfigTypes) More... | |
std::string | configtype () const |
std::set< std::string > | configtype_opts () const |
void | add_db_type_suboption (std::string _default, std::set< std::string > _configtype_opts) |
std::string | db_type () const |
std::set< std::string > | db_type_opts () const |
void | add_help_suboption () |
Add a plain –help and –desc suboptions. More... | |
void | add_general_help_suboption () |
Add a smart –help suboption that takes "properties" or "operators". More... | |
const std::vector< std::string > & | help_opt_vec () const |
Returns the list of strings corresponding to add_general_help_suboption() More... | |
void | add_verbosity_suboption () |
const std::string & | verbosity_str () const |
Returns the string corresponding to add_verbosity_suboption() More... | |
int | verbosity () const |
Will throw if not expected string or int in range [0, 100]. More... | |
void | add_input_suboption (bool required=true) |
std::string | input_str () const |
Returns the path corresponding to add_input_suboption. More... | |
void | add_settings_suboption (bool required=true) |
const fs::path | settings_path () const |
Returns the path corresponding to add_settings_suboption. More... | |
void | add_output_suboption () |
Add a –output suboption. Expects to allow "STDOUT" to print to screen. More... | |
void | add_output_suboption (const fs::path &_default) |
const fs::path | output_path () const |
Returns the path corresponding to add_output_suboption() More... | |
void | add_gzip_suboption () |
bool | gzip_flag () const |
Returns the value assigned for add_gzip_suboption() More... | |
void | add_scelname_suboption () |
Add a –scelname suboption. More... | |
const std::string & | supercell_str () const |
Returns the name of the supercell for add_scelname_suboption() More... | |
void | add_scelnames_suboption () |
Add a –scelnames suboption. More... | |
const std::vector< std::string > & | supercell_strs () const |
Returns the list of the supercells for add_scelnames_suboption() More... | |
void | add_configname_suboption () |
Add a –configname suboption. More... | |
const std::string & | config_str () const |
void | add_confignames_suboption () |
Add a –confignames suboption. More... | |
const std::vector< std::string > & | config_strs () const |
void | add_names_suboption () |
Add a –names suboption. More... | |
const std::vector< std::string > & | name_strs () const |
void | add_coordtype_suboption () |
Add a –coord suboption to specify FRAC or CART. More... | |
const std::string & | coordtype_str () const |
Return the coordinate type in the form of a string. More... | |
COORD_TYPE | coordtype_enum () const |
Return the coordinate type recasted as the CASM defined enum. More... | |
void | add_dofs_suboption () |
Add a –dofs suboption to specify DoF Types. More... | |
const std::vector< std::string > & | dof_strs () const |
Returns the names of the DoF type names for add_dofs_suboption() More... | |
void | add_dry_run_suboption (std::string msg=default_dry_run_msg()) |
bool | dry_run () const |
Static Protected Member Functions | |
static std::string | default_dry_run_msg () |
Protected Attributes | |
std::string | m_tag |
name of the casm command More... | |
po::options_description | m_desc |
po::variables_map | m_vm |
Boost program options variable map. More... | |
fs::path | m_selection_path |
The selection string to go with add_config_suboption. More... | |
std::vector< fs::path > | m_selection_paths |
The selection string to go with add_config_suboption. More... | |
fs::path | m_prim_path |
The path string to go with add_prim_path_suboption. More... | |
fs::path | m_file_path |
The path string to go with add_file_path_suboption. More... | |
std::string | m_configtype |
User-specified config type. More... | |
std::set< std::string > | m_configtype_opts |
Set of valid config types. More... | |
std::string | m_db_type |
User-specified config type. More... | |
std::set< std::string > | m_db_type_opts |
Set of valid config types. More... | |
std::vector< std::string > | m_help_opt_vec |
The list of strings to go with add_general_help_suboption() More... | |
std::string | m_verbosity_str |
The verbosity string to go with add_config_suboption. More... | |
std::string | m_input_str |
The settings path to go with add_input_suboption() More... | |
fs::path | m_settings_path |
The settings path to go with add_settings_suboption() More... | |
fs::path | m_output_path |
The path that goes with add_output_suboption. More... | |
bool | m_gzip_flag |
The bool that goes with add_gzip_suboption. More... | |
std::string | m_supercell_str |
The string of the supercell name of add_scelname_suboption() More... | |
std::vector< std::string > | m_supercell_strs |
The list of supercell names of add_scelnames_suboption() More... | |
std::string | m_config_str |
The name of a single configname to go with add_configname_suboption() More... | |
std::vector< std::string > | m_config_strs |
The list of the supercell names of add_configname_suboption() More... | |
std::vector< std::string > | m_name_strs |
The list of the supercell names of add_configname_suboption() More... | |
std::string | m_coordtype_str |
std::vector< std::string > | m_dof_strs |
The list of DoF type names. More... | |
CASM::Completer::OptionHandlerBase::OptionHandlerBase | ( | const std::string & | init_option_tag | ) |
Define the name of the command during construction.
Definition at line 298 of file Handlers.cc.
CASM::Completer::OptionHandlerBase::OptionHandlerBase | ( | const std::string & | init_option_tag, |
const std::string & | init_descriptor | ||
) |
More explicit initialization.
Definition at line 303 of file Handlers.cc.
|
protected |
Add –config suboption (no default)
Definition at line 467 of file Handlers.cc.
|
protected |
Add –config suboption (defaults to MASTER)
Definition at line 431 of file Handlers.cc.
|
protected |
Add –configs suboption (no default)
Definition at line 478 of file Handlers.cc.
|
protected |
Add –configs suboption (defaults to MASTER)
Definition at line 455 of file Handlers.cc.
|
protected |
Add a –configname suboption.
Definition at line 677 of file Handlers.cc.
|
protected |
Add a –confignames suboption.
Definition at line 691 of file Handlers.cc.
|
protected |
Add –type suboption (default, set of short_name of allowed ConfigTypes)
Definition at line 511 of file Handlers.cc.
|
protected |
Add a –coord suboption to specify FRAC or CART.
Definition at line 725 of file Handlers.cc.
|
protected |
Add –type suboption (default, set of short_name of allowed DataObject Types)
Definition at line 536 of file Handlers.cc.
|
protected |
Add a –dofs suboption to specify DoF Types.
Definition at line 737 of file Handlers.cc.
|
protected |
Definition at line 749 of file Handlers.cc.
|
protected |
Add –path suboption (defaults to MASTER)
Definition at line 490 of file Handlers.cc.
|
protected |
Add a smart –help suboption that takes "properties" or "operators".
Definition at line 567 of file Handlers.cc.
|
protected |
Add a –gzip suboption. The value will default to false unless overridden by the derived class.
Definition at line 648 of file Handlers.cc.
|
protected |
Add a plain –help and –desc suboptions.
Definition at line 561 of file Handlers.cc.
|
protected |
Add a –input suboption. Expects a corresponding casm format
to go with it.
Definition at line 610 of file Handlers.cc.
|
protected |
Add a –names suboption.
Definition at line 706 of file Handlers.cc.
|
protected |
Add a –output suboption. Expects to allow "STDOUT" to print to screen.
Definition at line 626 of file Handlers.cc.
|
protected |
Add a –output suboption, with default value. Expects to allow "STDOUT" to print to screen.
Definition at line 635 of file Handlers.cc.
|
protected |
Add –prim suboption.
Definition at line 500 of file Handlers.cc.
|
protected |
Add a –scelname suboption.
Definition at line 654 of file Handlers.cc.
|
protected |
Add a –scelnames suboption.
Definition at line 665 of file Handlers.cc.
|
protected |
Add –selection suboption (no default)
Definition at line 420 of file Handlers.cc.
|
protected |
Add –selection suboption (defaults to MASTER)
Definition at line 407 of file Handlers.cc.
|
protected |
Add –selections suboption (defaults to MASTER)
Definition at line 443 of file Handlers.cc.
|
protected |
Add a –settings suboption. Expects a corresponding casm format
to go with it.
Definition at line 588 of file Handlers.cc.
|
protected |
Add a –verbosity suboption. Default "standard" of "none", "quiet", "standard", "verbose", "debug" or an int 0-100
Definition at line 578 of file Handlers.cc.
|
protected |
Returns the name of the supercell for add_configname_suboption(), for when multiple=false
Definition at line 378 of file Handlers.cc.
|
protected |
Returns the names of the supercells for add_configname_suboption(), for when multiple=false
Definition at line 382 of file Handlers.cc.
|
protected |
Definition at line 530 of file Handlers.cc.
|
protected |
Definition at line 532 of file Handlers.cc.
|
protected |
Return the coordinate type recasted as the CASM defined enum.
Definition at line 398 of file Handlers.cc.
|
protected |
Return the coordinate type in the form of a string.
Definition at line 394 of file Handlers.cc.
|
protected |
Definition at line 555 of file Handlers.cc.
|
protected |
Definition at line 557 of file Handlers.cc.
|
staticprotected |
Definition at line 753 of file Handlers.cc.
const po::options_description & CASM::Completer::OptionHandlerBase::desc | ( | ) |
Get the program options, filled with the initialized values.
Check if there are any program options in the options description. If there aren't, then this is the first time someone is asking for those values, which we set through the initialize routine. If there are values there already, just hand them back.
Definition at line 321 of file Handlers.cc.
const po::options_description & CASM::Completer::OptionHandlerBase::desc | ( | ) | const |
Get the program options, filled with the initialized values.
Definition at line 329 of file Handlers.cc.
|
protected |
Returns the names of the DoF type names for add_dofs_suboption()
Definition at line 403 of file Handlers.cc.
|
protected |
Definition at line 757 of file Handlers.cc.
|
protected |
Returns the string corsresponding to add_file_path_suboption()
Definition at line 346 of file Handlers.cc.
|
protected |
Returns the value assigned for add_gzip_suboption()
Definition at line 372 of file Handlers.cc.
|
protected |
Returns the list of strings corresponding to add_general_help_suboption()
Definition at line 374 of file Handlers.cc.
|
protectedpure virtual |
Fill in the options descriptions accordingly.
Implemented in CASM::Completer::UpdateOption, CASM::Completer::RmOption, CASM::Completer::SelectOption, CASM::Completer::ImportOption, CASM::Completer::QueryOption, CASM::Completer::InfoOption, CASM::Completer::EnumOption, CASM::Completer::SymOption, CASM::Completer::EnumOptionBase, CASM::Completer::ViewOption, CASM::Completer::SuperOption, CASM::Completer::StatusOption, CASM::Completer::SettingsOption, CASM::Completer::PerturbOption, CASM::Completer::InitOption, CASM::Completer::FormatOption, CASM::Completer::FilesOption, CASM::Completer::RefOption, CASM::Completer::CompositionOption, CASM::Completer::BsetOption, CASM::Completer::RunOption, and CASM::Completer::MonteOption.
|
protected |
Returns the path corresponding to add_input_suboption.
Definition at line 368 of file Handlers.cc.
|
protected |
Returns the names of the supercells for add_configname_suboption(), for when multiple=false
Definition at line 721 of file Handlers.cc.
|
protected |
Returns the path corresponding to add_output_suboption()
Definition at line 370 of file Handlers.cc.
|
protected |
Returns the string corsresponding to add_prim_path_suboption()
Definition at line 348 of file Handlers.cc.
|
protected |
Returns the string corresponding to add_config_suboption()
Definition at line 338 of file Handlers.cc.
|
protected |
Returns the string corresponding to add_config_suboption()
Definition at line 342 of file Handlers.cc.
|
protected |
Returns the path corresponding to add_settings_suboption.
Definition at line 364 of file Handlers.cc.
|
protected |
Returns the name of the supercell for add_scelname_suboption()
Definition at line 386 of file Handlers.cc.
|
protected |
Returns the list of the supercells for add_scelnames_suboption()
Definition at line 390 of file Handlers.cc.
const std::string & CASM::Completer::OptionHandlerBase::tag | ( | ) | const |
The desired name for the casm option (Perhaps this should get tied with CommandArg?)
Definition at line 307 of file Handlers.cc.
|
protected |
Will throw if not expected string or int in range [0, 100].
Definition at line 355 of file Handlers.cc.
|
protected |
Returns the string corresponding to add_verbosity_suboption()
Definition at line 350 of file Handlers.cc.
po::variables_map & CASM::Completer::OptionHandlerBase::vm | ( | ) |
Get the variables map.
Definition at line 310 of file Handlers.cc.
const po::variables_map & CASM::Completer::OptionHandlerBase::vm | ( | ) | const |
Get the variables map.
Definition at line 313 of file Handlers.cc.
|
protected |
The name of a single configname to go with add_configname_suboption()
Definition at line 474 of file Handlers.hh.
|
protected |
The list of the supercell names of add_configname_suboption()
Definition at line 486 of file Handlers.hh.
|
protected |
User-specified config type.
Definition at line 338 of file Handlers.hh.
|
protected |
Set of valid config types.
Definition at line 341 of file Handlers.hh.
|
protected |
The enum value in the form of a string for add_coordtype_suboption(). Only the first letter matters, but knock yourself out.
Definition at line 511 of file Handlers.hh.
|
protected |
User-specified config type.
Definition at line 355 of file Handlers.hh.
|
protected |
Set of valid config types.
Definition at line 358 of file Handlers.hh.
|
mutableprotected |
Boost program options. All the derived classes have them, but will fill them up themselves
Definition at line 260 of file Handlers.hh.
|
protected |
The list of DoF type names.
Definition at line 525 of file Handlers.hh.
|
protected |
The path string to go with add_file_path_suboption.
Definition at line 316 of file Handlers.hh.
|
protected |
The bool that goes with add_gzip_suboption.
Definition at line 441 of file Handlers.hh.
|
protected |
The list of strings to go with add_general_help_suboption()
Definition at line 375 of file Handlers.hh.
|
protected |
The settings path to go with add_input_suboption()
Definition at line 402 of file Handlers.hh.
|
protected |
The list of the supercell names of add_configname_suboption()
Definition at line 498 of file Handlers.hh.
|
protected |
The path that goes with add_output_suboption.
Definition at line 429 of file Handlers.hh.
|
protected |
The path string to go with add_prim_path_suboption.
Definition at line 305 of file Handlers.hh.
|
protected |
The selection string to go with add_config_suboption.
Definition at line 280 of file Handlers.hh.
|
protected |
The selection string to go with add_config_suboption.
Definition at line 294 of file Handlers.hh.
|
protected |
The settings path to go with add_settings_suboption()
Definition at line 414 of file Handlers.hh.
|
protected |
The string of the supercell name of add_scelname_suboption()
Definition at line 452 of file Handlers.hh.
|
protected |
The list of supercell names of add_scelnames_suboption()
Definition at line 463 of file Handlers.hh.
|
protected |
name of the casm command
Definition at line 256 of file Handlers.hh.
|
protected |
The verbosity string to go with add_config_suboption.
Definition at line 387 of file Handlers.hh.
|
protected |
Boost program options variable map.
Definition at line 263 of file Handlers.hh.