Another clang-format run, changed how parameters are binned
This commit is contained in:
1 parent
8f21a77150
commit
de063e51f0
452 files changed
+5506
-2380
No files matched your search
@@ -61,7 +61,8 @@ bool AdminServiceUtils::has_exchange(
|
||||
return rv;
|
||||
}
|
||||
const ExchangeConnection *AdminServiceUtils::find_default_account_connection(
|
||||
const AdminData &data, const BTSAccount &account,
|
||||
const AdminData &data,
|
||||
const BTSAccount &account,
|
||||
bts::api::Venue exchange) {
|
||||
// todo:get from parent accounts if not overridden
|
||||
if (account.has_connections())
|
||||
@@ -75,7 +76,8 @@ const ExchangeConnection *AdminServiceUtils::find_default_account_connection(
|
||||
}
|
||||
|
||||
const ExchangeConnection *AdminServiceUtils::resolve_cme_connection(
|
||||
const AdminData &data, const BTSAccount &account,
|
||||
const AdminData &data,
|
||||
const BTSAccount &account,
|
||||
const bts::api::Security &sec) {
|
||||
if (account.has_connections())
|
||||
for (const std::string &conn_name :
|
||||
@@ -95,7 +97,8 @@ const ExchangeConnection *AdminServiceUtils::resolve_cme_connection(
|
||||
const bts::api::admin::ExchangeConnection *
|
||||
AdminServiceUtils::resolve_ice_connection(
|
||||
const bts::api::admin::AdminData &data,
|
||||
const bts::api::admin::BTSAccount &account, const bts::api::Security &) {
|
||||
const bts::api::admin::BTSAccount &account,
|
||||
const bts::api::Security &) {
|
||||
if (account.has_connections()) {
|
||||
for (const std::string &conn_name :
|
||||
account.connections().exchange_connection_names()) {
|
||||
@@ -111,7 +114,8 @@ AdminServiceUtils::resolve_ice_connection(
|
||||
const bts::api::admin::ExchangeConnection *
|
||||
AdminServiceUtils::resolve_sim_connection(
|
||||
const bts::api::admin::AdminData &data,
|
||||
const bts::api::admin::BTSAccount &account, const bts::api::Security &) {
|
||||
const bts::api::admin::BTSAccount &account,
|
||||
const bts::api::Security &) {
|
||||
if (account.has_connections())
|
||||
for (const std::string &conn_name :
|
||||
account.connections().exchange_connection_names()) {
|
||||
@@ -126,7 +130,8 @@ AdminServiceUtils::resolve_sim_connection(
|
||||
const bts::api::admin::ExchangeConnection *
|
||||
AdminServiceUtils::resolve_connection(
|
||||
const bts::api::admin::AdminData &data,
|
||||
const bts::api::admin::BTSAccount &account, const bts::api::Security &sec) {
|
||||
const bts::api::admin::BTSAccount &account,
|
||||
const bts::api::Security &sec) {
|
||||
const bts::api::admin::ExchangeConnection *rv = nullptr;
|
||||
switch (sec.exchange()) {
|
||||
case api::Venue::VENUE_GLBX: {
|
||||
@@ -261,7 +266,8 @@ const BTSAccount *AdminServiceUtils::find_account(
|
||||
}
|
||||
|
||||
BTSAccount const *AdminServiceUtils::find_account(
|
||||
const AdminData &data, const std::string &clearing_account,
|
||||
const AdminData &data,
|
||||
const std::string &clearing_account,
|
||||
bts::api::Venue exchange) {
|
||||
auto all_accounts = accounts(data, true);
|
||||
for (BTSAccount const *a : all_accounts) {
|
||||
@@ -371,7 +377,9 @@ bool AdminServiceUtils::account_has_connection(
|
||||
return false;
|
||||
}
|
||||
std::string AdminServiceUtils::find_account_exchange_account(
|
||||
const AdminData &data, const BTSAccount &account, api::Venue exchange,
|
||||
const AdminData &data,
|
||||
const BTSAccount &account,
|
||||
api::Venue exchange,
|
||||
AdminServiceOperationResult &out_result) {
|
||||
out_result.set_is_success(true);
|
||||
std::string rv = "";
|
||||
@@ -457,8 +465,10 @@ void AdminServiceUtils::validate_account_exchange_data(
|
||||
}
|
||||
}
|
||||
bts::api::orderman::RoutingRecord AdminServiceUtils::get_routing_record(
|
||||
const bts::api::admin::AdminData &data, const std::string &account_name,
|
||||
const std::string &user_name, const bts::api::Security &sec,
|
||||
const bts::api::admin::AdminData &data,
|
||||
const std::string &account_name,
|
||||
const std::string &user_name,
|
||||
const bts::api::Security &sec,
|
||||
bts::api::admin::AdminServiceOperationResult &out_result) {
|
||||
bts::api::orderman::RoutingRecord rv;
|
||||
const bts::api::admin::BTSAccount *account_ptr =
|
||||
@@ -478,8 +488,10 @@ bts::api::orderman::RoutingRecord AdminServiceUtils::get_routing_record(
|
||||
data, account_ptr->id(), user_ptr->id(), sec, out_result);
|
||||
}
|
||||
bts::api::orderman::RoutingRecord AdminServiceUtils::get_routing_record(
|
||||
const bts::api::admin::AdminData &data, uint32_t account_id,
|
||||
uint32_t user_id, const bts::api::Security &sec,
|
||||
const bts::api::admin::AdminData &data,
|
||||
uint32_t account_id,
|
||||
uint32_t user_id,
|
||||
const bts::api::Security &sec,
|
||||
bts::api::admin::AdminServiceOperationResult &out_result) {
|
||||
bts::api::orderman::RoutingRecord rv;
|
||||
out_result.set_is_success(true);
|
||||
@@ -670,9 +682,12 @@ bts::api::orderman::RoutingRecord AdminServiceUtils::get_routing_record(
|
||||
// account mutators ////////////////////////
|
||||
////////////////////////////////////////////
|
||||
bts::api::admin::BTSAccount *AdminServiceUtils::create_account(
|
||||
bts::api::admin::AdminData &data, uint32_t parent_account_id,
|
||||
const std::string &account_name, const std::string &description,
|
||||
bool is_active, bts::api::admin::AdminServiceCreateAccountResult &result) {
|
||||
bts::api::admin::AdminData &data,
|
||||
uint32_t parent_account_id,
|
||||
const std::string &account_name,
|
||||
const std::string &description,
|
||||
bool is_active,
|
||||
bts::api::admin::AdminServiceCreateAccountResult &result) {
|
||||
result.set_is_success(true);
|
||||
// the error conditions are checked first and returned immediatly
|
||||
// i. account with the name already exists
|
||||
@@ -869,7 +884,8 @@ AdminServiceUtils::get_group_user_permissions(
|
||||
// group mutators //////////////////////////
|
||||
////////////////////////////////////////////
|
||||
bts::api::admin::BTSUserGroup *AdminServiceUtils::create_group(
|
||||
bts::api::admin::AdminData &data, uint32_t parent_group_id,
|
||||
bts::api::admin::AdminData &data,
|
||||
uint32_t parent_group_id,
|
||||
const std::string &group_name,
|
||||
bts::api::admin::AdminServiceOperationResult &result) {
|
||||
// the error conditions are checked first and returned immediatly
|
||||
@@ -899,7 +915,8 @@ bts::api::admin::BTSUserGroup *AdminServiceUtils::create_group(
|
||||
// user accessors //////////////////////////
|
||||
////////////////////////////////////////////
|
||||
bts::api::admin::BTSUser *AdminServiceUtils::find_user(
|
||||
bts::api::admin::AdminData &data, const std::string &user_name,
|
||||
bts::api::admin::AdminData &data,
|
||||
const std::string &user_name,
|
||||
bool include_deleted) {
|
||||
auto user_ptrs = users_mutable(data, include_deleted);
|
||||
for (auto user_ptr : user_ptrs) {
|
||||
@@ -909,7 +926,8 @@ bts::api::admin::BTSUser *AdminServiceUtils::find_user(
|
||||
return nullptr;
|
||||
}
|
||||
const bts::api::admin::BTSUser *AdminServiceUtils::find_user(
|
||||
const bts::api::admin::AdminData &data, const std::string &user_name,
|
||||
const bts::api::admin::AdminData &data,
|
||||
const std::string &user_name,
|
||||
bool include_deleted) {
|
||||
auto user_ptrs = users(data, include_deleted);
|
||||
for (auto user_ptr : user_ptrs)
|
||||
@@ -1010,7 +1028,8 @@ const bts::api::admin::SIMUserData *AdminServiceUtils::get_user_sim_data(
|
||||
// at ICE) for a user
|
||||
std::string AdminServiceUtils::find_user_exchange_id(
|
||||
const bts::api::admin::AdminData &data,
|
||||
const bts::api::admin::BTSUser &user, api::Venue exchange,
|
||||
const bts::api::admin::BTSUser &user,
|
||||
api::Venue exchange,
|
||||
bts::api::admin::AdminServiceOperationResult &out_result) {
|
||||
out_result.set_is_success(true);
|
||||
std::string rv = "";
|
||||
@@ -1050,7 +1069,8 @@ std::string AdminServiceUtils::find_user_exchange_id(
|
||||
|
||||
std::string AdminServiceUtils::find_user_company_id(
|
||||
const bts::api::admin::AdminData &data,
|
||||
const bts::api::admin::BTSUser &user, api::Venue exchange,
|
||||
const bts::api::admin::BTSUser &user,
|
||||
api::Venue exchange,
|
||||
bts::api::admin::AdminServiceOperationResult &out_result) {
|
||||
out_result.set_is_success(true);
|
||||
std::string rv = "";
|
||||
@@ -1079,8 +1099,10 @@ std::string AdminServiceUtils::find_user_company_id(
|
||||
|
||||
std::pair<const BTSAccount *, const BTSUser *>
|
||||
AdminServiceUtils::find_user_account_matches(
|
||||
const AdminData &admin_data, const std::string &connection,
|
||||
const std::string &exchange_account, const std::string &exchange_user,
|
||||
const AdminData &admin_data,
|
||||
const std::string &connection,
|
||||
const std::string &exchange_account,
|
||||
const std::string &exchange_user,
|
||||
api::Venue exchange) {
|
||||
AdminServiceOperationResult find_account_result, find_user_result;
|
||||
// i. uses the exchange and exchange_user to reverse lookup the user(s)
|
||||
@@ -1095,8 +1117,8 @@ AdminServiceUtils::find_user_account_matches(
|
||||
}
|
||||
// i.5
|
||||
// At the ice, they send back the login level tag50 in exec reports which
|
||||
// doesn't match any user level tag50s in the exchange_user so instead we look
|
||||
// for the CompanyID (or client_id, tag 109) field here. If this field
|
||||
// doesn't match any user level tag50s in the exchange_user so instead we
|
||||
// look for the CompanyID (or client_id, tag 109) field here. If this field
|
||||
// matches we have a good bet that the user we find is enough to fulfill the
|
||||
// routing record enough to cancel or modify orphaned orders, etc
|
||||
for (BTSUser const *u : user_ptrs) {
|
||||
@@ -1149,7 +1171,8 @@ AdminServiceUtils::get_user_permissions(
|
||||
// for a given user, fills in the associated_accounts ref arg
|
||||
// with the accounts the user has permission to trade in
|
||||
void AdminServiceUtils::find_user_trading_accounts(
|
||||
const bts::api::admin::AdminData &admin_data, uint32_t user_id,
|
||||
const bts::api::admin::AdminData &admin_data,
|
||||
uint32_t user_id,
|
||||
std::vector<const api::admin::BTSAccount *> &associated_accounts) {
|
||||
const bts::api::admin::UserAccountPermissions *user_perm_ptr =
|
||||
get_user_permissions(admin_data, user_id);
|
||||
@@ -1168,7 +1191,8 @@ void AdminServiceUtils::find_user_trading_accounts(
|
||||
// for a given account, fills in the associated_users ref arg
|
||||
// with the users that can trade into the account
|
||||
void AdminServiceUtils::find_users_for_trading_account(
|
||||
const AdminData &admin_data, uint32_t account_id,
|
||||
const AdminData &admin_data,
|
||||
uint32_t account_id,
|
||||
std::vector<const BTSUser *> &associated_users) {
|
||||
for (const auto &u : AdminServiceUtils::users(admin_data, false)) {
|
||||
const auto user_perm_ptr = get_user_permissions(admin_data, u->id());
|
||||
@@ -1305,7 +1329,8 @@ MDEntitlementReportUnit AdminServiceUtils::get_ice_md_entitlement_unit(
|
||||
}
|
||||
|
||||
void AdminServiceUtils::get_user_symbol_permissions(
|
||||
const AdminData &data, const BTSUser &user,
|
||||
const AdminData &data,
|
||||
const BTSUser &user,
|
||||
std::vector<UserSymbolMDPermissionUnit> &rv) {
|
||||
std::map<api::CMEMics, bool> mic_perm_map;
|
||||
auto exchange = api::Venue::VENUE_GLBX;
|
||||
@@ -1333,9 +1358,13 @@ void AdminServiceUtils::get_user_symbol_permissions(
|
||||
// user mutators ///////////////////////////
|
||||
////////////////////////////////////////////
|
||||
bts::api::admin::BTSUser *AdminServiceUtils::create_user(
|
||||
bts::api::admin::AdminData &data, uint32_t parent_group_id,
|
||||
const std::string &name, const std::string &password,
|
||||
const std::string &full_name, const std::string &company, bool is_active,
|
||||
bts::api::admin::AdminData &data,
|
||||
uint32_t parent_group_id,
|
||||
const std::string &name,
|
||||
const std::string &password,
|
||||
const std::string &full_name,
|
||||
const std::string &company,
|
||||
bool is_active,
|
||||
const bts::api::admin::LicenseData &license_data,
|
||||
const bts::api::admin::LicenseEntitlements &license_entitlements,
|
||||
bts::api::admin::AdminServiceCreateEntityResult &result) {
|
||||
@@ -1603,8 +1632,10 @@ AdminServiceUtils::security_type(const api::Security &security) {
|
||||
////////////////////////////////////////////
|
||||
|
||||
void add_product_position_limits(
|
||||
bts::api::admin::BTSAccount *to_account, api::Venue venue,
|
||||
api::SecurityType sec_type, uint32_t limit) {
|
||||
bts::api::admin::BTSAccount *to_account,
|
||||
api::Venue venue,
|
||||
api::SecurityType sec_type,
|
||||
uint32_t limit) {
|
||||
std::vector<md::UserSymbol> symbols;
|
||||
md::get_system_md_symbols(venue, sec_type, &symbols);
|
||||
|
||||
@@ -1619,8 +1650,10 @@ void add_product_position_limits(
|
||||
}
|
||||
|
||||
void add_security_clip_sizes_to_account(
|
||||
bts::api::admin::BTSAccount *to_account, api::Venue venue,
|
||||
api::SecurityType sec_type, uint32_t limit) {
|
||||
bts::api::admin::BTSAccount *to_account,
|
||||
api::Venue venue,
|
||||
api::SecurityType sec_type,
|
||||
uint32_t limit) {
|
||||
std::vector<md::UserSymbol> symbols;
|
||||
md::get_system_md_symbols(venue, sec_type, &symbols);
|
||||
|
||||
@@ -1635,7 +1668,8 @@ void add_security_clip_sizes_to_account(
|
||||
}
|
||||
|
||||
void add_security_position_limits(
|
||||
bts::api::admin::BTSAccount *to_account, api::Venue venue,
|
||||
bts::api::admin::BTSAccount *to_account,
|
||||
api::Venue venue,
|
||||
api::SecurityType sec_type) {
|
||||
auto acct_a1_sec_limit = to_account->add_security_position_limits();
|
||||
acct_a1_sec_limit->mutable_security()->set_exchange(venue);
|
||||
@@ -1952,7 +1986,8 @@ bool AdminServiceUtils::is_symbol_set(const std::string &symbol) {
|
||||
return symbol != "*";
|
||||
}
|
||||
void AdminServiceUtils::get_spread_prod_qty(
|
||||
const api::Security &s, std::map<std::string, double> &out_map,
|
||||
const api::Security &s,
|
||||
std::map<std::string, double> &out_map,
|
||||
double mult) {
|
||||
if (s.has_spread())
|
||||
for (const auto &leg : s.spread().legs()) {
|
||||
|
||||
Reference in new issue
Block a user