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
14 public:
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,
20 tracing::ScopeTime& scope) = 0;
21};
22
23std::unique_ptr<dump::OperationsFactory> CreateOperationsFactory(
24 const Config& config, const components::ComponentContext& context);
25
26std::unique_ptr<dump::OperationsFactory> CreateDefaultOperationsFactory(
27 const Config& config);
28
29} // namespace dump
30
31USERVER_NAMESPACE_END