userver: userver/dump/factory.hpp Source File
Loading...
Searching...
No Matches
factory.hpp
1#pragma once
2
3#include <userver/components/component_context.hpp>
4#include <userver/dump/config.hpp>
5#include <userver/dump/operations.hpp>
6#include <userver/tracing/scope_time.hpp>
7
8USERVER_NAMESPACE_BEGIN
9
10namespace dump {
11
12/// An abstract Reader/Writer factory
14public:
15 virtual ~OperationsFactory() = default;
16
17 virtual std::unique_ptr<Reader> CreateReader(std::string full_path) = 0;
18
19 virtual std::unique_ptr<Writer> CreateWriter(std::string full_path, tracing::ScopeTime& scope) = 0;
20};
21
22std::unique_ptr<dump::OperationsFactory>
23CreateOperationsFactory(const Config& config, const components::ComponentContext& context);
24
25std::unique_ptr<dump::OperationsFactory> CreateDefaultOperationsFactory(const Config& config);
26
27} // namespace dump
28
29USERVER_NAMESPACE_END