userver: userver/clients/http/middlewares/component.hpp Source File
Loading...
Searching...
No Matches
component.hpp
1#pragma once
2
3#include <cstdint>
4
5#include <userver/clients/http/middlewares/base.hpp>
6#include <userver/components/component_base.hpp>
7#include <userver/utils/impl/internal_tag_fwd.hpp>
8#include <userver/utils/strong_typedef.hpp>
9
10USERVER_NAMESPACE_BEGIN
11
12namespace clients::http::middlewares {
13
14using MiddlewareIndex = utils::StrongTypedef<class MiddlewareIndexTag, std::uint32_t>;
15
16class ComponentBase : public components::ComponentBase {
17public:
18 virtual MiddlewareBase& GetMiddleware() = 0;
19
20 /// @cond
21 // For internal use only.
22 MiddlewareIndex GetIndex(utils::impl::InternalTag) const;
23 /// @endcond
24protected:
25 ComponentBase(
26 const components::ComponentConfig& config,
27 const components::ComponentContext& context,
28 MiddlewareIndex index
29 );
30
31private:
32 MiddlewareIndex index_;
33};
34
35} // namespace clients::http::middlewares
36
37USERVER_NAMESPACE_END