LASi: manager.h Source File

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
Manager::_t
T _t
Definition: manager.h:26
Manager
Manager template.
Definition: manager.h:24
Manager::release
void release()
Definition: manager.h:35
Manager::Manager
Manager()
Definition: manager.h:29
Manager::isOwner
bool isOwner() const
Definition: manager.h:34
Manager::_isOwner
bool _isOwner
Definition: manager.h:38