28 template<
typename DerivedType,
typename... BasePack>
39 static ReporterRegistrar registrarTrigger;
47 struct ReporterRegistrar {
49 if constexpr (
sizeof...(BasePack) == 0) {
50 Register<DerivedType>();
52 (Register<BasePack>(), ...);
56 template<
typename Base>
58 if constexpr (!std::is_same_v<DerivedType, Base>) {
60 std::type_index(
typeid(DerivedType)),[]() {
65 std::type_index(
typeid(DerivedType)), []() -> std::pair<int64_t, int64_t> {
static void RegisterDerivedReporter(const std::type_index &derivedTypeId, DerivedMetricsReporter reporter)
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 void RegisterDerivedMetricsProvider(const std::type_index &derivedTypeId, DerivedMetricsProvider provider)
static void Report(const std::string &indent="")
Will report the data about type T instances.
Trackable & operator=(const Trackable &)=delete
Trackable(const Trackable &)=delete
Trackable(Trackable &&)=delete
Trackable & operator=(Trackable &&)=delete
Profiling tools are in this namespace.