• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ options_description类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中options_description的典型用法代码示例。如果您正苦于以下问题:C++ options_description类的具体用法?C++ options_description怎么用?C++ options_description使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了options_description类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: get_section_options

options_description get_section_options(const string section_name, const string group_caption, const options_description &original_options_descriptions)
{

    const std::vector< shared_ptr<option_description> >&original_options = original_options_descriptions.options();

    options_description new_options(group_caption.c_str());

    std::vector< shared_ptr<option_description> >::const_iterator options_it;
    for(options_it = original_options.begin(); options_it != original_options.end(); ++options_it)
    {

        const option_description &t_option = *(*options_it);
        string new_name(section_name + ".");
        new_name += t_option.long_name();


        // IMPORTANT: in order for this line not to crash the original_options_descriptions needs to be a static declaration
        // otherwise t_option.semantic().get() will point to an invalid memory direction and
        // the application will raise a segmentation fault
        new_options.add_options()
                (new_name.c_str(), t_option.semantic().get(), t_option.description().c_str());

    }

    return new_options;
}
开发者ID:HaoLiuHust,项目名称:doppia,代码行数:26,代码来源:get_section_options.cpp


示例2: parse_config_file

    basic_parsed_options<charT>
    parse_config_file(std::basic_istream<charT>& is, 
                      const options_description& desc,
                      bool allow_unregistered)
    {    
        set<string> allowed_options;

        const vector<shared_ptr<option_description> >& options = desc.options();
        for (unsigned i = 0; i < options.size(); ++i)
        {
            const option_description& d = *options[i];

            if (d.long_name().empty())
                pdalboost::throw_exception(
                    error("long name required for config file"));

            allowed_options.insert(d.long_name());
        }

        // Parser return char strings
        parsed_options result(&desc);        
        copy(detail::basic_config_file_iterator<charT>(
                 is, allowed_options, allow_unregistered), 
             detail::basic_config_file_iterator<charT>(), 
             back_inserter(result.options));
        // Convert char strings into desired type.
        return basic_parsed_options<charT>(result);
    }
开发者ID:xhy20070406,项目名称:PDAL,代码行数:28,代码来源:parsers.cpp


示例3: do_add_visible_options_to_description

/// \brief Add the block's non-hidden options to the provided options_description
///
/// This is a concrete definition of a virtual method that's pure in options_block
void old_ssap_options_block::do_add_visible_options_to_description(options_description &arg_desc ///< The options_description to which the options are added
                                                                   ) {
	const string dir_varname  { "<dir>"   };
	const string file_varname { "<file>"  };
	const string score_varname{ "<score>" };
	const string set_varname  { "<set>"   };

	const string protein_file_combns_str = join( get_all_protein_file_combn_strings(), ", " );
	arg_desc.add_options()
		( PO_DEBUG.c_str(),                bool_switch              ( &debug                        )                           ->default_value(DEF_BOOL      ),   "Output debugging information"                                                                                          )
		((PO_OUT_FILE+",o").c_str(),       value<path>              ( &output_filename              )->value_name(file_varname ),                                ( "[DEPRECATED] Output scores to " + file_varname + " rather than to stdout" ).c_str()                                    )

		( PO_CLIQUE_FILE.c_str(),          value<path>              ( &clique_file                  )->value_name(file_varname ),                                ( "Read clique from " + file_varname ).c_str()                                                                            )
		( PO_DOMIN_FILE.c_str(),           value<path>              ( &domin_file                   )->value_name(file_varname ),                                ( "Read domin from "  + file_varname ).c_str()                                                                            )

		( PO_MAX_SCORE_TO_REFAST.c_str(),  value<double>            ( &max_score_to_fast_ssap_rerun )->value_name(score_varname)->default_value(DEF_REFAST    ), ( "Run a second fast SSAP with looser cutoffs if the first fast SSAP's score falls below " + score_varname ).c_str()      )
		( PO_MAX_SCORE_TO_RESLOW.c_str(),  value<double>            ( &max_score_to_slow_ssap_rerun )->value_name(score_varname)->default_value(DEF_RESLOW    ), ( "Perform a slow SSAP if the (best) fast SSAP score falls below " + score_varname ).c_str()                              )
		( PO_SLOW_SSAP_ONLY.c_str(),       bool_switch              ( &slow_ssap_only               )                           ->default_value(DEF_BOOL      ),   "Don't try any fast SSAPs; only use slow SSAP"                                                                          )

		( PO_LOC_SSAP_SCORE.c_str(),       bool_switch              ( &use_local_ssap_score         )                           ->default_value(DEF_BOOL      ),   "[DEPRECATED] Normalise the SSAP score over the length of the smallest domain rather than the largest"                  )
		( PO_ALL_SCORES.c_str(),           bool_switch              ( &write_all_scores             )                           ->default_value(DEF_BOOL      ),   "[DEPRECATED] Output all SSAP scores from fast and slow runs, not just the highest"                                     )
		( PO_PROTEIN_SOURCE_FILES.c_str(), value<protein_file_combn>( &protein_source_files         )->value_name( set_varname )->default_value(DEF_PROT_SRCS ), ( "Read the protein data from the set of files "+set_varname+", of available sets:\n" + protein_file_combns_str ).c_str() )

		( PO_SUPN_DIR.c_str(),             value<path>              ( &superposition_dir            )->value_name( dir_varname ),                                ( "[DEPRECATED] Output a superposition to directory " + dir_varname ).c_str()                                             )
		( PO_ALIGN_DIR.c_str(),            value<path>              ( &alignment_dir                )->value_name( dir_varname )->default_value( path(".")    ), ( "Write alignment to directory " + dir_varname ).c_str()                                                                 )
		( PO_MIN_OUT_SCORE.c_str(),        value<double>            ( &min_score_for_writing_files  )->value_name(score_varname)->default_value(DEF_FILE_SC   ), ( "Only output alignment/superposition files if the SSAP score exceeds " + score_varname ).c_str()                        )
		( PO_MIN_SUP_SCORE.c_str(),        value<double>            ( &min_score_for_superposition  )->value_name(score_varname)->default_value(DEF_SUP       ), ( "[DEPRECATED] Calculate superposition based on the residue-pairs with scores greater than " + score_varname ).c_str()   )
		( PO_RASMOL_SCRIPT.c_str(),        bool_switch              ( &write_rasmol_script          )                           ->default_value(DEF_BOOL      ),   "[DEPRECATED] Write a rasmol superposition script to load and colour the superposed structures"                         )
		( PO_XML_SUP.c_str(),              bool_switch              ( &write_xml_sup                )                           ->default_value(DEF_BOOL      ),   "[DEPRECATED] Write a small xml superposition file, from which a larger superposition file can be reconstructed"        );
}
开发者ID:UCLOrengoGroup,项目名称:cath-tools,代码行数:33,代码来源:old_ssap_options_block.cpp


示例4: set_program_options

void http_client_plugin::set_program_options(options_description&, options_description& cfg) {
   cfg.add_options()
      ("https-client-root-cert", boost::program_options::value<vector<string>>()->composing()->multitoken(),
       "PEM encoded trusted root certificate (or path to file containing one) used to validate any TLS connections made.  (may specify multiple times)\n")
      ("https-client-validate-peers", boost::program_options::value<bool>()->default_value(true),
       "true: validate that the peer certificates are valid and trusted, false: ignore cert errors")
      ;

}
开发者ID:108518,项目名称:eos,代码行数:9,代码来源:http_client_plugin.cpp


示例5: do_add_visible_options_to_description

/// \brief Add this block's options to the provided options_description
void superposition_output_options_block::do_add_visible_options_to_description(options_description &arg_desc ///< The options_description to which the options are added
                                                                               ) {
	arg_desc.add_options()
		(PO_SUP_FILE.c_str(),          value<path>(&sup_to_pdb_file),                                     "Write the superposed structures to a single PDB file arg, separated using faked chain codes"  )
		(PO_SUP_FILES_DIR.c_str(),     value<path>(&sup_to_pdb_files_dir),                                "Write the superposed structures to separate PDB files in directory arg"                       )
		(PO_SUP_TO_STDOUT.c_str(),     bool_switch(&sup_to_stdout)->default_value(false),                 "Print the superposed structures to stdout, separated using faked chain codes"                 )
		(PO_SUP_TO_PYMOL.c_str(),      bool_switch(&sup_to_pymol )->default_value(false),                 "Start up PyMOL for viewing the superposition"                                                 )
		(PO_PYMOL_PROGRAM.c_str(),     value<path>(&pymol_program)->default_value(DEFAULT_PYMOL_PROGRAM), "Use arg as the PyMOL executable for viewing; may optionally include the full path"            )
		(PO_SUP_TO_PYMOL_FILE.c_str(), value<path>(&sup_to_pymol_file),                                   "Write the superposition to a PyMOL script arg\n(Recommended filename extension: .pml)"        )
		(PO_SUP_TO_JSON_FILE.c_str(),  value<path>(&json_file),                                           "Write the superposition to JSON superposition file\n(Recommended filename extension: .sup_json)"        );
}
开发者ID:UCLOrengoGroup,项目名称:cath-tools,代码行数:12,代码来源:superposition_output_options_block.cpp


示例6: parse_config_file

    basic_parsed_options<charT>
    parse_config_file(std::basic_istream<charT>& is, 
                      const options_description& desc)
    {    
        set<string> allowed_options;
        set<string> pm = desc.primary_keys();
        for (set<string>::iterator i = pm.begin(); i != pm.end(); ++i) {
            const option_description& d = desc.find(*i);

            if (d.long_name().empty())
                throw error("long name required for config file");

            allowed_options.insert(d.long_name());
        }

        // Parser return char strings
        parsed_options result(&desc);        
        copy(detail::basic_config_file_iterator<charT>(is, allowed_options), 
             detail::basic_config_file_iterator<charT>(), 
             back_inserter(result.options));
        // Convert char strings into desired type.
        return basic_parsed_options<charT>(result);
    }
开发者ID:BackupTheBerlios,项目名称:pyasynchio-svn,代码行数:23,代码来源:parsers.cpp


示例7: do_add_visible_options_to_description

/// \brief Add this block's options to the provided options_description
void alignment_input_options_block::do_add_visible_options_to_description(options_description &arg_desc ///< The options_description to which the options are added
                                                                  ) {
	const string file_varname { "<file>" };

	const auto residue_name_align_notifier   = [&] (const bool &x) { the_alignment_input_spec.set_residue_name_align  ( x ); };
	const auto fasta_alignment_file_notifier = [&] (const path &x) { the_alignment_input_spec.set_fasta_alignment_file( x ); };
	const auto ssap_alignment_file_notifier  = [&] (const path &x) { the_alignment_input_spec.set_ssap_alignment_file ( x ); };
	const auto cora_alignment_file_notifier  = [&] (const path &x) { the_alignment_input_spec.set_cora_alignment_file ( x ); };
	const auto ssap_scores_file_notifier     = [&] (const path &x) { the_alignment_input_spec.set_ssap_scores_file    ( x ); };

	arg_desc.add_options()
		(
			PO_RES_NAME_ALIGN.c_str(),
			bool_switch()
				->notifier     ( residue_name_align_notifier                      )
				->default_value( alignment_input_spec::DEFAULT_RESIDUE_NAME_ALIGN ),
			"Align residues by simply matching their names (numbers+insert)\n(for multiple models of the same structure)"
		)
		(
			PO_FASTA_ALIGN_INFILE.c_str(),
			value<path>()
				->value_name( file_varname                  )
				->notifier  ( fasta_alignment_file_notifier ),
			( "Read FASTA alignment from file " + file_varname ).c_str()
		)
		(
			PO_SSAP_ALIGN_INFILE.c_str(),
			value<path>()
				->value_name( file_varname                 )
				->notifier  ( ssap_alignment_file_notifier ),
			( "Read SSAP alignment from file " + file_varname ).c_str()
		)
		(
			PO_CORA_ALIGN_INFILE.c_str(),
			value<path>()
				->value_name( file_varname                 )
				->notifier  ( cora_alignment_file_notifier ),
			( "Read CORA alignment from file " + file_varname ).c_str()
		)
		(
			PO_SSAP_SCORE_INFILE.c_str(),
			value<path>()
				->value_name( file_varname              )
				->notifier  ( ssap_scores_file_notifier ),
			( "Read SSAP scores from file " + file_varname + "\nAssumes all .list alignment files in same directory" ).c_str()
		);

	static_assert( ! alignment_input_spec::DEFAULT_RESIDUE_NAME_ALIGN,
		"If alignment_input_spec::DEFAULT_RESIDUE_NAME_ALIGN isn't false, it might mess up the bool switch in here" );
}
开发者ID:UCLOrengoGroup,项目名称:cath-tools,代码行数:51,代码来源:alignment_input_options_block.cpp


示例8: do_add_visible_options_to_description

/// \brief Add this block's options to the provided options_description
void display_options_block::do_add_visible_options_to_description(options_description &arg_desc ///< The options_description to which the options are added
                                                                  ) {
	const string colrs_varname{ "<colrs>" };

	const auto display_colours_string_notifier    = [&] (const string &x) { the_display_spec.set_display_colours_string   ( x ); };
	const auto gradient_colour_alignment_notifier = [&] (const bool   &x) { the_display_spec.set_gradient_colour_alignment( x ); };
	const auto show_scores_if_present_notifier    = [&] (const bool   &x) { the_display_spec.set_show_scores_if_present   ( x ); };
	const auto scores_to_equivs_notifier          = [&] (const bool   &x) { the_display_spec.set_scores_to_equivs         ( x ); };
	const auto normalise_scores_notifier          = [&] (const bool   &x) { the_display_spec.set_normalise_scores         ( x ); };
	arg_desc.add_options()
		(
			PO_VIEWER_COLOURS.c_str(),
			value<string>()
				->value_name( colrs_varname                   )
				->notifier  ( display_colours_string_notifier ),
			( "Use " + colrs_varname + " to colour successive entries in the viewer\n"
			  "(format: colon-separated list of comma-separated triples of RGB values between 0 and 1)\n"
			  "(will wrap-around when it runs out of colours)" ).c_str()
		)
		(
			PO_GRADIENT_COLOUR_ALIGNMENT.c_str(),
			bool_switch()
				->notifier     ( gradient_colour_alignment_notifier )
				->default_value( false                              ),
			"Colour the length of the alignment with a rainbow gradient (blue -> red)"
		)
		(
			PO_SHOW_SCORES_IF_PRESENT.c_str(),
			bool_switch()
				->notifier     ( show_scores_if_present_notifier )
				->default_value( false                           ),
			( "Show the alignment scores\n(use with " + PO_GRADIENT_COLOUR_ALIGNMENT + ")" ).c_str()
		)
		(
			PO_SCORES_TO_EQUIVS.c_str(),
			bool_switch()
				->notifier     ( scores_to_equivs_notifier )
				->default_value( false                     ),
			( "Show the alignment scores to equivalent positions, which increases relative scores where few entries are aligned\n"
				"(use with --" + PO_GRADIENT_COLOUR_ALIGNMENT + " and --" + PO_SHOW_SCORES_IF_PRESENT + ")" ).c_str()
		)
		(
			PO_NORMALISE_SCORES.c_str(),
			bool_switch()
				->notifier     ( normalise_scores_notifier )
				->default_value( false                     ),
			( "When showing scores, normalise them to the highest score in the alignment\n"
				"(use with --" + PO_GRADIENT_COLOUR_ALIGNMENT + " and --" + PO_SHOW_SCORES_IF_PRESENT + ")" ).c_str() 
		);
}
开发者ID:UCLOrengoGroup,项目名称:cath-tools,代码行数:51,代码来源:display_options_block.cpp


示例9: parse_xml

    basic_parsed_options<charT>
    parse_xml(const options_description& desc) {
        using boost::shared_ptr;
        set<string> allowed_options;

        const vector<shared_ptr<option_description> >& options = desc.options();
        for (unsigned i = 0; i < options.size(); ++i) {
            const option_description& d = *options[i];

            if (d.long_name().empty())
                boost::throw_exception(
                    error("long name required for config file"));

            allowed_options.insert(d.long_name());
        }

        // Parser return char strings
        parsed_options result(&desc);
        result.options.push_back(basic_option<charT>("my_double", vector<string>(1, "10.1214")));
        //result.options.push_back(basic_option<charT>("my_string", vector<string>(1, "hello world")));
        return basic_parsed_options<charT>(result);
    }
开发者ID:cfobel,项目名称:boost_any,代码行数:22,代码来源:typed_value_options.cpp


示例10: AddOption

 explicit AddOption(options_description& desc) : AddOptionBase(desc.add_options()) {}
开发者ID:anibalanto,项目名称:hyp,代码行数:1,代码来源:ProgramOptions.hpp


示例11: add

inline AddOptionBase add(options_description& desc) {
  return desc.add_options();
}
开发者ID:anibalanto,项目名称:hyp,代码行数:3,代码来源:ProgramOptions.hpp


示例12: set_program_options

 void history_plugin::set_program_options(options_description& cli, options_description& cfg) {
    cfg.add_options()
          ("filter_on_accounts,f", bpo::value<vector<string>>()->composing(),
           "Track only transactions whose scopes involve the listed accounts. Default is to track all transactions.")
          ;
 }
开发者ID:wood19910377,项目名称:eos,代码行数:6,代码来源:history_plugin.cpp


示例13: do_add_hidden_options_to_description

/// \brief Add this block's hidden options to the provided options_description
void check_pdb_options_block::do_add_hidden_options_to_description(options_description &arg_desc ///< The options_description to which the options are added
                                                                   ) {
	arg_desc.add_options()
		( PO_PDB_FILE.c_str(), value<path>( &pdb_file ), "PDB file to check" );
}
开发者ID:UCLOrengoGroup,项目名称:cath-tools,代码行数:6,代码来源:check_pdb_options_block.cpp


示例14: do_add_visible_options_to_description

/// \brief Add this block's options to the provided options_description
///
/// This is a concrete definition of a virtual method that's pure in options_block
void check_pdb_options_block::do_add_visible_options_to_description(options_description &arg_desc ///< The options_description to which the options are added
                                                                    ) {
	arg_desc.add_options()
		( PO_PERMIT.c_str(), bool_switch( &permit_no_atoms )->default_value( false ), "Permit success for a file that has no ATOM records" );
}
开发者ID:UCLOrengoGroup,项目名称:cath-tools,代码行数:8,代码来源:check_pdb_options_block.cpp


示例15: prepareParseMotorId

void prepareParseMotorId(options_description& desc) {
  using namespace boost::program_options;
  desc.add_options()
    ("motor_id,i", value<int>()->default_value(1)->implicit_value(false)->required(), "the CAN id of the motor to test");
}
开发者ID:team-diana,项目名称:diana_powertrain,代码行数:5,代码来源:command_line.cpp


示例16: do_add_hidden_options_to_description

/// \brief Add any hidden options to the provided options_description
void old_ssap_options_block::do_add_hidden_options_to_description(options_description &arg_desc ///< The options_description to which the options are added
                                                                  ) {
	arg_desc.add_options()
		( PO_NAME.c_str(), value<str_vec>( &names ), "Structure names" );
}
开发者ID:UCLOrengoGroup,项目名称:cath-tools,代码行数:6,代码来源:old_ssap_options_block.cpp



注:本文中的options_description类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ orthotope类代码示例发布时间:2022-05-31
下一篇:
C++ options类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap