Tier1: create simple depth manager class

Will be used to manage depths of nested arrays
This commit is contained in:
Kawe Mazidjatari 2024-04-03 01:12:44 +02:00
parent b2442164a7
commit 80fecfa228

View File

@ -0,0 +1,31 @@
//=============================================================================//
//
// Purpose: simple class that could be used to manage depths of nested elements
//
//=============================================================================//
#ifndef TIER1_DEPTHCOUNTER_H
#define TIER1_DEPTHCOUNTER_H
template<class T>
class CDepthCounter
{
public:
CDepthCounter(T& counter) : ref(counter)
{
ref++;
}
~CDepthCounter()
{
ref--;
}
T Get()
{
return ref;
}
private:
T& ref;
};
#endif // TIER1_DEPTHCOUNTER_H