Go to the documentation of this file.00001
00002
00003 #ifndef _PLATFORM_DRIVER_H_
00004 #define _PLATFORM_DRIVER_H_
00005
00006 #include <EngineConfig.h>
00007 #include <core/Types.h>
00008
00009 namespace platform
00010 {
00011
00012 class Thread;
00013
00015 enum CpuTechnology
00016 {
00017 CT_FPU = 0x01,
00018 CT_MMX = 0x02,
00019 CT_SSE = 0x03,
00020 CT_SSE2 = 0x04,
00021 CT_SSE3 = 0x05,
00022 CT_3DNOW = 0x06,
00023 CT_E3DNOW = 0x07,
00024 CT_CMOV = 0x08,
00025 CT_FCMOV = 0x09,
00026 CT_RDTSC = 0x0A,
00027 CT_HT = 0x0B,
00028 CT_EST = 0x0C,
00029 CT_ALTIVEC = 0x0D
00030 };
00031
00040 class ENGINE_PUBLIC_EXPORT PlatformDriver
00041 {
00042 public:
00043
00045 PlatformDriver();
00046
00048 virtual ~PlatformDriver();
00049
00050 virtual void initialize();
00051
00052 virtual void start();
00053
00054 virtual void stop();
00055
00056 virtual const char* getCPUVendorId() = 0;
00057
00058 virtual f32 getCPUFrequency() = 0;
00059
00060 virtual bool checkCPUTechnology(CpuTechnology tech) = 0;
00061
00062 virtual u16 getLogicalProcessorsNum() = 0;
00063
00064 virtual u16 getPhysicalProcessorsNum() = 0;
00065
00066 virtual u32 getCPUCacheSize(u32 level) = 0;
00067
00068 virtual u32 getTotalMemory();
00069
00070 virtual u32 getFreeMemory();
00071
00072 virtual u32 getSharedMemory();
00073
00074 virtual u32 getBufferMemory();
00075
00076 virtual u32 getTotalSwap();
00077
00078 virtual u32 getFreeSwap();
00079
00080 virtual void copyToClipboard(const c8* text) = 0;
00081
00082 virtual c8* getTextFromClipboard() = 0;
00083
00084 virtual Thread* createThread() = 0;
00085
00086 virtual void removeThread(Thread* thread) = 0;
00087
00088 virtual void sleep(u32 miliseconds) = 0;
00089 };
00090
00091 }
00092
00093 #endif