// UnitCnt.h: interface for the CUnitCnt class.
//
//////////////////////////////////////////////////////////////////////

#pragma once

#include "DllDefines.h"

class MCCTRDLLCLASS CUnitCnt
{
public:
    static CUnitCnt& Instance();

    //  Get unit count
    unsigned long int GetUnitCnt();

protected:
    //  set unit count
    void SetUnitCnt(unsigned long uliUnitCnt);

    //  increament unit count
    void IncUnitCnt(unsigned long uliUnitCnt);

    //  reset unit count
    void ResetUnitCnt();

    //  read unit count from file
    void ReadUnitCntFromFile(const char* ccsKeyName = "Unit Count",
        const char* ccsSectionName                  = "SEMIE10",
        const char* ccsFileName                     = RUNTIME_INI);

    //  write unit count to file
    void WriteUnitCntToFile(const char* ccsKeyName = "Unit Count",
        const char* ccsSectionName                 = "SEMIE10",
        const char* ccsFileName                    = RUNTIME_INI);

private:
    //  default constructor
    CUnitCnt();

    //  default destructor
    virtual ~CUnitCnt();

    static CUnitCnt theInstance;

    unsigned long int m_uliUnitCnt;     // unit count
    unsigned long int m_uliPrevUnitCnt; // prev unit count
};
