Om
shareable.hpp
Go to the documentation of this file.
1 
15 #ifndef Om_Shareable_
16 
17  #define Om_Shareable_ \
18  Om::Shareable
19 
20  #ifndef Om_Macro_Precompilation_
21 
22  #include <cstddef>
23 
24  #endif
25 
26 namespace Om {
27 
28  // MARK: - Om::Shareable
29 
36  template <typename ThisOwnerCount = size_t>
37  class Shareable {
38 
45  template <typename TheOwnerCount>
46  friend void intrusive_ptr_add_ref(
48  );
49 
54  template <typename TheOwnerCount>
55  friend void intrusive_ptr_release(
57  );
58 
59  public: // MARK: public (non-static)
60 
61  virtual ~Shareable() = 0;
62 
63  ThisOwnerCount GetOwnerCount() const;
64 
65  protected: // MARK: protected (non-static)
66 
68 
69  Shareable(Shareable const &);
70 
72 
73  private: // MARK: private (non-static)
74 
76 
78 
85  ThisOwnerCount thisOwnerCount;
86 
87  };
88 
89  // MARK: - Om::
90 
91  template <typename TheOwnerCount>
94  );
95 
96  template <typename TheOwnerCount>
99  );
100 
101 }
102 
103  #include "om/shareable.cpp"
104 
105 #endif
A pointee for boost::intrusive_ptr.
Definition: shareable.hpp:37
Shareable(Shareable const &)
ThisOwnerCount GetOwnerCount() const
friend void intrusive_ptr_add_ref(Shareable< TheOwnerCount > *const)
friend void intrusive_ptr_release(Shareable< TheOwnerCount > *const)
void DecrementOwnerCount()
Shareable & operator=(Shareable const &)
ThisOwnerCount thisOwnerCount
The number of owners of this object.
Definition: shareable.hpp:85
virtual ~Shareable()=0
void IncrementOwnerCount()
The Om library.
Definition: code_point.hpp:26
void intrusive_ptr_add_ref(Shareable< TheOwnerCount > *const)
void intrusive_ptr_release(Shareable< TheOwnerCount > *const)
Om source file.