FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
ShareableReference.h
1 #ifndef ShareableReference_h__
2 #define ShareableReference_h__
3 
4 /**********************************************************\
5 Original Author: Richard Bateman (taxilian)
6 
7 Created: Feb 19, 2011
8 License: Dual license model; choose one of two:
9  New BSD License
10  http://www.opensource.org/licenses/bsd-license.php
11  - or -
12  GNU Lesser General Public License, version 2.1
13  http://www.gnu.org/licenses/lgpl-2.1.html
14 
15 Copyright 2009 Richard Bateman, Firebreath development team
16 \**********************************************************/
17 
18 #include <boost/enable_shared_from_this.hpp>
19 
20 namespace FB {
21 
22  template <class C>
23  class ShareableReference : boost::noncopyable, public boost::enable_shared_from_this<ShareableReference<C> >
24  {
25  public:
26  ShareableReference(C* ptr) : m_ptr(ptr) {}
27  C* getPtr() { return m_ptr; }
28 
29  private:
30  C* m_ptr;
31  };
32 
33 };
34 #endif // ShareableReference_h__