From 4822bc3f0ddb4ef5761401e8bc17d844f7d56032 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Wed, 23 Feb 2022 20:24:00 +0000 Subject: Add missing files --- .../messagebus/policies/mirror_with_all.cpp | 24 +++++++++++++++++++ .../messagebus/policies/mirror_with_all.h | 27 ++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 documentapi/src/vespa/documentapi/messagebus/policies/mirror_with_all.cpp create mode 100644 documentapi/src/vespa/documentapi/messagebus/policies/mirror_with_all.h (limited to 'documentapi/src') diff --git a/documentapi/src/vespa/documentapi/messagebus/policies/mirror_with_all.cpp b/documentapi/src/vespa/documentapi/messagebus/policies/mirror_with_all.cpp new file mode 100644 index 00000000000..4bcf87c14a6 --- /dev/null +++ b/documentapi/src/vespa/documentapi/messagebus/policies/mirror_with_all.cpp @@ -0,0 +1,24 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#include +#include +#include +#include +#include + +namespace documentapi { + +MirrorAndStuff::MirrorAndStuff(const slobrok::ConfiguratorFactory & config) + : _threadPool(std::make_unique(64_Ki)), + _transport(std::make_unique()), + _orb(std::make_unique(_transport.get())), + _mirror(std::make_unique(*_orb, config)) +{ + _transport->Start(_threadPool.get()); +} + +MirrorAndStuff::~MirrorAndStuff() { + _transport->ShutDown(true); +} + +} diff --git a/documentapi/src/vespa/documentapi/messagebus/policies/mirror_with_all.h b/documentapi/src/vespa/documentapi/messagebus/policies/mirror_with_all.h new file mode 100644 index 00000000000..05571c4420e --- /dev/null +++ b/documentapi/src/vespa/documentapi/messagebus/policies/mirror_with_all.h @@ -0,0 +1,27 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#pragma once + +#include + +class FastOS_ThreadPool; +class FNET_Transport; +class FRT_Supervisor; +namespace slobrok { class ConfiguratorFactory; } +namespace slobrok::api { class IMirrorAPI; } + +namespace documentapi { + +class MirrorAndStuff { +public: + MirrorAndStuff(const slobrok::ConfiguratorFactory & config); + ~MirrorAndStuff(); + slobrok::api::IMirrorAPI * mirror() { return _mirror.get(); } +private: + std::unique_ptr _threadPool; + std::unique_ptr _transport; + std::unique_ptr _orb; + std::unique_ptr _mirror; +}; + +} -- cgit v1.2.3