50 lines
1.3 KiB
C++
50 lines
1.3 KiB
C++
#pragma once
|
|
#include "lib/md/common.h"
|
|
#include "lib/api/services/SyntheticSecurityService.pb.h"
|
|
#include "lib/api/services/SyntheticSecurityService.server.pb.h"
|
|
#include "lib/domain_model/SecurityKey.h"
|
|
#include "ISyntheticSecurityService.h"
|
|
#include <memory>
|
|
#include <unordered_map>
|
|
|
|
|
|
namespace bts {
|
|
namespace api {
|
|
namespace synthetic {
|
|
|
|
|
|
class SyntheticSecurityService :
|
|
private api::synthetic::SyntheticSecurityServiceBase,
|
|
public ISyntheticSecurityService
|
|
{
|
|
struct Pimpl;
|
|
std::unique_ptr<Pimpl> _me;
|
|
|
|
public:
|
|
SyntheticSecurityService(api::ServiceContext& context);
|
|
~SyntheticSecurityService();
|
|
|
|
const std::unordered_map<SecurityKey, api::Security> securities() override;
|
|
utils::EventSubscriber<Security>& on_securities() override;
|
|
const Metadata* get_metadata(SecurityKey) override;
|
|
utils::EventSubscriber<Metadata>& on_metadata() override;
|
|
|
|
private:
|
|
void create_synthetic(
|
|
const Security& request,
|
|
const api::Response<CreateResult>& reply) override;
|
|
|
|
void update_security_metadata(
|
|
const Metadata& request,
|
|
const api::Response<UpdateResult>& reply) override;
|
|
|
|
void query_security_metadata(
|
|
const MetadataQuery& request,
|
|
const api::Response<MetadataCollection>& reply) override;
|
|
|
|
};
|
|
|
|
}}}//namespace
|
|
|
|
|