SimpleGL  1.1.0
A framework for platform independent rendering
manager.tcc
Go to the documentation of this file.
1 
8 #include "SimpleGL/manager.hpp"
9 
10 using namespace std;
11 
12 namespace sgl {
13 
14  template <class T>
16  /* Nothing to do here */
17  }
18 
19  template <class T>
21  /* Clear map */
22  clear();
23  }
24 
25  template <class T>
26  void Manager<T>::put(std::string name, T* value) {
27  /* If key already exist, dispose the old object */
28  if (objects.count(name)) {
29  remove(name);
30  }
31 
32  /* Insert new object */
33  objects.insert(make_pair(name, value));
34  }
35 
36  template <class T>
37  T* Manager<T>::get(std::string name) {
38  return objects.at(name);
39  }
40 
41  template <class T>
42  void Manager<T>::remove(std::string name) {
43  objects.erase(name);
44  }
45 
46  template <class T>
48  objects.clear();
49  }
50 }
Generic namespace for the SimpleGL framework.
Definition: application.hpp:18
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