syBR::Game::PluginSettings Class Reference

Plugin settings manager class. More...

#include <PluginSettings.hpp>

List of all members.

Public Member Functions

bool load ()
 Load settings.
bool save () const
 Save settings.
void setAudioPlugin (const std::string &file)
 Set the name of the audio plugin.
const std::string & getAudioPlugin () const
 Get the name of the audio plugin.
void setInputPlugin (const std::string &file)
 Set the name of the input plugin.
const std::string & getInputPlugin () const
 Get the name of the input plugin.
void setNetworkPlugin (const std::string &file)
 Set the name of the network plugin.
const std::string & getNetworkPlugin () const
 Get the name of the network plugin.

Static Public Member Functions

static bool initializeSingleton (Core::Logger *pLogger)
 Initialize singleton.
static PluginSettingsgetSingleton (Core::Logger *pLogger)
 Retrieve singleton instance.
static void terminateSingleton (Core::Logger *pLogger)
 Terminate singleton.

Private Member Functions

 PluginSettings (Core::Logger *pLogger)
 Constructor.
 ~PluginSettings ()
 Destructor.
void create ()
 Create the XML settings.

Private Attributes

Core::Loggerm_pLogger
 Pointer to the logger to be used.
XMLFile * m_pSettingsFile
 XML settings file.
std::string m_audioSystemPlugin
 Audio system plugin name.
std::string m_inputSystemPlugin
 Input system plugin name.
std::string m_networkSystemPlugin
 Network system plugin name.

Static Private Attributes

static PluginSettingssm_pSingleton = NULL
 Instance of the PluginSettings singleton.


Detailed Description

Plugin settings manager class.

In order to run a game, the engine needs to run a set of plugins (audio, input and network). This class allows to manage the plugins settings.


Constructor & Destructor Documentation

syBR::Game::PluginSettings::PluginSettings ( Core::Logger pLogger  )  [private]

Constructor.

Parameters:
pLogger Pointer to the instance of the logger to use

syBR::Game::PluginSettings::~PluginSettings (  )  [private]

Destructor.


Member Function Documentation

bool syBR::Game::PluginSettings::initializeSingleton ( Core::Logger pLogger  )  [static]

Initialize singleton.

Create a new instance of the plugin settings manager only if none already exists.

Parameters:
pLogger Pointer to the instance of the logger to use
Returns:
One of these:
  • true in case of success
  • false if it failed to create a new instance of the plugin manager when needed

PluginSettings * syBR::Game::PluginSettings::getSingleton ( Core::Logger pLogger  )  [static]

Retrieve singleton instance.

Parameters:
pLogger Pointer to the instance of the logger to use
Returns:
One of these:
  • Singleton instance if it has been initialized
  • NULL otherwise

void syBR::Game::PluginSettings::terminateSingleton ( Core::Logger pLogger  )  [static]

Terminate singleton.

Parameters:
pLogger Pointer to the instance of the logger to use

bool syBR::Game::PluginSettings::load (  ) 

Load settings.

The followings settings are loaded from this file:

Returns:
One of these:
  • true if settings were successfully loaded
  • false otherwise

bool syBR::Game::PluginSettings::save (  )  const

Save settings.

The followings settings are saved to this file:

Returns:
One of these:
  • true if settings were successfully saved
  • false otherwise

void syBR::Game::PluginSettings::setAudioPlugin ( const std::string &  file  ) 

Set the name of the audio plugin.

Parameters:
file Filename of the plugin to be used as audio plugin

const std::string & syBR::Game::PluginSettings::getAudioPlugin (  )  const

Get the name of the audio plugin.

Returns:
Filename of the plugin used as audio plugin

void syBR::Game::PluginSettings::setInputPlugin ( const std::string &  file  ) 

Set the name of the input plugin.

Parameters:
file Filename of the plugin to be used as input plugin

const std::string & syBR::Game::PluginSettings::getInputPlugin (  )  const

Get the name of the input plugin.

Returns:
Filename of the plugin used as input plugin

void syBR::Game::PluginSettings::setNetworkPlugin ( const std::string &  file  ) 

Set the name of the network plugin.

Parameters:
file Filename of the plugin to be used as network plugin

const std::string & syBR::Game::PluginSettings::getNetworkPlugin (  )  const

Get the name of the network plugin.

Returns:
Filename of the plugin used as network plugin

void syBR::Game::PluginSettings::create (  )  [private]

Create the XML settings.


Member Data Documentation

PluginSettings * syBR::Game::PluginSettings::sm_pSingleton = NULL [static, private]

Instance of the PluginSettings singleton.

Core::Logger* syBR::Game::PluginSettings::m_pLogger [private]

Pointer to the logger to be used.

XMLFile* syBR::Game::PluginSettings::m_pSettingsFile [private]

XML settings file.

std::string syBR::Game::PluginSettings::m_audioSystemPlugin [private]

Audio system plugin name.

std::string syBR::Game::PluginSettings::m_inputSystemPlugin [private]

Input system plugin name.

std::string syBR::Game::PluginSettings::m_networkSystemPlugin [private]

Network system plugin name.


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

Copyright © 2008 by Sebastien Frippiat
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.
Last modified Tue Dec 30 17:57:34 2008