// UnitCntArray.h: interface for the CUnitCntArray class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_UNITCNTARRAY_H__DCDB1552_CAB7_4842_BC36_D9023A5F035A__INCLUDED_)
#define AFX_UNITCNTARRAY_H__DCDB1552_CAB7_4842_BC36_D9023A5F035A__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#ifdef  BUILD_MCCTRDLL
#define     MCCTRDLLCLASS   __declspec(dllexport)
#else
#define     MCCTRDLLCLASS   __declspec(dllimport)
#endif

class MCCTRDLLCLASS CUnitCntArray
{
public:
//  constructor to specific which array number
    explicit CUnitCntArray(int iArray);

//  default destructor
    virtual ~CUnitCntArray();

//  set size of Unit count array based on the number of last instance
    void SetSizeOfUnitCntArray();

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

//  set unit count
    void SetUnitCntArray(unsigned long int uliUnitCnt);

//  increament unit count
    void IncUnitCntArray(unsigned long int uliUnitCnt);

//  reset unit count
    void ResetUnitCntArray();

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

//  write unit count to file
    void WriteUnitCntArrayToFile(const char *ccsKeyName = "Unit Count",
                                 const char *ccsSectionName = "SEMIE10",
                                 bool bWrite = false,
                                 const char *ccsFileName = RUNTIME_INI);
private:

    int m_iArrayNo;                             // instance array no

    static int m_iNoOfInstance;                 // keep track no of instance

    static unsigned long int *m_uliUnitCnt;     // array to keep track all unit count
    static unsigned long int *m_uliPrevUnitCnt; // array to keep track all previous unit count

    enum
    {
        INVALID_ARRAY_NO = -1,
    };
};

#endif // !defined(AFX_UNITCNTARRAY_H__DCDB1552_CAB7_4842_BC36_D9023A5F035A__INCLUDED_)
