Spell out boost::program_options in headers instead of using alias
Multiple defs of bpo alias confused gcc and broke cli_wallet build.
This commit is contained in:
parent
ed859277ef
commit
ed381af304
11 changed files with 37 additions and 33 deletions
|
|
@ -50,6 +50,8 @@ using chain::block_id_type;
|
|||
|
||||
using std::vector;
|
||||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
namespace detail {
|
||||
|
||||
class application_impl : public net::node_delegate
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
|
||||
namespace graphene { namespace app {
|
||||
namespace detail { class application_impl; }
|
||||
namespace bpo = boost::program_options;
|
||||
using std::string;
|
||||
|
||||
class abstract_plugin;
|
||||
|
|
@ -35,10 +34,10 @@ namespace graphene { namespace app {
|
|||
application();
|
||||
~application();
|
||||
|
||||
void set_program_options( bpo::options_description& command_line_options,
|
||||
bpo::options_description& configuration_file_options )const;
|
||||
void initialize(const fc::path& data_dir, const bpo::variables_map&options);
|
||||
void initialize_plugins( const bpo::variables_map& options );
|
||||
void set_program_options( boost::program_options::options_description& command_line_options,
|
||||
boost::program_options::options_description& configuration_file_options )const;
|
||||
void initialize(const fc::path& data_dir, const boost::program_options::variables_map&options);
|
||||
void initialize_plugins( const boost::program_options::variables_map& options );
|
||||
void startup();
|
||||
void shutdown();
|
||||
void startup_plugins();
|
||||
|
|
@ -50,7 +49,7 @@ namespace graphene { namespace app {
|
|||
auto plug = std::make_shared<PluginType>();
|
||||
plug->plugin_set_app(this);
|
||||
|
||||
bpo::options_description plugin_cli_options("Options for plugin " + plug->plugin_name()), plugin_cfg_options;
|
||||
boost::program_options::options_description plugin_cli_options("Options for plugin " + plug->plugin_name()), plugin_cfg_options;
|
||||
plug->plugin_set_program_options(plugin_cli_options, plugin_cfg_options);
|
||||
if( !plugin_cli_options.options().empty() )
|
||||
_cli_options.add(plugin_cli_options);
|
||||
|
|
@ -80,8 +79,8 @@ namespace graphene { namespace app {
|
|||
void add_plugin( const string& name, std::shared_ptr<abstract_plugin> p );
|
||||
std::shared_ptr<detail::application_impl> my;
|
||||
|
||||
bpo::options_description _cli_options;
|
||||
bpo::options_description _cfg_options;
|
||||
boost::program_options::options_description _cli_options;
|
||||
boost::program_options::options_description _cfg_options;
|
||||
};
|
||||
|
||||
} }
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
#include <fc/io/json.hpp>
|
||||
|
||||
namespace graphene { namespace app {
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class abstract_plugin
|
||||
{
|
||||
|
|
@ -43,7 +42,7 @@ class abstract_plugin
|
|||
*
|
||||
* @param options The options passed to the application, via configuration files or command line
|
||||
*/
|
||||
virtual void plugin_initialize( const bpo::variables_map& options ) = 0;
|
||||
virtual void plugin_initialize( const boost::program_options::variables_map& options ) = 0;
|
||||
|
||||
/**
|
||||
* @brief Begin normal runtime operations
|
||||
|
|
@ -79,8 +78,8 @@ class abstract_plugin
|
|||
* may simply provide an empty implementation of this method.
|
||||
*/
|
||||
virtual void plugin_set_program_options(
|
||||
bpo::options_description& command_line_options,
|
||||
bpo::options_description& config_file_options
|
||||
boost::program_options::options_description& command_line_options,
|
||||
boost::program_options::options_description& config_file_options
|
||||
) = 0;
|
||||
};
|
||||
|
||||
|
|
@ -95,13 +94,13 @@ class plugin : public abstract_plugin
|
|||
virtual ~plugin() override;
|
||||
|
||||
virtual std::string plugin_name()const override;
|
||||
virtual void plugin_initialize( const bpo::variables_map& options ) override;
|
||||
virtual void plugin_initialize( const boost::program_options::variables_map& options ) override;
|
||||
virtual void plugin_startup() override;
|
||||
virtual void plugin_shutdown() override;
|
||||
virtual void plugin_set_app( application* app ) override;
|
||||
virtual void plugin_set_program_options(
|
||||
bpo::options_description& command_line_options,
|
||||
bpo::options_description& config_file_options
|
||||
boost::program_options::options_description& command_line_options,
|
||||
boost::program_options::options_description& config_file_options
|
||||
) override;
|
||||
|
||||
chain::database& database() { return *app().chain_database(); }
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ std::string plugin::plugin_name()const
|
|||
return "<unknown plugin>";
|
||||
}
|
||||
|
||||
void plugin::plugin_initialize( const bpo::variables_map& options )
|
||||
void plugin::plugin_initialize( const boost::program_options::variables_map& options )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -58,8 +58,8 @@ void plugin::plugin_set_app( application* app )
|
|||
}
|
||||
|
||||
void plugin::plugin_set_program_options(
|
||||
bpo::options_description& command_line_options,
|
||||
bpo::options_description& config_file_options
|
||||
boost::program_options::options_description& command_line_options,
|
||||
boost::program_options::options_description& config_file_options
|
||||
)
|
||||
{
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -593,7 +593,7 @@ void account_history_plugin::plugin_set_program_options(
|
|||
)
|
||||
{
|
||||
cli.add_options()
|
||||
("track-account", bpo::value<std::vector<std::string>>()->composing()->multitoken(), "Account ID to track history for (may specify multiple times)")
|
||||
("track-account", boost::program_options::value<std::vector<std::string>>()->composing()->multitoken(), "Account ID to track history for (may specify multiple times)")
|
||||
;
|
||||
cfg.add(cli);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
|
||||
namespace graphene { namespace account_history {
|
||||
using namespace chain;
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
//
|
||||
// Plugins should #define their SPACE_ID's so plugins with
|
||||
|
|
@ -82,8 +81,10 @@ class account_history_plugin : public graphene::app::plugin
|
|||
virtual ~account_history_plugin();
|
||||
|
||||
std::string plugin_name()const override;
|
||||
virtual void plugin_set_program_options(bpo::options_description& cli, bpo::options_description& cfg) override;
|
||||
virtual void plugin_initialize(const bpo::variables_map& options) override;
|
||||
virtual void plugin_set_program_options(
|
||||
boost::program_options::options_description& cli,
|
||||
boost::program_options::options_description& cfg) override;
|
||||
virtual void plugin_initialize(const boost::program_options::variables_map& options) override;
|
||||
virtual void plugin_startup() override;
|
||||
|
||||
flat_set<account_id_type> tracked_accounts()const;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
|
||||
namespace graphene { namespace market_history {
|
||||
using namespace chain;
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
//
|
||||
// Plugins should #define their SPACE_ID's so plugins with
|
||||
|
|
@ -111,8 +110,11 @@ class market_history_plugin : public graphene::app::plugin
|
|||
virtual ~market_history_plugin();
|
||||
|
||||
std::string plugin_name()const override;
|
||||
virtual void plugin_set_program_options(bpo::options_description& cli, bpo::options_description& cfg) override;
|
||||
virtual void plugin_initialize(const bpo::variables_map& options) override;
|
||||
virtual void plugin_set_program_options(
|
||||
boost::program_options::options_description& cli,
|
||||
boost::program_options::options_description& cfg) override;
|
||||
virtual void plugin_initialize(
|
||||
const boost::program_options::variables_map& options) override;
|
||||
virtual void plugin_startup() override;
|
||||
|
||||
vector<bucket_object> get_history( const bucket_key& start, const bucket_key& end )const;
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ void market_history_plugin::plugin_set_program_options(
|
|||
)
|
||||
{
|
||||
cli.add_options()
|
||||
("bucket-size", bpo::value<std::vector<uint32_t>>()->composing()->multitoken(), "Bucket size in seconds to track history for (may specify multiple times)")
|
||||
("bucket-size", boost::program_options::value<std::vector<uint32_t>>()->composing()->multitoken(), "Bucket size in seconds to track history for (may specify multiple times)")
|
||||
;
|
||||
cfg.add(cli);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
#include <fc/thread/future.hpp>
|
||||
|
||||
namespace graphene { namespace witness_plugin {
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class witness_plugin : public graphene::app::plugin {
|
||||
public:
|
||||
|
|
@ -47,7 +46,7 @@ public:
|
|||
|
||||
void set_block_production(bool allow) { _production_enabled = allow; }
|
||||
|
||||
virtual void plugin_initialize( const bpo::variables_map& options ) override;
|
||||
virtual void plugin_initialize( const boost::program_options::variables_map& options ) override;
|
||||
virtual void plugin_startup() override;
|
||||
virtual void plugin_shutdown() override;
|
||||
|
||||
|
|
@ -55,7 +54,7 @@ private:
|
|||
void schedule_next_production(const graphene::chain::chain_parameters& global_parameters);
|
||||
void block_production_loop();
|
||||
|
||||
bpo::variables_map _options;
|
||||
boost::program_options::variables_map _options;
|
||||
bool _production_enabled = false;
|
||||
std::map<chain::key_id_type, fc::ecc::private_key> _private_keys;
|
||||
std::set<chain::witness_id_type> _witnesses;
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ using namespace graphene::witness_plugin;
|
|||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
void witness_plugin::plugin_set_program_options(
|
||||
boost::program_options::options_description& command_line_options,
|
||||
boost::program_options::options_description& config_file_options)
|
||||
|
|
|
|||
|
|
@ -45,16 +45,16 @@ BOOST_AUTO_TEST_CASE( two_node_network )
|
|||
|
||||
graphene::app::application app1;
|
||||
app1.register_plugin<graphene::account_history::account_history_plugin>();
|
||||
bpo::variables_map cfg;
|
||||
cfg.emplace("p2p-endpoint", bpo::variable_value(string("127.0.0.1:3939"), false));
|
||||
boost::program_options::variables_map cfg;
|
||||
cfg.emplace("p2p-endpoint", boost::program_options::variable_value(string("127.0.0.1:3939"), false));
|
||||
app1.initialize(app_dir.path(), cfg);
|
||||
|
||||
graphene::app::application app2;
|
||||
app2.register_plugin<account_history::account_history_plugin>();
|
||||
auto cfg2 = cfg;
|
||||
cfg2.erase("p2p-endpoint");
|
||||
cfg2.emplace("p2p-endpoint", bpo::variable_value(string("127.0.0.1:4040"), false));
|
||||
cfg2.emplace("seed-node", bpo::variable_value(vector<string>{"127.0.0.1:3939"}, false));
|
||||
cfg2.emplace("p2p-endpoint", boost::program_options::variable_value(string("127.0.0.1:4040"), false));
|
||||
cfg2.emplace("seed-node", boost::program_options::variable_value(vector<string>{"127.0.0.1:3939"}, false));
|
||||
app2.initialize(app2_dir.path(), cfg2);
|
||||
|
||||
app1.startup();
|
||||
|
|
|
|||
Loading…
Reference in a new issue