Leviathan  0.8.0.0
Leviathan game engine
Leviathan::InstanceCounter< T > Class Template Reference

#include <InstanceCounter.h>

Public Member Functions

 InstanceCounter ()
 
 ~InstanceCounter ()
 

Static Protected Attributes

static std::atomic< int32_t > InstanceCount { 0 }
 

Detailed Description

template<class T>
class Leviathan::InstanceCounter< T >

Definition at line 13 of file InstanceCounter.h.

Constructor & Destructor Documentation

◆ InstanceCounter()

template<class T >
Leviathan::InstanceCounter< T >::InstanceCounter ( )
inline

Definition at line 16 of file InstanceCounter.h.

16  {
17 
18  ++InstanceCount;
19  std::cout << typeid(T).name() << " created. total alive: " << InstanceCount
20  << std::endl;
21  }
static std::atomic< int32_t > InstanceCount

◆ ~InstanceCounter()

template<class T >
Leviathan::InstanceCounter< T >::~InstanceCounter ( )
inline

Definition at line 23 of file InstanceCounter.h.

23  {
24 
25  --InstanceCount;
26  std::cout << typeid(T).name() << " destroyed. total alive: " << InstanceCount
27  << std::endl;
28  }
static std::atomic< int32_t > InstanceCount

Member Data Documentation

◆ InstanceCount

template<class T >
std::atomic< int32_t > Leviathan::InstanceCounter< T >::InstanceCount { 0 }
staticprotected

Definition at line 32 of file InstanceCounter.h.


The documentation for this class was generated from the following file: