|
CoriEngine
|
This utility lets you count class instances in various ways. @detials You can see how much instances was created in total, how many are currently alive, how many instances of derived classes were created, and how much are currently alive. For a type to be instance counted it should derive from Trackable. More...
#include <InstanceMetrics.hpp>
Public Types | |
| using | DerivedMetricsReporter = std::function<void()> |
| using | DerivedMetricsProvider = std::function<std::pair<int64_t, int64_t>()> |
Static Public Member Functions | |
| static int64_t | GetDirectAliveCount () |
| Checks how many instances of type T is alive, not including derived classes. | |
| static int64_t | GetDirectTotalCreatedCount () |
| Checks how many instances of type T were created, not including derived classes. | |
| static int64_t | GetAliveCount () |
| Checks how many instances of type T is alive, including derived classes. | |
| static int64_t | GetTotalCreatedCount () |
| Checks how many instances of type T were created, including derived classes. | |
| static void | Report (const std::string &indent="") |
| Will report the data about type T instances. | |
| static std::vector< std::pair< std::string, int64_t > > | GetAliveCountData () |
| Retries the data about alive instances of type T including derived instances. | |
| static std::vector< std::pair< std::string, int64_t > > | GetTotalCreatedCountData () |
| Retries the data about created instances of type T including derived instances. | |
Static Protected Member Functions | |
| static void | Increment () |
| static void | Decrement () |
| static void | RegisterDerivedMetricsProvider (const std::type_index &derivedTypeId, DerivedMetricsProvider provider) |
| static void | RegisterDerivedReporter (const std::type_index &derivedTypeId, DerivedMetricsReporter reporter) |
Friends | |
| template<typename DerivedType, typename... BasePack> | |
| class | Trackable |
This utility lets you count class instances in various ways. @detials You can see how much instances was created in total, how many are currently alive, how many instances of derived classes were created, and how much are currently alive. For a type to be instance counted it should derive from Trackable.
Definition at line 10 of file InstanceMetrics.hpp.
| using Cori::Profiling::InstanceMetrics< T >::DerivedMetricsProvider = std::function<std::pair<int64_t, int64_t>()> |
Definition at line 13 of file InstanceMetrics.hpp.
| using Cori::Profiling::InstanceMetrics< T >::DerivedMetricsReporter = std::function<void()> |
Definition at line 12 of file InstanceMetrics.hpp.
|
inlinestaticprotected |
Definition at line 140 of file InstanceMetrics.hpp.
|
inlinestatic |
Checks how many instances of type T is alive, including derived classes.
Definition at line 41 of file InstanceMetrics.hpp.

|
inlinestatic |
Retries the data about alive instances of type T including derived instances.
Definition at line 93 of file InstanceMetrics.hpp.

|
inlinestatic |
Checks how many instances of type T is alive, not including derived classes.
Definition at line 21 of file InstanceMetrics.hpp.
|
inlinestatic |
Checks how many instances of type T were created, not including derived classes.
Definition at line 31 of file InstanceMetrics.hpp.
|
inlinestatic |
Checks how many instances of type T were created, including derived classes.
Definition at line 55 of file InstanceMetrics.hpp.

|
inlinestatic |
Retries the data about created instances of type T including derived instances.
Definition at line 115 of file InstanceMetrics.hpp.

|
inlinestaticprotected |
Definition at line 135 of file InstanceMetrics.hpp.
|
inlinestaticprotected |
Definition at line 144 of file InstanceMetrics.hpp.
|
inlinestaticprotected |
Definition at line 151 of file InstanceMetrics.hpp.
|
inlinestatic |
Will report the data about type T instances.
| indent | Initial indentation of the report. @detils Example usage: InstanceMetrics<T>::Report(); Reruns log the data about T and its derived classes. |
Definition at line 69 of file InstanceMetrics.hpp.

|
friend |
Definition at line 133 of file InstanceMetrics.hpp.