Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <TemplateManager.h>
Public Member Functions | |
TemplateManager () throw () | |
~TemplateManager () | |
void | addDefinitionFile (const std::string &path, bool persistent) throw (Exception) |
void | addDefinitionFile (const std::string &path, SharedPtr< XMLDOM::XMLDocument > definition) throw (Exception) |
SharedPtr< XMLDOM::XMLDocument > | getDefinitionFile (const std::string &path) const throw (ResourceNotLoadedException) |
SharedPtr< XMLDOM::XMLDocument > | getDefinitionFile (const std::string &path) throw (Exception) |
void | setDefaultDefinitionFile (const std::string &x) throw () |
const std::string & | getDefaultDefinitionFile () const throw () |
SharedPtr< SourceTemplate > | getSourceTemplate (const std::string &name) throw (Exception) |
void | addSourceTemplate (const std::string &name, SharedPtr< SourceTemplate > tpl, bool perm=true) throw (ResourceAlreadyLoadedException) |
void | addSourceTemplate (const std::string &path, const std::string &name, SharedPtr< SourceTemplate > tpl, bool perm=true) throw (ResourceAlreadyLoadedException) |
Protected Member Functions | |
SharedPtr< SourceTemplate > | loadSourceTemplate (const std::string &name) throw (Exception) |
![]() | |
~Singleton () | |
Additional Inherited Members | |
![]() | |
static TemplateManager * | getSingleton () |
![]() | |
static void | initializeSingleton () |
static void | deinitializeSingleton () |
![]() | |
static TemplateManager * | _singletonInstance |
Template manager class.
Definition at line 49 of file TemplateManager.h.
Audio::TemplateManager::TemplateManager | ( | ) | ||
throw | ( | |||
) |
Construct a new manager
Definition at line 154 of file TemplateManager.cpp.
Audio::TemplateManager::~TemplateManager | ( | ) |
Definition at line 159 of file TemplateManager.cpp.
void Audio::TemplateManager::addDefinitionFile | ( | const std::string & | path, |
bool | persistent | ||
) | |||
throw | ( | Exception | |
) |
Add a definition file, persistent or not
void Audio::TemplateManager::addDefinitionFile | ( | const std::string & | path, |
SharedPtr< XMLDOM::XMLDocument > | definition | ||
) | |||
throw | ( | Exception | |
) |
Add a definition document under a specified path, always persistent (as there is no way to reload)
void Audio::TemplateManager::addSourceTemplate | ( | const std::string & | name, |
SharedPtr< SourceTemplate > | tpl, | ||
bool | perm = true |
||
) | |||
throw | ( | ResourceAlreadyLoadedException | |
) |
Add a manually-created template
name | the name portion of the template's key |
tpl | the template to be added |
perm | if true, a strong reference will be held and the template will become permanently loaded. |
ResourceAlreadyLoadedException,when | the key already has an associated template. |
void Audio::TemplateManager::addSourceTemplate | ( | const std::string & | path, |
const std::string & | name, | ||
SharedPtr< SourceTemplate > | tpl, | ||
bool | perm = true |
||
) | |||
throw | ( | ResourceAlreadyLoadedException | |
) |
Add a manually-created template
path | the path portion of the template's key |
name | the name portion of the template's key |
tpl | the template to be added |
perm | if true, a strong reference will be held and the template will become permanently loaded. |
ResourceAlreadyLoadedException,when | the key already has an associated template. |
const std::string & Audio::TemplateManager::getDefaultDefinitionFile | ( | ) | const | |
throw | ( | |||
) |
Get the default definition file
Definition at line 205 of file TemplateManager.cpp.
SharedPtr< XMLDOM::XMLDocument > Audio::TemplateManager::getDefinitionFile | ( | const std::string & | path) | const | |
throw | ( | ResourceNotLoadedException | |||
) |
Get an already loaded definition file, fail if not found or not loaded
Definition at line 182 of file TemplateManager.cpp.
SharedPtr< XMLDOM::XMLDocument > Audio::TemplateManager::getDefinitionFile | ( | const std::string & | path) | ||
throw | ( | Exception | |||
) |
Get an already loaded definition file, load if not loaded
Definition at line 188 of file TemplateManager.cpp.
References e.
SharedPtr< SourceTemplate > Audio::TemplateManager::getSourceTemplate | ( | const std::string & | name) | ||
throw | ( | Exception | |||
) |
|
protected |
Get a source template by its key
Definition at line 228 of file TemplateManager.cpp.
References f, XMLDOM::XMLElement::getAttributeValue(), M_PI, Audio::__impl::parseBool(), Audio::__impl::parseFloat(), and Audio::__impl::parseVSFileType().
void Audio::TemplateManager::setDefaultDefinitionFile | ( | const std::string & | x) | ||
throw | ( | ||||
) |
Set default definition file
Definition at line 199 of file TemplateManager.cpp.
References x.