41 lines
1.3 KiB
C++
41 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include "lib/domain_model/SecurityKey.h"
|
|
#include "lib/md/ExchangeSecurityKey.h"
|
|
#include "lib/md/SecurityCache.h"
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
namespace bts {
|
|
namespace api {
|
|
class Security;
|
|
}
|
|
namespace md {
|
|
class MDClient;
|
|
class SecurityOracle {
|
|
SecurityCache &_cache;
|
|
|
|
public:
|
|
SecurityOracle(SecurityCache &);
|
|
~SecurityOracle();
|
|
const api::Security *get_security(SecurityKey key) const;
|
|
const api::Security *get_security(ExchangeSecurityKey key) const;
|
|
const api::Security *get_security(api::Venue venue, const std::string &name) const;
|
|
const api::Security *get_security(api::Venue venue, api::SecurityType type, const std::string &name) const;
|
|
/**
|
|
* Finds all securities where @p include returns true.
|
|
*/
|
|
std::vector<const Security *> get_securities(
|
|
std::function<bool(const Security &)> include) const;
|
|
std::vector<api::Security const *> get_securities(
|
|
api::Venue venue, api::SecurityType type, const std::string &name) const;
|
|
|
|
std::vector<api::Security const *> get_securities() const;
|
|
// this iterates through all securities and simply logs them. Use it
|
|
// ONLY for troubleshooting
|
|
void troubleshoot_log_all_securities() const;
|
|
};
|
|
|
|
} // namespace md
|
|
} // namespace bts
|