#include <PotRegistry.h>
Classes | |
| struct | InstanceRecord |
| struct | TypeStats |
Public Types | |
| using | Clock = IPotRegistry::Clock |
| using | TimePoint = IPotRegistry::TimePoint |
| Public Types inherited from eonc::IPotRegistry | |
| using | Clock = std::chrono::system_clock |
| using | TimePoint = Clock::time_point |
Public Member Functions | |
| PotRegistry ()=default | |
| void | reset () |
| uint64_t | on_created (PotType t) noexcept override |
| void | on_destroyed (uint64_t id, PotType t, size_t force_calls, TimePoint created_at) override |
| void | on_force_call (PotType t) noexcept override |
| 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 |
| Public Member Functions inherited from eonc::IPotRegistry | |
| virtual | ~IPotRegistry ()=default |
| IPotRegistry (const IPotRegistry &)=delete | |
| IPotRegistry & | operator= (const IPotRegistry &)=delete |
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} |
Additional Inherited Members | |
| Protected Member Functions inherited from eonc::IPotRegistry | |
| IPotRegistry ()=default | |
Definition at line 45 of file PotRegistry.h.
Definition at line 47 of file PotRegistry.h.
Definition at line 48 of file PotRegistry.h.
|
default |
|
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.
|
nodiscardoverridevirtualnoexcept |
Implements eonc::IPotRegistry.
Definition at line 71 of file PotRegistry.cpp.
|
overridevirtual |
Implements eonc::IPotRegistry.
Definition at line 78 of file PotRegistry.cpp.
|
overridevirtualnoexcept |
Implements eonc::IPotRegistry.
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 69 of file PotRegistry.h.
|
private |
Definition at line 67 of file PotRegistry.h.
|
private |
Definition at line 66 of file PotRegistry.h.
Definition at line 64 of file PotRegistry.h.