Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TemplateManager.h
Go to the documentation of this file.
1 //
2 // C++ Interface: Audio::TemplateManager
3 //
4 #ifndef __AUDIO_TEMPLATEMANAGER_H__INCLUDED__
5 #define __AUDIO_TEMPLATEMANAGER_H__INCLUDED__
6 
7 #include <string>
8 #include <map>
9 #include <set>
10 #include "Types.h"
11 #include "Exceptions.h"
12 #include "Singleton.h"
13 
14 namespace XMLDOM {
15  class XMLDocument;
16 };
17 
18 
19 namespace Audio {
20 
21  // The manager needs not know what it's managing... right?
22  // At least not its interface.
23  class SourceTemplate;
24 
25  namespace __impl {
26 
27  // Forward declaration of internal template manager data
28  struct TemplateManagerData;
29 
30  };
31 
49  class TemplateManager : public Singleton<TemplateManager>
50  {
51  private:
52  AutoPtr<__impl::TemplateManagerData> data;
53 
54  public:
58  TemplateManager() throw();
59 
61 
62 
64  void addDefinitionFile(const std::string &path, bool persistent) throw(Exception);
65 
67  void addDefinitionFile(const std::string &path, SharedPtr<XMLDOM::XMLDocument> definition) throw(Exception);
68 
70  SharedPtr<XMLDOM::XMLDocument> getDefinitionFile(const std::string &path) const throw(ResourceNotLoadedException);
71 
73  SharedPtr<XMLDOM::XMLDocument> getDefinitionFile(const std::string &path) throw(Exception);
74 
75 
80  void setDefaultDefinitionFile(const std::string &x) throw();
81 
85  const std::string& getDefaultDefinitionFile() const throw();
86 
88  SharedPtr<SourceTemplate> getSourceTemplate(const std::string &name) throw(Exception);
89 
102  void addSourceTemplate(const std::string &name, SharedPtr<SourceTemplate> tpl, bool perm = true) throw(ResourceAlreadyLoadedException);
103 
118  void addSourceTemplate(const std::string &path, const std::string &name, SharedPtr<SourceTemplate> tpl, bool perm = true) throw(ResourceAlreadyLoadedException);
119 
120  protected:
121 
123  SharedPtr<SourceTemplate> loadSourceTemplate(const std::string &name) throw(Exception);
124 
125 
126  };
127 
128 };
129 
130 #endif//__AUDIO_TEMPLATEMANAGER_H__INCLUDED__