Remove dynamic exceptions
[anna.git] / include / anna / core / internal / ModuleManager.hpp
1 // ANNA - Anna is Not Nothingness Anymore                                                         //
2 //                                                                                                //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
4 //                                                                                                //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite                           //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7
8
9 #ifndef anna_core_internal_ModuleManager_hpp
10 #define anna_core_internal_ModuleManager_hpp
11
12 #include <vector>
13
14 #include <anna/core/Singleton.hpp>
15
16 namespace anna {
17
18 class ModuleManager : public Singleton <ModuleManager> {
19 public:
20   typedef std::pair <const char*, const char*> Module;
21   typedef std::vector <Module> Modules;
22   typedef Modules::const_iterator const_iterator;
23
24   void insert(const char* module, const char* revision) ;
25   const_iterator begin() const { return a_modules.begin(); }
26   const_iterator end() const { return a_modules.end(); }
27
28   static const char* module(const_iterator& ii) { return ii->first; }
29   static const char* revision(const_iterator& ii) { return ii->second;; }
30
31 private:
32   Modules a_modules;
33
34   ModuleManager() {;}
35
36   ModuleManager(const ModuleManager&);
37
38   friend class Singleton <ModuleManager>;
39 };
40
41 }
42
43 #endif
44