Skip to content

Commit

Permalink
rename method names
Browse files Browse the repository at this point in the history
  • Loading branch information
oxarbitrage committed Oct 13, 2018
1 parent 3768491 commit fc2a9b1
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions libraries/plugins/es_objects/es_objects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ class es_objects_plugin_impl
fc::time_point_sec block_time;

private:
void PrepareProposal(const proposal_object& proposal_object);
void PrepareAccount(const account_object& account_object);
void PrepareAsset(const asset_object& asset_object);
void PrepareBalance(const account_balance_object& account_balance_object);
void PrepareLimit(const limit_order_object& limit_object);
void PrepareBitAsset(const asset_bitasset_data_object& bitasset_object);
std::string createIdstring(object_id_type& object_id);
void prepare_proposal(const proposal_object& proposal_object);
void prepare_account(const account_object& account_object);
void prepare_asset(const asset_object& asset_object);
void prepare_balance(const account_balance_object& account_balance_object);
void prepare_limit(const limit_order_object& limit_object);
void prepare_bitasset(const asset_bitasset_data_object& bitasset_object);
std::string create_id_string(object_id_type& object_id);

};

Expand All @@ -104,7 +104,7 @@ bool es_objects_plugin_impl::indexDatabase( const vector<object_id_type>& ids, s
if(action == "delete")
RemoveFromDatabase(p->id, "proposal");
else
PrepareProposal(*p);
prepare_proposal(*p);
}
}
else if(value.is<account_object>() && _es_objects_accounts) {
Expand All @@ -114,7 +114,7 @@ bool es_objects_plugin_impl::indexDatabase( const vector<object_id_type>& ids, s
if(action == "delete")
RemoveFromDatabase(a->id, "account");
else
PrepareAccount(*a);
prepare_account(*a);
}
}
else if(value.is<asset_object>() && _es_objects_assets) {
Expand All @@ -124,7 +124,7 @@ bool es_objects_plugin_impl::indexDatabase( const vector<object_id_type>& ids, s
if(action == "delete")
RemoveFromDatabase(a->id, "asset");
else
PrepareAsset(*a);
prepare_asset(*a);
}
}
else if(value.is<account_balance_object>() && _es_objects_balances) {
Expand All @@ -134,7 +134,7 @@ bool es_objects_plugin_impl::indexDatabase( const vector<object_id_type>& ids, s
if(action == "delete")
RemoveFromDatabase(b->id, "balance");
else
PrepareBalance(*b);
prepare_balance(*b);
}
}
else if(value.is<limit_order_object>() && _es_objects_limit_orders) {
Expand All @@ -144,7 +144,7 @@ bool es_objects_plugin_impl::indexDatabase( const vector<object_id_type>& ids, s
if(action == "delete")
RemoveFromDatabase(l->id, "limitorder");
else
PrepareLimit(*l);
prepare_limit(*l);
}
}
else if(value.is<asset_bitasset_data_object>() && _es_objects_asset_bitasset) {
Expand All @@ -154,7 +154,7 @@ bool es_objects_plugin_impl::indexDatabase( const vector<object_id_type>& ids, s
if(action == "delete")
RemoveFromDatabase(ba->id, "bitasset");
else
PrepareBitAsset(*ba);
prepare_bitasset(*ba);
}
}
}
Expand Down Expand Up @@ -182,7 +182,7 @@ void es_objects_plugin_impl::RemoveFromDatabase( object_id_type id, std::string
if(_es_objects_keep_only_current)
{
fc::mutable_variant_object delete_line;
delete_line["_id"] = createIdstring(id);
delete_line["_id"] = create_id_string(id);
delete_line["_index"] = _es_objects_index_prefix + index;
delete_line["_type"] = "data";
fc::mutable_variant_object final_delete_line;
Expand All @@ -193,7 +193,7 @@ void es_objects_plugin_impl::RemoveFromDatabase( object_id_type id, std::string
}
}

void es_objects_plugin_impl::PrepareProposal(const proposal_object& proposal_object)
void es_objects_plugin_impl::prepare_proposal(const proposal_object& proposal_object)
{
proposal_struct prop;
prop.object_id = proposal_object.id;
Expand All @@ -215,15 +215,15 @@ void es_objects_plugin_impl::PrepareProposal(const proposal_object& proposal_obj
bulk_header["_type"] = "data";
if(_es_objects_keep_only_current)
{
bulk_header["_id"] = createIdstring(prop.object_id);
bulk_header["_id"] = create_id_string(prop.object_id);
}

prepare = graphene::utilities::createBulk(bulk_header, std::move(data));
std::move(prepare.begin(), prepare.end(), std::back_inserter(bulk));
prepare.clear();
}

void es_objects_plugin_impl::PrepareAccount(const account_object& account_object)
void es_objects_plugin_impl::prepare_account(const account_object& account_object)
{
account_struct acct;
acct.object_id = account_object.id;
Expand Down Expand Up @@ -253,15 +253,15 @@ void es_objects_plugin_impl::PrepareAccount(const account_object& account_object
bulk_header["_type"] = "data";
if(_es_objects_keep_only_current)
{
bulk_header["_id"] = createIdstring(acct.object_id);
bulk_header["_id"] = create_id_string(acct.object_id);
}

prepare = graphene::utilities::createBulk(bulk_header, std::move(data));
std::move(prepare.begin(), prepare.end(), std::back_inserter(bulk));
prepare.clear();
}

void es_objects_plugin_impl::PrepareAsset(const asset_object& asset_object)
void es_objects_plugin_impl::prepare_asset(const asset_object& asset_object)
{
asset_struct asset;
asset.object_id = asset_object.id;
Expand All @@ -280,15 +280,15 @@ void es_objects_plugin_impl::PrepareAsset(const asset_object& asset_object)
bulk_header["_type"] = "data";
if(_es_objects_keep_only_current)
{
bulk_header["_id"] = createIdstring(asset.object_id);
bulk_header["_id"] = create_id_string(asset.object_id);
}

prepare = graphene::utilities::createBulk(bulk_header, std::move(data));
std::move(prepare.begin(), prepare.end(), std::back_inserter(bulk));
prepare.clear();
}

void es_objects_plugin_impl::PrepareBalance(const account_balance_object& account_balance_object)
void es_objects_plugin_impl::prepare_balance(const account_balance_object& account_balance_object)
{
balance_struct balance;
balance.object_id = account_balance_object.id;
Expand All @@ -306,15 +306,15 @@ void es_objects_plugin_impl::PrepareBalance(const account_balance_object& accoun
bulk_header["_type"] = "data";
if(_es_objects_keep_only_current)
{
bulk_header["_id"] = createIdstring(balance.object_id);
bulk_header["_id"] = create_id_string(balance.object_id);
}

prepare = graphene::utilities::createBulk(bulk_header, std::move(data));
std::move(prepare.begin(), prepare.end(), std::back_inserter(bulk));
prepare.clear();
}

void es_objects_plugin_impl::PrepareLimit(const limit_order_object& limit_object)
void es_objects_plugin_impl::prepare_limit(const limit_order_object& limit_object)
{
limit_order_struct limit;
limit.object_id = limit_object.id;
Expand All @@ -333,15 +333,15 @@ void es_objects_plugin_impl::PrepareLimit(const limit_order_object& limit_object
bulk_header["_type"] = "data";
if(_es_objects_keep_only_current)
{
bulk_header["_id"] = createIdstring(limit.object_id);
bulk_header["_id"] = create_id_string(limit.object_id);
}

prepare = graphene::utilities::createBulk(bulk_header, std::move(data));
std::move(prepare.begin(), prepare.end(), std::back_inserter(bulk));
prepare.clear();
}

void es_objects_plugin_impl::PrepareBitAsset(const asset_bitasset_data_object& bitasset_object)
void es_objects_plugin_impl::prepare_bitasset(const asset_bitasset_data_object& bitasset_object)
{
if(!bitasset_object.is_prediction_market) {

Expand All @@ -359,15 +359,15 @@ void es_objects_plugin_impl::PrepareBitAsset(const asset_bitasset_data_object& b
bulk_header["_type"] = "data";
if(_es_objects_keep_only_current)
{
bulk_header["_id"] = createIdstring(bitasset.object_id);
bulk_header["_id"] = create_id_string(bitasset.object_id);
}

prepare = graphene::utilities::createBulk(bulk_header, std::move(data));
std::move(prepare.begin(), prepare.end(), std::back_inserter(bulk));
prepare.clear();
}
}
std::string es_objects_plugin_impl::createIdstring(object_id_type& object_id)
std::string es_objects_plugin_impl::create_id_string(object_id_type& object_id)
{
return fc::to_string(object_id.space()) + "." + fc::to_string(object_id.type()) + "." + fc::to_string(object_id.instance());
}
Expand Down

0 comments on commit fc2a9b1

Please sign in to comment.