#include <userver/components/state.hpp>
State of components that is usable after the components constructor and until all the components were not destroyed.
Public Member Functions | |
State (const ComponentContext &cc) noexcept | |
bool | IsAnyComponentInFatalState () const |
bool | HasDependencyOn (std::string_view component_name, std::string_view dependency) const |
std::unordered_set< std::string_view > | GetAllDependencies (std::string_view component_name) const |
std::unordered_set< std::string_view > components::State::GetAllDependencies | ( | std::string_view | component_name | ) | const |
component_name
depends on directly or transitively.Component with name component_name
should be loaded. Components construction should finish before any call to this function is made. The result should now outlive the all the components destruction.
bool components::State::HasDependencyOn | ( | std::string_view | component_name, |
std::string_view | dependency ) const |
component_name
depends (directly or transitively) on a component with name dependency
.Component with name component_name
should be loaded. Components construction should finish before any call to this function is made.
Note that GetAllDependencies usually is more effective, if you are planning multiple calls for the same component name.
bool components::State::IsAnyComponentInFatalState | ( | ) | const |