userver
C++ Async Framework
Loading...
Searching...
No Matches
state.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/components/state.hpp
4
/// @brief @copybrief components::State
5
6
#
include
<
string_view
>
7
8
USERVER_NAMESPACE_BEGIN
9
10
namespace
components
{
11
12
class
ComponentContext;
13
14
namespace
impl {
15
class
ComponentContextImpl;
16
}
17
18
/// State of components that is usable after the components constructor.
19
///
20
/// @see components::ComponentContext
21
class
State
final
{
22
public
:
23
explicit
State(
const
ComponentContext& cc)
noexcept
;
24
25
/// @returns true if one of the components is in fatal state and can not
26
/// work. A component is in fatal state if the
27
/// components::ComponentHealth::kFatal value is returned from the overridden
28
/// components::LoggableComponentBase::GetComponentHealth().
29
bool
IsAnyComponentInFatalState
()
const
;
30
31
/// @returns true if component with name `component_name` depends
32
/// (directly or transitively) on a component with name `dependency`.
33
///
34
/// Component with name `component_name` should be loaded.
35
bool
HasDependencyOn
(std::string_view component_name,
36
std::string_view dependency)
const
;
37
38
private
:
39
const
impl::ComponentContextImpl& impl_;
40
};
41
42
}
// namespace components
43
44
USERVER_NAMESPACE_END
userver
components
state.hpp
Generated on Mon Apr 1 2024 18:52:26 for userver by
Doxygen
1.10.0