// __author__ = Juan Carlos De Abreu (jcabreur@gmail.com)

/**
 * TODO(jcabreur): write a general comment here
 */

#ifndef UTIL_CPU_ID_H__
#define UTIL_CPU_ID_H__

#include "../global.h"
#include "../Includes/Basic.h"
#include "../Base/Singleton.h"
#include "string.h"
#include <intrin.h>

// TODO: finishess ...

BEGIN_TEG_NAMESPACE();

// Macros to get the information of the cpu
#define CPU_FAMILY		CPUid::GetInstance().GetFamilyName().c_str()
#define CPU_VENDOR		CPUid::GetInstance().GetVendorName().c_str()
#define CPU_FEATURES	CPUid::GetInstance().GetFeatures().c_str()
#define CPU_CLOCK_SPEED	CPUid::GetInstance().GetClockSpeed().c_str()

// Definition of the structure that allow get the information of the cpu
class CPUid : public Singleton<CPUid> {
protected:
	// Attributes
	std::tstring familyName;
	std::tstring vendorName;
	std::tstring features;
	std::tstring clockSpeed;

public:
	// Constructor
	CPUid();

	// Destructor
	~CPUid();

	// Methods
	std::tstring& GetFamilyName();
	std::tstring& GetVendorName();
	std::tstring& GetFeatures();
	std::tstring& GetClockSpeed();
};

END_TEG_NAMESPACE();

#endif  // UTIL_CPU_ID_H__

