SimpleGL  1.1.0
A framework for platform independent rendering
manager.hpp
Go to the documentation of this file.
1 
8 #ifndef MANAGER_HPP
9 #define MANAGER_HPP
10 
11 #include "SimpleGL_Export.h"
12 
13 #include <map>
14 #include <string>
15 
16 namespace sgl {
17 
23  template <class T>
24  class Manager {
25 
26  protected:
28  std::map<std::string, T*> objects;
29 
31  Manager(void);
32 
33  public:
35  ~Manager(void);
36 
43  void put(std::string name, T* value);
44 
52  T* get(std::string name);
53 
59  virtual void remove(std::string name);
60 
62  virtual void clear();
63  };
64 }
65 
66 #include "manager.tcc"
67 
68 #endif /* MANAGER_HPP */
std::map< std::string, T * > objects
Contains the objects to manage.
Definition: manager.hpp:28
Generic namespace for the SimpleGL framework.
Definition: application.hpp:18
Manager(void)
Initializes a new manager.
Definition: manager.tcc:15
void put(std::string name, T *value)
Stores a object with specified name.
Definition: manager.tcc:26
virtual void clear()
Removes all objects and disposes them.
Definition: manager.tcc:47
This class provides an abstract class for managing objects.
Definition: manager.hpp:24
~Manager(void)
Deletes a manager and disposes all managed objects.
Definition: manager.tcc:20