fix: Actually use include/exclude params in SymbolLoader
This commit is contained in:
1 parent
83879425e3
commit
869f629d3f
1 file changed
+2
-24
@@ -40,9 +40,6 @@ class SymbolLoader {
|
||||
SymbolLoader(const SymbolLoader &);
|
||||
SymbolLoader &operator=(const SymbolLoader &);
|
||||
|
||||
static constexpr bool venue_has_synths(api::Venue venue);
|
||||
static constexpr bool venue_has_synths(domain::protobufs::Venue venue);
|
||||
|
||||
static void add_symbols(
|
||||
const google::protobuf::RepeatedPtrField<std::string> &symbols,
|
||||
Venue exchange,
|
||||
@@ -64,22 +61,6 @@ class SymbolLoader {
|
||||
// Definition
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
constexpr bool SymbolLoader::venue_has_synths(api::Venue venue) {
|
||||
switch (venue) {
|
||||
case api::VENUE_SIM:
|
||||
case api::VENUE_SIMICE:
|
||||
case api::VENUE_ICE:
|
||||
case api::VENUE_GLBX:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
constexpr bool SymbolLoader::venue_has_synths(domain::protobufs::Venue venue) {
|
||||
return venue_has_synths(domain::DomainSecurityUtils::convert(venue));
|
||||
}
|
||||
|
||||
inline void SymbolLoader::add_symbols(
|
||||
const google::protobuf::RepeatedPtrField<std::string> &symbols,
|
||||
Venue exchange,
|
||||
@@ -105,9 +86,7 @@ inline std::set<UserSymbol> SymbolLoader::load(
|
||||
const bts::domain::SecurityCriteria &include,
|
||||
const bts::domain::SecurityCriteria &exclude) {
|
||||
std::set<UserSymbol> result;
|
||||
load(result, include);
|
||||
if (exclude.is_defined()) {
|
||||
}
|
||||
load(result, include, exclude);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -142,8 +121,7 @@ inline std::size_t SymbolLoader::load(
|
||||
(exclude_none || !exclude.includes(venue, SEC_TYPE(SPREAD)))) {
|
||||
add_symbols(vcfg.spread(), venue, SEC_TYPE(SPREAD), result);
|
||||
}
|
||||
if ((include_all || (venue_has_synths(venue) &&
|
||||
include.includes(venue, SEC_TYPE(SYNTHETIC)))) &&
|
||||
if ((include_all || (include.includes(venue, SEC_TYPE(SYNTHETIC)))) &&
|
||||
(exclude_none || !exclude.includes(venue, SEC_TYPE(SYNTHETIC)))) {
|
||||
add_symbols(vcfg.spot(), VENUE(BTS), SEC_TYPE(SYNTHETIC), result);
|
||||
add_symbols(vcfg.future(), VENUE(BTS), SEC_TYPE(SYNTHETIC), result);
|
||||
|
||||
Reference in new issue
Block a user