Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move stuff into namespaces #1992

Merged
merged 3 commits into from
Sep 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions libraries/app/config_util.cpp
Expand Up @@ -43,6 +43,8 @@

namespace bpo = boost::program_options;

namespace graphene { namespace app { namespace detail {

class deduplicator
{
public:
Expand All @@ -65,6 +67,8 @@ class deduplicator
const boost::shared_ptr<bpo::option_description> (*modifier)(const boost::shared_ptr<bpo::option_description>&);
};

} } } // graphene::app::detail

// Currently, you can only specify the filenames and logging levels, which
// are all most users would want to change. At a later time, options can
// be added to control rotation intervals, compression, and other seldom-
Expand Down Expand Up @@ -208,7 +212,7 @@ static const boost::shared_ptr<bpo::option_description> new_option_description(
static void load_config_file(const fc::path& config_ini_path, const bpo::options_description& cfg_options,
bpo::variables_map& options )
{
deduplicator dedup;
graphene::app::detail::deduplicator dedup;
bpo::options_description unique_options("BitShares Witness Node");
for( const boost::shared_ptr<bpo::option_description> opt : cfg_options.options() )
{
Expand Down Expand Up @@ -256,7 +260,7 @@ static void create_new_config_file(const fc::path& config_ini_path, const fc::pa
return new_option_description(name, bpo::value<int>()->default_value(100), o->description() );
return o;
};
deduplicator dedup(modify_option_defaults);
graphene::app::detail::deduplicator dedup(modify_option_defaults);
std::ofstream out_cfg(config_ini_path.preferred_string());
std::string plugin_header_surrounding( 78, '=' );
for( const boost::shared_ptr<bpo::option_description> opt : cfg_options.options() )
Expand Down
12 changes: 6 additions & 6 deletions libraries/chain/db_notify.cpp
Expand Up @@ -19,7 +19,7 @@
#include <graphene/chain/impacted.hpp>

using namespace fc;
using namespace graphene::chain;
namespace graphene { namespace chain { namespace detail {

// TODO: Review all of these, especially no-ops
struct get_impacted_account_visitor
Expand Down Expand Up @@ -283,13 +283,15 @@ struct get_impacted_account_visitor
}
};

void graphene::chain::operation_get_impacted_accounts( const operation& op, flat_set<account_id_type>& result )
} // detail

void operation_get_impacted_accounts( const operation& op, flat_set<account_id_type>& result )
{
get_impacted_account_visitor vtor = get_impacted_account_visitor( result );
detail::get_impacted_account_visitor vtor( result );
op.visit( vtor );
}

void graphene::chain::transaction_get_impacted_accounts( const transaction& tx, flat_set<account_id_type>& result )
void transaction_get_impacted_accounts( const transaction& tx, flat_set<account_id_type>& result )
{
for( const auto& op : tx.operations )
operation_get_impacted_accounts( op, result );
Expand Down Expand Up @@ -441,8 +443,6 @@ void get_relevant_accounts( const object* obj, flat_set<account_id_type>& accoun
}
} // end get_relevant_accounts( const object* obj, flat_set<account_id_type>& accounts )

namespace graphene { namespace chain {

void database::notify_applied_block( const signed_block& block )
{
GRAPHENE_TRY_NOTIFY( applied_block, block )
Expand Down