/* Collection of code snippets by Arne Vajhøj */
/* (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) */
#ifndef SIMPLE_SINGLETON_11_H
#define SIMPLE_SINGLETON_11_H

#include <mutex>

using namespace std;

class SimpleSingleton11
{
private:
    static SimpleSingleton11* instance;
    mutex mymutex;
    long long counter;
    SimpleSingleton11() { }
public:
    SimpleSingleton11(const SimpleSingleton11& original) = delete;
    SimpleSingleton11& operator=(const SimpleSingleton11& original) = delete;
    static SimpleSingleton11& Instance();
    void Reset();
    void Increment();
    long long GetCounter();
};

#endif
