SPARK 1731 - Simplify SecurityOracle impl
This commit is contained in:
1 parent
791b0fdbc1
commit
bf72122edc
5 files changed
+21
-37
No files matched your search
+10
-7
@@ -1,6 +1,7 @@
|
||||
#include "MDClient.h"
|
||||
#include "get_symbols.h"
|
||||
#include "SecurityCache.h"
|
||||
#include "SecurityOracle.h"
|
||||
#include <set>
|
||||
|
||||
namespace bts {
|
||||
@@ -14,14 +15,16 @@ struct MDClientImpl{
|
||||
utils::DispatcherTimer _recovery_timer;
|
||||
MDConsumer _consumer;
|
||||
utils::Event<MDConsumer> _event;
|
||||
SecurityOracle _oracle;
|
||||
|
||||
MDClientImpl(utils::Dispatcher& d, std::shared_ptr<api::ISyntheticSecurityService> s):
|
||||
MDClientImpl(utils::Dispatcher& d, std::shared_ptr<api::ISyntheticSecurityService> s, SecurityOracle o):
|
||||
_dispatcher(d),
|
||||
_ss(s),
|
||||
_security_timer(d, config::get<RelayOptions>().security_scan_interval(),[this]() { scan_securities(); }),
|
||||
_recovery_timer(d, config::get<RelayOptions>().recovery_interval(), [this]() { check_heartbeats(); }),
|
||||
_consumer(s, _cache),
|
||||
_event()
|
||||
_event(),
|
||||
_oracle(o)
|
||||
{
|
||||
_security_timer.start();
|
||||
_recovery_timer.start();
|
||||
@@ -57,8 +60,8 @@ struct MDClientImpl{
|
||||
};
|
||||
|
||||
|
||||
MDClient::MDClient(utils::Dispatcher& d, std::shared_ptr<api::ISyntheticSecurityService> s) : _self(new MDClientImpl(d,s)) {
|
||||
|
||||
MDClient::MDClient(utils::Dispatcher& d, std::shared_ptr<api::ISyntheticSecurityService> s) :
|
||||
_self(new MDClientImpl(d,s, SecurityOracle(*this))) {
|
||||
}
|
||||
MDClient::~MDClient() {
|
||||
}
|
||||
@@ -66,11 +69,11 @@ MDClient::~MDClient() {
|
||||
utils::EventSubscriber<MDConsumer>& MDClient::on_consumer() {
|
||||
return _self->_event;
|
||||
}
|
||||
MDConsumer MDClient::current_consumer() const {
|
||||
MDConsumer& MDClient::current_consumer() const {
|
||||
return _self->_consumer;
|
||||
}
|
||||
SecurityOracle MDClient::oracle() {
|
||||
return SecurityOracle(*this);
|
||||
SecurityOracle& MDClient::oracle() const {
|
||||
return _self->_oracle;
|
||||
}
|
||||
|
||||
}}//namespace
|
||||
Reference in new issue
Block a user