Voxellancer  0.3
A game about voxels in space
 All Classes Functions Pages
handle.h
1 #pragma once
2 
3 #include <memory>
4 
5 
6 class WorldObject;
7 class Ship;
8 
9 template<class T>
10 class HandleImpl;
11 
12 template<class T>
13 class Handle {
14 public:
15  explicit Handle(T* object);
16 
17  T* get();
18  const T* get() const;
19 
20  T* operator->();
21  const T* operator->() const;
22 
23  T* operator*();
24  const T* operator*() const;
25 
26  bool valid() const;
27 
28  void invalidate();
29 
30 
31 protected:
32  std::shared_ptr<HandleImpl<T>> m_impl;
33 };
34 
35 #include "handle.inl"
Definition: handle.h:10
Definition: worldobject.h:43
Definition: handle.h:13
Definition: ship.h:23