LASi
manager.h
Go to the documentation of this file.
1 
13 #ifndef MANAGER_H
14 #define MANAGER_H
15 
16 #include <stdexcept>
17 #include <string>
18 #include <iostream>
19 
23 template <class T>
24 class Manager {
25  protected:
26  T _t;
27 
28  public:
29  Manager() : _t(0), _isOwner(false) {}
30  Manager<T>(const T t) : _t(t), _isOwner(true) {}
31  operator T() const {return _t;}
32 
33  protected:
34  bool isOwner() const {return _isOwner;}
35  void release() {_isOwner = false;}
36 
37  private:
38  bool _isOwner;
39 };
40 
41 #endif