refactor: Rename Venue/SecType enums according to conventions

https://protobuf.dev/programming-guides/style/#enums
This commit is contained in:
John Colvin committed 2023-04-20 00:46:23 -04:00
1 parent c0980809c5
commit 5c25f9a3e5
33 files changed
+151 -135

No files matched your search

+6 -3
View File
@@ -11,6 +11,9 @@
namespace bts::md {
#define SEC_TYPE(x) bts::api::domain::SECURITY_TYPE_##x
#define VENUE(x) bts::api::domain::VENUE_##x
static domain::SecurityID create_sec_id(
api::domain::Venue venue, std::uint32_t exch_id) {
auto val = static_cast<std::uint64_t>(exch_id) |
@@ -94,8 +97,8 @@ bool SecurityStore::add_security(
api::domain::Venue venue,
api::domain::SecurityType type,
const std::string &symbol) {
if (venue == api::domain::Venue::VENUE_NONE || symbol.empty() ||
type == api::domain::SecurityType::UNSET) {
if (venue == VENUE(UNSPECIFIED) || symbol.empty() ||
type == SEC_TYPE(UNSPECIFIED)) {
return false;
}
return me_->cache.lock([&](auto &cache) {
@@ -107,7 +110,7 @@ bool SecurityStore::add_security(
s.security_common.venue = venue;
s.security_common.id = create_sec_id(venue, me_->id_counter++);
switch (type) {
case api::domain::SecurityType::FUTURE: {
case SEC_TYPE(FUTURE): {
s.security = domain::FutureSecurity();
break;
}