TGlobalsSystem Class Reference

This class manages all system-important objects of classes like VFS, global configuration etc. More...

#include <GlobalsSystem.h>

Inheritance diagram for TGlobalsSystem:

Inheritance graph
[legend]
Collaboration diagram for TGlobalsSystem:

Collaboration graph
[legend]
List of all members.

Static Public Member Functions

static BOOL Initialize (void)
 This method initialize static items in TGlobalsSystem with default objects.
static void Destroy (void)
 This method destroy all static objects stored inside this class.
static void SetFileSystem (TFSFileSystem *filesystem)
 Set VFS.
static const TFSFileSystemGetFileSystem (void)
 Returns actual VFS.
static void SetConfiguration (TConfigFile *configFile)
 Set configuration file.
static const TConfigFileGetConfiguration (void)
 Returns actual configuration file.
static void SetLogFile (TLogFile *logFile)
 Set file for logging.
static const TLogFileGetLogFile (void)
 Returns actual logfile.

Detailed Description

This class manages all system-important objects of classes like VFS, global configuration etc.

You must set this objects at begin of program. All objects MUST be dynamically allocated because they are destroyed at end of program via method Destroy() - this method must be called manually.

It's recommended to initialize this static class with method Initialize() which initialize all items to default (first load file 'system.ini' and from it initialize other items)

All GET method must always return non-NULL pointers!!!

Todo:
add next objects

Definition at line 33 of file GlobalsSystem.h.


Member Function Documentation

void TGlobalsSystem::Destroy void   )  [static]
 

This method destroy all static objects stored inside this class.

Definition at line 107 of file GlobalsSystem.cpp.

References TMemManager::GetAlign(), TMemManager::GetAllocation(), TMemManager::GetMem(), TLogFile::Write(), TLogFile::WriteINT(), and TLogFile::WriteNewLine().

Referenced by Initialize(), and WinMain().

Here is the call graph for this function:

static const TConfigFile* TGlobalsSystem::GetConfiguration void   )  [inline, static]
 

Returns actual configuration file.

You cannot change this pointer, pointer is destroyed via Destroy method.

Definition at line 85 of file GlobalsSystem.h.

Referenced by NSMeshes::TDeclarationManager::Initialize().

static const TFSFileSystem* TGlobalsSystem::GetFileSystem void   )  [inline, static]
 

Returns actual VFS.

You cannot change this pointer, pointer is destroyed via Destroy method.

Definition at line 68 of file GlobalsSystem.h.

Referenced by NSConfigFile::TConfigFile::LoadConfigFileFromVFS(), NSMeshes::TDeclarationLoader::LoadDeclarationFromFile(), NSMeshes::TMeshLoader::LoadMeshDataFromFile(), and NSMeshes::TMeshLoader::LoadMeshFromFile().

static const TLogFile* TGlobalsSystem::GetLogFile void   )  [inline, static]
 

Returns actual logfile.

You cannot change this pointer, pointer is destroyed via Destroy method.

Definition at line 102 of file GlobalsSystem.h.

Referenced by NSMeshes::TDeclarationManager::CreateDeclarationManager(), NSShaders::TPixelShaderManager::CreatePixelShaderManager(), TTextureManager::CreateTextureManager(), NSShaders::TVertexShaderManager::CreateVertexShaderManager(), TGlobalsMath::Destroy(), TGlobalsGraphic::Destroy(), NSMeshes::TDeclarationManager::DestroyDeclarationManager(), NSShaders::TPixelShaderManager::DestroyPixelShaderManager(), NSMeshes::TMeshManager::DestroyRendererResources(), TTextureManager::DestroyTextureManager(), NSShaders::TVertexShaderManager::DestroyVertexShaderManager(), TGlobalsMath::Initialize(), TGlobalsGraphic::Initialize(), NSMeshes::TDeclarationManager::Initialize(), NSMeshes::TMeshManager::LoadRendererResources(), and WinMain().

BOOL TGlobalsSystem::Initialize void   )  [static]
 

This method initialize static items in TGlobalsSystem with default objects.

Previous objects are automatically destroyed.

It first load configuration file 'system.ini' - section '[system]' and from it read information about next objects.

If there is problem (e.g. missing 'system.ini' or section '[system]') then FALSE is returned and application should be closed.

Definition at line 29 of file GlobalsSystem.cpp.

References DBGTEXTF, Destroy(), FALSE, and NSConfigFile::TConfigFile::LoadConfigFile().

Referenced by WinMain().

Here is the call graph for this function:

static void TGlobalsSystem::SetConfiguration TConfigFile configFile  )  [inline, static]
 

Set configuration file.

Previous instance is lost, thus you should call this method only once.

Parameters:
configFile [in] global configuration file

Definition at line 76 of file GlobalsSystem.h.

References DBGASSERT.

static void TGlobalsSystem::SetFileSystem TFSFileSystem filesystem  )  [inline, static]
 

Set VFS.

Previous instance is lost, thus you should call this method only once.

Parameters:
filesystem [in] virtual file system

Definition at line 59 of file GlobalsSystem.h.

References DBGASSERT.

static void TGlobalsSystem::SetLogFile TLogFile logFile  )  [inline, static]
 

Set file for logging.

Previous instance is lost, thus you should call this method only once.

Parameters:
logFile [in] global file for logging

Definition at line 93 of file GlobalsSystem.h.

References DBGASSERT.


The documentation for this class was generated from the following files:
Generated on Wed Nov 28 22:42:25 2007 for Joy4D by  doxygen 1.4.6-NO