nothing builds
This commit is contained in:
1 parent
d436dae7cd
commit
719fd03063
12 files changed
+191
-42
No files matched your search
@@ -6,6 +6,7 @@
|
||||
#include "lib/utils/AuthToken.h"
|
||||
#include "lib/logging/logging.h"
|
||||
#include "lib/utils/bts_assert.h"
|
||||
#include "lib/api/service_helpers/AdminServiceUtils.h"
|
||||
|
||||
|
||||
#include <quickfix/Message.h>
|
||||
@@ -99,47 +100,105 @@ FIX::SecurityType SessionBase::convert_security_type(bts::api::SecurityType btst
|
||||
switch (btstype)
|
||||
{
|
||||
case bts::api::SecurityType::SECURITYTYPE_FUTURE:
|
||||
return new QuickFix.Fields.SecurityType("FUT");
|
||||
case bts.api.SecurityType.Option:
|
||||
return new QuickFix.Fields.SecurityType("OPT");
|
||||
case bts.api.SecurityType.Spread:
|
||||
return new QuickFix.Fields.SecurityType("MLEG");
|
||||
case bts.api.SecurityType.Stock:
|
||||
return new QuickFix.Fields.SecurityType("CS");
|
||||
case bts.api.SecurityType.Synthetic:
|
||||
return new QuickFix.Fields.SecurityType("SYNTH");
|
||||
return FIX::SecurityType("FUT");
|
||||
case bts::api::SecurityType::SECURITYTYPE_OPTION:
|
||||
return FIX::SecurityType("OPT");
|
||||
case bts::api::SecurityType::SECURITYTYPE_SPREAD:
|
||||
return FIX::SecurityType("MLEG");
|
||||
case bts::api::SecurityType::SECURITYTYPE_STOCK:
|
||||
return FIX::SecurityType("CS");
|
||||
case bts::api::SecurityType::SECURITYTYPE_SYNTHETIC:
|
||||
return FIX::SecurityType("SYNTH");
|
||||
default:
|
||||
return new QuickFix.Fields.SecurityType();
|
||||
return FIX::SecurityType();
|
||||
}
|
||||
}
|
||||
|
||||
bts::api::SecurityType SessionBase::convert_security_type(FIX::SecurityType fixtype)
|
||||
{
|
||||
std::string s = std::string(fixtype.getValue());
|
||||
if(s == "FUT")
|
||||
return bts::api::SecurityType::SECURITYTYPE_FUTURE;
|
||||
else if(s == "OPT")
|
||||
return bts::api::SecurityType::SECURITYTYPE_OPTION;
|
||||
else if(s == "MLEG"))
|
||||
return bts::api::SecurityType::SECURITYTYPE_SPREAD;
|
||||
else if(s == "CS")
|
||||
return bts::api::SecurityType::SECURITYTYPE_STOCK;
|
||||
else if("SYNTH" == s)
|
||||
return bts::api::SecurityType::SECURITYTYPE_SYNTHETIC;
|
||||
else
|
||||
return bts::api::SecurityType::SECURITYTYPE_UNSET;
|
||||
}
|
||||
|
||||
bool SessionBase::exchanges_equal(bts::api::Venue btstype, FIX::SecurityExchange fixtype)
|
||||
{
|
||||
return btstype == convert_exchange(fixtype);
|
||||
}
|
||||
|
||||
FIX::SecurityExchange SessionBase::convert_exchange(bts::api::Venue btstype)
|
||||
{
|
||||
switch (btstype)
|
||||
{
|
||||
case bts::api::Venue::VENUE_BTS:
|
||||
return FIX::SecurityExchange("BTS");
|
||||
case bts::api::Venue::VENUE_CBOE:
|
||||
return FIX::SecurityExchange("XCBO");
|
||||
case bts::api::Venue::VENUE_CBOECFE:
|
||||
return FIX::SecurityExchange("XCBF");
|
||||
case bts::api::Venue::VENUE_GLBX:
|
||||
return FIX::SecurityExchange("XCME");
|
||||
case bts::api::Venue::VENUE_ICE:
|
||||
return FIX::SecurityExchange("IFUS");
|
||||
case bts::api::Venue::VENUE_SIM:
|
||||
return FIX::SecurityExchange("SIM");
|
||||
default:
|
||||
return FIX::SecurityExchange();
|
||||
}
|
||||
}
|
||||
|
||||
bts::api::Venue SessionBase::convert_exchange(FIX::SecurityExchange fixtype)
|
||||
{
|
||||
std::string s = std::string(fixtype.getValue());
|
||||
if("BTS" == s)
|
||||
return bts::api::Venue::VENUE_BTS;
|
||||
else if("XCBO" == s)
|
||||
return bts::api::Venue::VENUE_CBOE;
|
||||
else if("XCBF" == s)
|
||||
return bts::api::Venue::VENUE_CBOECFE;
|
||||
else if("GLBX" == s || "XCME" == s || "XCBT" == s || "XCEC" == s || "XNYM" == s)
|
||||
return bts::api::Venue::VENUE_GLBX;
|
||||
else if("IEPA" == s || "IFUS" == s || "IFEU" == s || "IFLL" == s || "IFCA" == s)
|
||||
return bts::api::Venue::VENUE_ICE;
|
||||
else if("SIM" == s)
|
||||
return bts::api::Venue::VENUE_SIM;
|
||||
else
|
||||
return bts::api::Venue::VENUE_UNSET;
|
||||
}
|
||||
}
|
||||
|
||||
FIX::OrdStatus SessionBase::translate_status(const bts::api::orderman::OrderStateImmutable& state,
|
||||
bts::api::orderman::NativeOrderStateImmutable* native)
|
||||
{
|
||||
return FIX::OrdStatus();
|
||||
}
|
||||
|
||||
uint SessionBase::lookup_account(const std::string& acct)
|
||||
{
|
||||
auto a = admin::AdminServiceUtils::find_account(_admin_data, acct);
|
||||
if(a)
|
||||
return a->id();
|
||||
else
|
||||
throw FIX::IncorrectTagValue(FIX::FIEILD::Account);
|
||||
}
|
||||
|
||||
uint SessionBase::lookup_user(const std::string& user)
|
||||
{
|
||||
auto u = admin::AdminServiceUtils::find_user(_admin_data, user);
|
||||
if(u)
|
||||
return u->id();
|
||||
else
|
||||
throw FIX::IncorrectTagValue(FIX::FIEILD::Username);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user