本文整理汇总了C++中po::options_description::add_options方法的典型用法代码示例。如果您正苦于以下问题:C++ options_description::add_options方法的具体用法?C++ options_description::add_options怎么用?C++ options_description::add_options使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类po::options_description
的用法示例。
在下文中一共展示了options_description::add_options方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: inflate_initializer
void inflate_initializer(po::options_description& inflate_desc)
{
UtilityProgramOptions::add_help_suboption(inflate_desc);
UtilityProgramOptions::add_desc_suboption(inflate_desc);
UtilityProgramOptions::add_output_suboption(inflate_desc);
inflate_desc.add_options()("structure,s", po::value<fs::path>()->required(),
"POS.vasp like file you want to "
"increase the boundaries of");
inflate_desc.add_options()("length,l", po::value<std::vector<double>>()->multitoken()->required(),
"amount that each lattice vector will grow (three values "
"corresponding to a, b, and c)");
return;
}
示例2: struc_score_initializer
void struc_score_initializer(po::options_description& struc_score_desc)
{
UtilityProgramOptions::add_help_suboption(struc_score_desc);
UtilityProgramOptions::add_output_suboption(struc_score_desc);
struc_score_desc.add_options()("reference,r", po::value<fs::path>()->required(),
"POS.vasp like file to use as reference structure.");
struc_score_desc.add_options()("mappable,m", po::value<std::vector<fs::path>>()->multitoken(),
"POS.vasp like file(s) to map, get structure score for.");
struc_score_desc.add_options()("batch,b", po::value<fs::path>(),
"Batch file containing list of structures files to get structure score for.");
struc_score_desc.add_options()("weight,w", po::value<double>()->default_value(0.5),
"Weight w in structure score: w*lattice_score + (1-w)*basis_score.");
return;
}
示例3: fill_desc
void option_macros::fill_desc( po::options_description& desc ){
desc.add_options()
( define_tag, po::value< vector<string> >(&defines)->composing(), define_desc )
( predef_tag, po::value< vector<string> >(&predefs)->composing(), predef_desc )
( undef_tag , po::value< vector<string> >(&undefs )->composing(), undef_desc )
;
}
示例4:
// Private methods ---------------------------------
void
uqMonteCarloSGOptionsClass::defineMyOptions(po::options_description& optionsDesc) const
{
optionsDesc.add_options()
(m_option_help.c_str(), "produce help message for Monte Carlo distribution calculator")
(m_option_dataOutputFileName.c_str(), po::value<std::string >()->default_value(UQ_MOC_SG_DATA_OUTPUT_FILE_NAME_ODV ), "name of generic data output file" )
(m_option_dataOutputAllowedSet.c_str(), po::value<std::string >()->default_value(UQ_MOC_SG_DATA_OUTPUT_ALLOWED_SET_ODV ), "subEnvs that will write to generic data output file" )
(m_option_pseq_dataOutputPeriod.c_str(), po::value<unsigned int>()->default_value(UQ_MOC_SG_PSEQ_DATA_OUTPUT_PERIOD_ODV ), "period of message display during param sequence generation" )
(m_option_pseq_dataOutputFileName.c_str(), po::value<std::string >()->default_value(UQ_MOC_SG_PSEQ_DATA_OUTPUT_FILE_NAME_ODV ), "name of data output file for parameters" )
(m_option_pseq_dataOutputFileType.c_str(), po::value<std::string >()->default_value(UQ_MOC_SG_PSEQ_DATA_OUTPUT_FILE_TYPE_ODV ), "type of data output file for parameters" )
(m_option_pseq_dataOutputAllowedSet.c_str(), po::value<std::string >()->default_value(UQ_MOC_SG_PSEQ_DATA_OUTPUT_ALLOWED_SET_ODV), "subEnvs that will write to data output file for parameters" )
#ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
(m_option_pseq_computeStats.c_str(), po::value<bool >()->default_value(UQ_MOC_SG_PSEQ_COMPUTE_STATS_ODV ), "compute statistics on sequence of parameter" )
#endif
(m_option_qseq_dataInputFileName.c_str(), po::value<std::string >()->default_value(UQ_MOC_SG_QSEQ_DATA_INPUT_FILE_NAME_ODV ), "name of data input file for qois" )
(m_option_qseq_dataInputFileType.c_str(), po::value<std::string >()->default_value(UQ_MOC_SG_QSEQ_DATA_INPUT_FILE_TYPE_ODV ), "type of data input file for qois" )
(m_option_qseq_size.c_str(), po::value<unsigned int>()->default_value(UQ_MOC_SG_QSEQ_SIZE_ODV ), "size of qoi sequence" )
(m_option_qseq_displayPeriod.c_str(), po::value<unsigned int>()->default_value(UQ_MOC_SG_QSEQ_DISPLAY_PERIOD_ODV ), "period of message display during qoi sequence generation" )
(m_option_qseq_measureRunTimes.c_str(), po::value<bool >()->default_value(UQ_MOC_SG_QSEQ_MEASURE_RUN_TIMES_ODV ), "measure run times" )
(m_option_qseq_dataOutputPeriod.c_str(), po::value<unsigned int>()->default_value(UQ_MOC_SG_QSEQ_DATA_OUTPUT_PERIOD_ODV ), "period of message display during qoi sequence generation" )
(m_option_qseq_dataOutputFileName.c_str(), po::value<std::string >()->default_value(UQ_MOC_SG_QSEQ_DATA_OUTPUT_FILE_NAME_ODV ), "name of data output file for qois" )
(m_option_qseq_dataOutputFileType.c_str(), po::value<std::string >()->default_value(UQ_MOC_SG_QSEQ_DATA_OUTPUT_FILE_TYPE_ODV ), "type of data output file for qois" )
(m_option_qseq_dataOutputAllowedSet.c_str(), po::value<std::string >()->default_value(UQ_MOC_SG_QSEQ_DATA_OUTPUT_ALLOWED_SET_ODV), "subEnvs that will write to data output file for qois" )
#ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
(m_option_qseq_computeStats.c_str(), po::value<bool >()->default_value(UQ_MOC_SG_QSEQ_COMPUTE_STATS_ODV ), "compute statistics on sequence of qoi" )
#endif
;
return;
}
示例5: add_local_options
void SyslogClient::add_local_options(po::options_description &desc, client::configuration::data_type data) {
desc.add_options()
("severity,s", po::value<std::string>()->notifier(boost::bind(&nscapi::functions::destination_container::set_string_data, &data->recipient, "severity", _1)),
"Severity of error message")
("unknown-severity", po::value<std::string>()->notifier(boost::bind(&nscapi::functions::destination_container::set_string_data, &data->recipient, "unknown_severity", _1)),
"Severity of error message")
("ok-severity", po::value<std::string>()->notifier(boost::bind(&nscapi::functions::destination_container::set_string_data, &data->recipient, "ok_severity", _1)),
"Severity of error message")
("warning-severity", po::value<std::string>()->notifier(boost::bind(&nscapi::functions::destination_container::set_string_data, &data->recipient, "warning_severity", _1)),
"Severity of error message")
("critical-severity", po::value<std::string>()->notifier(boost::bind(&nscapi::functions::destination_container::set_string_data, &data->recipient, "critical_severity", _1)),
"Severity of error message")
("facility,f", po::value<std::string>()->notifier(boost::bind(&nscapi::functions::destination_container::set_string_data, &data->recipient, "facility", _1)),
"Facility of error message")
("tag template", po::value<std::string>()->notifier(boost::bind(&nscapi::functions::destination_container::set_string_data, &data->recipient, "tag template", _1)),
"Tag template (TODO)")
("message template", po::value<std::string>()->notifier(boost::bind(&nscapi::functions::destination_container::set_string_data, &data->recipient, "message template", _1)),
"Message template (TODO)")
;
}
示例6:
// Private methods ----------------------------------
void
EnvironmentOptions::defineMyOptions(po::options_description& optionsDesc) const
{
#ifdef QUESO_MEMORY_DEBUGGING
std::cout << "In EnvOptions::defineMyOptions(), before add_options()" << std::endl;
#endif
optionsDesc.add_options()
(m_option_help.c_str(), "produce help message for environment" )
(m_option_numSubEnvironments.c_str(), po::value<unsigned int>()->default_value(UQ_ENV_NUM_SUB_ENVIRONMENTS_ODV), "number of subEnvironments" )
(m_option_subDisplayFileName.c_str(), po::value<std::string >()->default_value(UQ_ENV_SUB_DISPLAY_FILE_NAME_ODV), "output filename for subscreen writing" )
(m_option_subDisplayAllowAll.c_str(), po::value<bool >()->default_value(UQ_ENV_SUB_DISPLAY_ALLOW_ALL_ODV), "Allow all processors to write to output file" )
(m_option_subDisplayAllowInter0.c_str(), po::value<bool >()->default_value(UQ_ENV_SUB_DISPLAY_ALLOW_INTER0_ODV), "Allow all inter0 nodes to write to output file")
(m_option_subDisplayAllowedSet.c_str(), po::value<std::string >()->default_value(UQ_ENV_SUB_DISPLAY_ALLOWED_SET_ODV), "subEnvs that will write to output file" )
(m_option_displayVerbosity.c_str(), po::value<unsigned int>()->default_value(UQ_ENV_DISPLAY_VERBOSITY_ODV), "set verbosity" )
(m_option_syncVerbosity.c_str(), po::value<unsigned int>()->default_value(UQ_ENV_SYNC_VERBOSITY_ODV), "set sync verbosity" )
(m_option_checkingLevel.c_str(), po::value<unsigned int>()->default_value(UQ_ENV_CHECKING_LEVEL_ODV), "set checking level" )
(m_option_rngType.c_str(), po::value<std::string >()->default_value(UQ_ENV_RNG_TYPE_ODV), "set rngType" )
(m_option_seed.c_str(), po::value<int >()->default_value(UQ_ENV_SEED_ODV), "set seed" )
(m_option_platformName.c_str(), po::value<std::string >()->default_value(UQ_ENV_PLATFORM_NAME_ODV), "platform name" )
(m_option_identifyingString.c_str(), po::value<std::string >()->default_value(UQ_ENV_IDENTIFYING_STRING_ODV), "identifying string" )
//(m_option_numDebugParams.c_str(), po::value<unsigned int>()->default_value(UQ_ENV_NUM_DEBUG_PARAMS_ODV), "set number of debug parameters" )
;
#ifdef QUESO_MEMORY_DEBUGGING
std::cout << "In EnvOptions::defineMyOptions(), after add_options()" << std::endl;
#endif
return;
}
示例7: add_local_options
void NSCPClient::add_local_options(po::options_description &desc, client::configuration::data_type data) {
desc.add_options()
("no-ssl,n", po::value<bool>()->zero_tokens()->default_value(false)->notifier(boost::bind(&nscapi::protobuf::functions::destination_container::set_bool_data, &data->recipient, "no ssl", _1)),
"Do not initial an ssl handshake with the server, talk in plaintext.")
("certificate,c", po::value<std::string>()->notifier(boost::bind(&nscapi::protobuf::functions::destination_container::set_string_data, &data->recipient, "certificate", _1)),
"Length of payload (has to be same as on the server)")
("dh", po::value<std::string>()->notifier(boost::bind(&nscapi::protobuf::functions::destination_container::set_string_data, &data->recipient, "dh", _1)),
"Length of payload (has to be same as on the server)")
("certificate-key,k", po::value<std::string>()->notifier(boost::bind(&nscapi::protobuf::functions::destination_container::set_string_data, &data->recipient, "certificate key", _1)),
"Client certificate to use")
("certificate-format", po::value<std::string>()->notifier(boost::bind(&nscapi::protobuf::functions::destination_container::set_string_data, &data->recipient, "certificate format", _1)),
"Client certificate format")
("ca", po::value<std::string>()->notifier(boost::bind(&nscapi::protobuf::functions::destination_container::set_string_data, &data->recipient, "ca", _1)),
"Certificate authority")
("verify", po::value<std::string>()->notifier(boost::bind(&nscapi::protobuf::functions::destination_container::set_string_data, &data->recipient, "verify mode", _1)),
"Client certificate format")
("allowed-ciphers", po::value<std::string>()->notifier(boost::bind(&nscapi::protobuf::functions::destination_container::set_string_data, &data->recipient, "allowed ciphers", _1)),
"Client certificate format")
("ssl,n", po::value<bool>()->zero_tokens()->default_value(false)->notifier(boost::bind(&nscapi::protobuf::functions::destination_container::set_bool_data, &data->recipient, "ssl", _1)),
"Initial an ssl handshake with the server.")
("timeout", po::value<unsigned int>()->notifier(boost::bind(&nscapi::protobuf::functions::destination_container::set_int_data, &data->recipient, "timeout", _1)),
"")
;
}
示例8: buildOptions
void Application::buildOptions(po::options_description &desc)
{
desc.add_options()
("camera,c", po::value(&m_OptCameraName)->default_value(CVTRACKER_DEFAULT_CAMERA), "specific camera to calibrate")
("width,w", po::value(&m_OptCameraWidth)->default_value(320), "camera capture width")
("height,h", po::value(&m_OptCameraHeight)->default_value(240), "camera capture height")
("rate,r", po::value(&m_OptCameraRate)->default_value(25), "camera capture rate")
("tracker,t", po::value(&m_OptTracker)->default_value(CVTRACKER_DEFAULT_TRACKER), "tracker to use");
}
示例9: applystrain_initializer
void applystrain_initializer(po::options_description& applystrain_desc)
{
UtilityProgramOptions::add_help_suboption(applystrain_desc);
UtilityProgramOptions::add_output_suboption(applystrain_desc);
applystrain_desc.add_options()("structure,s", po::value<fs::path>()->required(),
"POS.vasp like file that you want to apply strain to.");
applystrain_desc.add_options()("mode,m", po::value<std::string>()->default_value("GL"),
"Accepts strain convention as mode ('GL' [Green-Lagrange, default], 'EA' "
"[Euler-Almansi], 'B' [Biot], or 'H' [Hencky])."
" Also accepts 'F' [Deformation] as an argument to apply a deformation tensor");
applystrain_desc.add_options()("tensor,t", po::value<fs::path>()->required(),
"Path to a file with strain tensor."
" Unrolled strain should be provided for GL, B, H, EA modes."
" Ordered as E(0,0) E(1,1) E(2,2) E(1,2) E(0,2) E(0,1)."
" Takes a 3X3 matrix for F (Deformation) mode.");
return;
}
示例10:
void Viewer<T>::appendOptions(po::options_description &opts)
{
// Common program options
opts.add_options()
("config,c", po::value<std::vector<std::string> >()->multitoken(),
"Configuration file/key pair.\n"
"e.g. 'config.toml mykey'")
;
}
示例11: add_local_options
void DistributedClient::add_local_options(po::options_description &desc, client::configuration::data_type data) {
desc.add_options()
("certificate,c", po::value<std::string>()->notifier(boost::bind(&nscapi::functions::destination_container::set_string_data, &data->recipient, "certificate", _1)),
"Length of payload (has to be same as on the server)")
/*
("no-ssl,n", po::value<bool>(&command_data.no_ssl)->zero_tokens()->default_value(false), "Do not initial an ssl handshake with the server, talk in plain text.")
("cert,c", po::value<std::wstring>(&command_data.cert)->default_value(cert_), "Certificate to use.")
*/
;
}
示例12: opt_stp_desc
inline void opt_stp_desc(po::options_description &desc)
{
desc.add_options()
("dt", po::value<string>()->default_value("auto"), "time step [s]")
("dt_out", po::value<string>(), "output interval [s] (if dt == auto)")
("t_max", po::value<string>(), "time of simulation [s] (if dt == auto)")
("nt", po::value<unsigned long>(), "number of time steps [1] (if dt != auto)")
("nout", po::value<int>(), "output interval [dt] (if dt != auto)");
}
示例13: init_options
//==============================================================================
void CC_Base::init_options(po::options_description &desc)
{
desc.add_options()
("help,h", "produce help message");
desc.add_options()
("log", po::value<String>(&option_log_name_)->implicit_value(""),
"create log of all operations");
desc.add_options()
("device,d", po::value<String>(&option_device_address_),
"set programmer deivce usb address 'bus:device'");
desc.add_options()
("fast,f", "set fast debug interface speed (by default: slow)"); //TODO made fast by default
desc.add_options()
("name,n", po::value<String>(&option_unit_name_),
"specify target name e.g. CC2530 etc.");
}
示例14: defineMyOptions
void InfiniteDimensionalMCMCSamplerOptions::defineMyOptions(
po::options_description & optionsDesc) const
{
optionsDesc.add_options()
(m_option_help.c_str(), "produce help message for infinite dimensional sampler")
(m_option_dataOutputDirName.c_str(), po::value<std::string>()->default_value(UQ_INF_DATA_OUTPUT_DIR_NAME_ODV), "name of data output dir")
(m_option_dataOutputFileName.c_str(), po::value<std::string>()->default_value(UQ_INF_DATA_OUTPUT_FILE_NAME_ODV), "name of data output file (HDF5)")
(m_option_num_iters.c_str(), po::value<int>()->default_value(UQ_INF_NUM_ITERS_ODV), "number of mcmc iterations to do")
(m_option_save_freq.c_str(), po::value<int>()->default_value(UQ_INF_SAVE_FREQ_ODV), "the frequency at which to save the chain state")
(m_option_rwmh_step.c_str(), po::value<double>()->default_value(UQ_INF_RWMH_STEP_ODV), "the step-size in the random-walk Metropolis proposal");
return;
}
示例15: add_local_options
void SMTPClient::add_local_options(po::options_description &desc, client::configuration::data_type data) {
desc.add_options()
("sender", po::value<std::string>()->notifier(boost::bind(&nscapi::protobuf::functions::destination_container::set_string_data, &data->recipient, "sender", _1)),
"Length of payload (has to be same as on the server)")
("recipient", po::value<std::string>()->notifier(boost::bind(&nscapi::protobuf::functions::destination_container::set_string_data, &data->recipient, "recipient", _1)),
"Length of payload (has to be same as on the server)")
("template", po::value<std::string>()->notifier(boost::bind(&nscapi::protobuf::functions::destination_container::set_string_data, &data->recipient, "template", _1)),
"Do not initial an ssl handshake with the server, talk in plaintext.")
;
}