Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
platform::PlatformManager Class Reference

#include <PlatformManager.h>

Inheritance diagram for platform::PlatformManager:
engine::Object core::Singleton< PlatformManager >

List of all members.

Classes

struct  FileSystemInfo
 Loaded file systems. More...

Public Member Functions

bool checkCPUTechnology (CpuTechnology tech)
 Returns true if technology from CpuTechnology enumeration support by installed CPU.
void copyToClipboard (const c8 *text)
 copies text to the clipboard
FileSystemcreateFileSystem (const std::string &path, const std::string &type)
ThreadcreateThread ()
u32 getBufferMemory ()
u32 getCPUCacheSize (u32 level)
 Returns cache size in k-bytes.
f32 getCPUFrequency ()
 Returns the Frequency the CPU is operating at.
const char * getCPUVendorId ()
u32 getFreeMemory ()
u32 getFreeSwap ()
u16 getLogicalProcessorsNum ()
 Returns the number of logical processors per physical processors.
u16 getPhysicalProcessorsNum ()
 Returns the number of physical processors.
u32 getSharedMemory ()
c8getTextFromClipboard ()
TimergetTimer ()
u32 getTotalMemory ()
u32 getTotalSwap ()
 PlatformManager ()
 Default constructor.
void registerFileSystemFactory (const std::string &type, FileSystemFactory *factory)
void removeAllFileSystems ()
void removeAllThreads ()
void removeFileSystem (FileSystem *fs)
void removeFileSystemFactory (const std::string &type)
void removePlatformDriver ()
void removeThread (Thread *thread)
void removeThread (const u32 &id)
void removeTimer ()
void setPlatformDriver (PlatformDriver *driver)
void setTimer (Timer *timer)
void sleep (u32 miliseconds)
void start ()
void stop ()
 ~PlatformManager ()

Static Public Member Functions

static PlatformManagergetInstance ()
 Get instance.

Protected Member Functions

void initializeImpl ()
void uninitializeImpl ()
void updateImpl (f32 elapsedTime)

Protected Attributes

std::map< std::string,
FileSystemFactory * > 
mFileSystemFactories
 Factories available to create file systems, indexed by type (String identifier e.g. 'FileSystem', 'ZipFileSystem')
std::map< u32, FileSystemInfomFileSystems
PlatformDrivermPlatformDriver
std::map< u32, Thread * > mThreads
TimermTimer

Detailed Description

Class which manages the platform settings the Game runs on. Because the Game is designed to be platform-independent, it dynamically loads a library containing all the platform-specific elements like dialogs etc. This class manages that load and provides a simple interface to the platform.


Constructor & Destructor Documentation

platform::PlatformManager::PlatformManager ( )
platform::PlatformManager::~PlatformManager ( )

References getInstance().


Member Function Documentation

bool platform::PlatformManager::checkCPUTechnology ( CpuTechnology  tech)

Returns true if technology from CpuTechnology enumeration support by installed CPU.

References platform::PlatformDriver::checkCPUTechnology(), and mPlatformDriver.

void platform::PlatformManager::copyToClipboard ( const c8 text)

copies text to the clipboard

References platform::PlatformDriver::copyToClipboard(), and mPlatformDriver.

FileSystem * platform::PlatformManager::createFileSystem ( const std::string &  path,
const std::string &  type 
)
Thread * platform::PlatformManager::createThread ( )
u32 platform::PlatformManager::getBufferMemory ( )

returns buffer memory size is returned in bytes.

References platform::PlatformDriver::getBufferMemory(), and mPlatformDriver.

u32 platform::PlatformManager::getCPUCacheSize ( u32  level)

Returns cache size in k-bytes.

References platform::PlatformDriver::getCPUCacheSize(), and mPlatformDriver.

f32 platform::PlatformManager::getCPUFrequency ( )

Returns the Frequency the CPU is operating at.

References platform::PlatformDriver::getCPUFrequency(), and mPlatformDriver.

const char * platform::PlatformManager::getCPUVendorId ( )

Returns the CPU's vendor identification string, or "Generic_x86" if it doesn't exist on installed processor.

References platform::PlatformDriver::getCPUVendorId(), and mPlatformDriver.

u32 platform::PlatformManager::getFreeMemory ( )

returns free memory size is returned in bytes.

References platform::PlatformDriver::getFreeMemory(), and mPlatformDriver.

u32 platform::PlatformManager::getFreeSwap ( )

returns free swap size is returned in bytes.

References platform::PlatformDriver::getFreeSwap(), and mPlatformDriver.

PlatformManager * platform::PlatformManager::getInstance ( ) [static]
u16 platform::PlatformManager::getLogicalProcessorsNum ( )

Returns the number of logical processors per physical processors.

References platform::PlatformDriver::getLogicalProcessorsNum(), and mPlatformDriver.

u16 platform::PlatformManager::getPhysicalProcessorsNum ( )

Returns the number of physical processors.

References platform::PlatformDriver::getPhysicalProcessorsNum(), and mPlatformDriver.

u32 platform::PlatformManager::getSharedMemory ( )

returns shared memory size is returned in bytes.

References platform::PlatformDriver::getSharedMemory(), and mPlatformDriver.

c8 * platform::PlatformManager::getTextFromClipboard ( )

gets text from the clipboard

Returns:
Returns NULL if no string is in there.

References platform::PlatformDriver::getTextFromClipboard(), and mPlatformDriver.

Timer * platform::PlatformManager::getTimer ( )

References mTimer.

Referenced by engine::EngineManager::initializeImpl().

u32 platform::PlatformManager::getTotalMemory ( )

returns total memory size is returned in bytes.

References platform::PlatformDriver::getTotalMemory(), and mPlatformDriver.

u32 platform::PlatformManager::getTotalSwap ( )

returns total swap size is returned in bytes.

References platform::PlatformDriver::getTotalSwap(), and mPlatformDriver.

void platform::PlatformManager::initializeImpl ( ) [protected, virtual]
void platform::PlatformManager::registerFileSystemFactory ( const std::string &  type,
FileSystemFactory factory 
)

References mFileSystemFactories.

void platform::PlatformManager::removeAllFileSystems ( )
void platform::PlatformManager::removeAllThreads ( )
void platform::PlatformManager::removeFileSystem ( FileSystem fs)
void platform::PlatformManager::removeFileSystemFactory ( const std::string &  type)

References mFileSystemFactories.

void platform::PlatformManager::removePlatformDriver ( )

References mPlatformDriver.

void platform::PlatformManager::removeThread ( const u32 id)
void platform::PlatformManager::removeThread ( Thread thread)
void platform::PlatformManager::removeTimer ( )

References mTimer.

void platform::PlatformManager::setPlatformDriver ( PlatformDriver driver)

References mPlatformDriver.

void platform::PlatformManager::setTimer ( Timer timer)

References mTimer.

void platform::PlatformManager::sleep ( u32  miliseconds)

sleep for the given number of miliseconds this can be used to give some CPU time to other processes

References mPlatformDriver, and platform::PlatformDriver::sleep().

void platform::PlatformManager::start ( )
void platform::PlatformManager::stop ( )
void platform::PlatformManager::uninitializeImpl ( ) [protected, virtual]

Reimplemented from engine::Object.

References getInstance(), and removeAllFileSystems().

void platform::PlatformManager::updateImpl ( f32  elapsedTime) [protected, virtual]

Reimplemented from engine::Object.


Member Data Documentation

Factories available to create file systems, indexed by type (String identifier e.g. 'FileSystem', 'ZipFileSystem')

Referenced by createFileSystem(), registerFileSystemFactory(), removeAllFileSystems(), removeFileSystem(), and removeFileSystemFactory().


The documentation for this class was generated from the following files:

The KG Game Engine
The KG Game Engine Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:08 by Doxygen (1.7.4)