voxelTerrain
 All Classes Functions Variables Typedefs Enumerations Pages
sharedPointer.hpp
1 #ifndef BLUB_SHAREDPOINTER_HPP
2 #define BLUB_SHAREDPOINTER_HPP
3 
4 #include <memory>
5 
6 
7 namespace blub
8 {
9 
10 
11 template <class T>
12 class sharedPointer : public std::shared_ptr<T>
13 {
14 public:
15  typedef std::shared_ptr<T> t_base;
16 
18  {}
19  sharedPointer(T* ptr)
20  : t_base(ptr)
21  {}
22  sharedPointer(t_base ptr)
23  : t_base(ptr)
24  {}
25  template <class U>
26  sharedPointer(std::shared_ptr<U> ptr)
27  : t_base(ptr)
28  {}
29 
30  template <class U>
31  sharedPointer<U> staticCast()
32  {
33  std::shared_ptr<U> result(std::static_pointer_cast<U>(*this));
34  return result;
35  }
36 
37  T* data() const
38  {
39  return t_base::get();
40  }
41 
42  void reset()
43  {
44  t_base::reset();
45  }
46 
47  bool isNull() const
48  {
49  return data() == nullptr;
50  }
51 
52 protected:
53 
54 };
55 
56 
57 using std::make_shared;
58 
59 
60 }
61 
62 
63 #endif // BLUB_SHAREDPOINTER_HPP
Definition: sharedPointer.hpp:12
Definition: deadlineTimer.hpp:10
Definition: customVertexInformation.cpp:177