GUI
Handle.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 by Maciej Wiecierzewski
3  */
4 
5 #ifndef HANDLE_H
6 #define HANDLE_H
7 
8 namespace gui
9 {
10 
12 
13 template<class T> class Handle
14 {
15  public:
16  Handle() : pointer(NULL) {};
17 
18  T* operator->() { return pointer; }
19  T& operator*() { return *pointer; }
20 
21  protected:
22 
23  private:
24  Handle(T *pointer) : pointer(pointer) {};
25 
26  T *pointer;
27 
28  friend class GUISystem;
29 };
30 
31 }
32 
33 #endif // HANDLE_H