/*******************************************************************************
*                                                                              *
* Société de Transports de Montréal.                                    	   *
* 2013                                                                         *
*                                                                              *
* Projet Zones Tests                                                           *
*                                                                              *
*                                                                              *
*                                                                              *
*******************************************************************************/
/*
    Description:
    Description du fichier si nécessaire.
    
*/

/* ************************************************************************** */
/* Revision:
### 20130201 JFM
    Verision d'origine.
    
### YYYYMMDD Description du besoin ou du bug
    Description du changement.
 */

/* ************************************************************************** */
#include "GlobalDefine.h"

#ifndef RAMMONITOR_H
#define RAMMONITOR_H

#include <QFile>
#include <QTimer>
#include <QObject>




class CRamMonitor : public QObject
{
	Q_OBJECT
public:

    //CEngLog is a singleton class
	static CRamMonitor* instance(){return &mSingleton;}
	static CRamMonitor mSingleton;

	CRamMonitor();
	~CRamMonitor();

	long GetRamUsage(bool print = false);
	long GetRamDelta(bool print = false);

	void StartTimer();
	void StopTimer();

private:
	long mLastRamUsage;
	QTimer mRamUsageTimer;

#ifdef LOG_RAM_USAGE
	QFile *mRamLogFile;
#endif

public slots:
	void RamUsageTimerExpired();

};

#endif // RAMMONITOR_H
