alaCarte Maps
Renderer for OpenStreetMap tiles
obj_counter.hpp
Go to the documentation of this file.
1 
21 #pragma once
22 #ifndef OBJ_COUNTER_HPP
23 #define OBJ_COUNTER_HPP
24 
25 #include "settings.hpp"
26 
27 template<typename Obj>
29 {
30  private:
31  static std::atomic<unsigned int> count;
32 
33  public:
34  ObjCounter() { count++; }
35  ObjCounter(const ObjCounter& obj) { count++; }
36  ~ObjCounter() { count--; }
37  static unsigned int getCount() { return count.load(); }
38 };
39 
40 template<typename Obj>
41 std::atomic<unsigned int> ObjCounter<Obj>::count(0);
42 
43 #endif
static std::atomic< unsigned int > count
Definition: obj_counter.hpp:31
static unsigned int getCount()
Definition: obj_counter.hpp:37
ObjCounter(const ObjCounter &obj)
Definition: obj_counter.hpp:35