Platform.h
Go to the documentation of this file.00001 00043 #ifndef __Platform_H__ 00044 #define __Platform_H__ 00045 00046 // Includes 00047 #include "PlatformEventListener.h" 00048 00049 // Forward declares 00050 class Platform_OS; 00051 class Platform_Time; 00052 class Platform_Sound; 00053 class Platform_Input; 00054 class Platform_FileSystem; 00055 class Platform_Screen; 00056 class Platform_Network; 00057 class Platform_3D; 00058 00059 00060 // Platform 00061 class Platform 00062 { 00063 public: 00073 static void SetPlatform_OS( 00074 Platform_OS* instance 00075 ); 00076 00077 00087 static void SetPlatform_Time( 00088 Platform_Time* instance 00089 ); 00090 00091 00101 static void SetPlatform_Sound( 00102 Platform_Sound* instance 00103 ); 00104 00105 00115 static void SetPlatform_Input( 00116 Platform_Input* instance 00117 ); 00118 00119 00129 static void SetPlatform_FileSystem( 00130 Platform_FileSystem* instance 00131 ); 00132 00133 00143 static void SetPlatform_Screen( 00144 Platform_Screen* instance 00145 ); 00146 00147 00157 static void SetPlatform_Network( 00158 Platform_Network* instance 00159 ); 00160 00161 00171 static void SetPlatform_3D( 00172 Platform_3D* instance 00173 ); 00174 00175 00184 static Platform_OS* GetPlatform_OS(); 00185 00194 static Platform_Time* GetPlatform_Time(); 00195 00196 00205 static Platform_Sound* GetPlatform_Sound(); 00206 00207 00216 static Platform_Input* GetPlatform_Input(); 00217 00218 00227 static Platform_FileSystem* GetPlatform_FileSystem(); 00228 00229 00238 static Platform_Screen* GetPlatform_Screen(); 00239 00240 00249 static Platform_Network* GetPlatform_Network(); 00250 00251 00260 static Platform_3D* GetPlatform_3D(); 00261 00262 00270 static void RegisterEventListener( 00271 PlatformEventListener* listener 00272 ); 00273 00280 static void UnregisterEventListener( 00281 PlatformEventListener* listener 00282 ); 00283 00289 static void SendEvent_OsYield(); 00290 00296 static void SendEvent_CustomEvent 00297 ( 00298 const char* eventId, 00299 void* userData = 0 00300 ); 00301 00302 private: 00303 // Constructor/Destructor is private - we only ever want the one static instance of this class 00304 Platform(); 00305 ~Platform(); 00306 00307 static Platform platform_; 00308 00309 static Platform_OS* platform_OS_; 00310 static Platform_Time* platform_Time_; 00311 static Platform_Sound* platform_Sound_; 00312 static Platform_Input* platform_Input_; 00313 static Platform_FileSystem* platform_FileSystem_; 00314 static Platform_Screen* platform_Screen_; 00315 static Platform_Network* platform_Network_; 00316 static Platform_3D* platform_3D_; 00317 00318 static const int MaxEventListeners = 64; 00319 static PlatformEventListener* eventListeners_[MaxEventListeners]; 00320 static int eventListenerCount_; 00321 00322 private: 00323 // The following will generate a compiler error if there is an attempt 00324 // to create a second instance of the class 00325 Platform(const Platform&); 00326 const Platform& operator=(const Platform&); 00327 00328 }; 00329 00330 #endif /* __Platform_H__ */
Reproduction/republishing of any material on this site without permission is strictly prohibited.
