#include <PotRegistry.h>
Classes | |
| struct | InstanceRecord |
| struct | TypeStats |
Public Types | |
| using | Clock = std::chrono::system_clock |
| using | TimePoint = Clock::time_point |
Public Member Functions | |
| void | reset () |
| uint64_t | on_created (PotType t) noexcept |
| void | on_destroyed (uint64_t id, PotType t, size_t force_calls, TimePoint created_at) |
| void | on_force_call (PotType t) noexcept |
| size_t | type_force_calls (PotType t) const noexcept |
| size_t | total_force_calls () const noexcept |
| size_t | type_alive (PotType t) const noexcept |
| void | write_summary (const std::string &path="_potcalls.json") const |
Static Public Member Functions | |
| static PotRegistry & | get () noexcept |
| Process-lifetime singleton. | |
Private Attributes | |
| std::array< TypeStats, magic_enum::enum_count< PotType >()> | m_type_stats {} |
| std::mutex | m_records_mutex |
| std::vector< InstanceRecord > | m_records |
| std::atomic< uint64_t > | m_next_id {1} |
Definition at line 24 of file PotRegistry.h.
| using eonc::PotRegistry::Clock = std::chrono::system_clock |
Definition at line 26 of file PotRegistry.h.
| using eonc::PotRegistry::TimePoint = Clock::time_point |
Definition at line 27 of file PotRegistry.h.
|
staticnoexcept |
Process-lifetime singleton.
The instance is allocated on the heap and never destroyed, so Potential destructors can still record teardown after C++ static destruction.
Definition at line 50 of file PotRegistry.cpp.
|
nodiscardnoexcept |
Definition at line 71 of file PotRegistry.cpp.
| void eonc::PotRegistry::on_destroyed | ( | uint64_t | id, |
| PotType | t, | ||
| size_t | force_calls, | ||
| TimePoint | created_at ) |
Definition at line 78 of file PotRegistry.cpp.
|
noexcept |
Definition at line 88 of file PotRegistry.cpp.
| void eonc::PotRegistry::reset | ( | ) |
Definition at line 60 of file PotRegistry.cpp.
|
nodiscardnoexcept |
Definition at line 98 of file PotRegistry.cpp.
|
nodiscardnoexcept |
Definition at line 106 of file PotRegistry.cpp.
|
nodiscardnoexcept |
Definition at line 93 of file PotRegistry.cpp.
| void eonc::PotRegistry::write_summary | ( | const std::string & | path = "_potcalls.json" | ) | const |
Definition at line 111 of file PotRegistry.cpp.
|
private |
Definition at line 48 of file PotRegistry.h.
|
private |
Definition at line 46 of file PotRegistry.h.
|
private |
Definition at line 45 of file PotRegistry.h.
|
private |
Definition at line 43 of file PotRegistry.h.