Error boundary registry for managing multiple boundaries.
More...
#include <graceful_degradation.h>
Error boundary registry for managing multiple boundaries.
Definition at line 395 of file graceful_degradation.h.
◆ clear()
| void kcenon::monitoring::error_boundary_registry::clear |
( |
| ) |
|
|
inline |
◆ get_all_names()
| std::vector< std::string > kcenon::monitoring::error_boundary_registry::get_all_names |
( |
| ) |
const |
|
inline |
Definition at line 422 of file graceful_degradation.h.
422 {
423 std::lock_guard<std::mutex> lock(
mutex_);
424 std::vector<std::string> names;
426 for (
const auto& [name, boundary] :
registry_) {
427 names.push_back(name);
428 }
429 return names;
430 }
References mutex_, and registry_.
◆ get_boundary()
template<typename T >
| std::shared_ptr< error_boundary< T > > kcenon::monitoring::error_boundary_registry::get_boundary |
( |
const std::string & | name | ) |
|
|
inline |
Definition at line 404 of file graceful_degradation.h.
404 {
405 std::lock_guard<std::mutex> lock(
mutex_);
408 try {
409 return std::any_cast<std::shared_ptr<error_boundary<T>>>(it->second);
410 } catch (const std::bad_any_cast&) {
411 return nullptr;
412 }
413 }
414 return nullptr;
415 }
References mutex_, and registry_.
◆ register_boundary()
template<typename T >
| void kcenon::monitoring::error_boundary_registry::register_boundary |
( |
const std::string & | name, |
|
|
std::shared_ptr< error_boundary< T > > | boundary ) |
|
inline |
◆ remove_boundary()
| void kcenon::monitoring::error_boundary_registry::remove_boundary |
( |
const std::string & | name | ) |
|
|
inline |
◆ mutex_
| std::mutex kcenon::monitoring::error_boundary_registry::mutex_ |
|
mutableprivate |
◆ registry_
| std::unordered_map<std::string, std::any> kcenon::monitoring::error_boundary_registry::registry_ |
|
private |
The documentation for this class was generated from the following file: