39 #ifndef OPENIMAGEIO_REFCNT_H
40 #define OPENIMAGEIO_REFCNT_H
46 #include <boost/shared_ptr.hpp>
47 #include <boost/intrusive_ptr.hpp>
53 using boost::shared_ptr;
54 using boost::intrusive_ptr;
66 RefCnt () { m_refcnt = 0; }
70 RefCnt (RefCnt&) { m_refcnt = 0; }
77 void _incref ()
const { ++m_refcnt; }
81 bool _decref ()
const {
return (--m_refcnt) == 0; }
85 const RefCnt & operator= (
const RefCnt&)
const {
return *
this; }
88 mutable atomic_int m_refcnt;
96 inline void intrusive_ptr_add_ref (T *x)
104 inline void intrusive_ptr_release (T *x)
122 #endif // OPENIMAGEIO_REFCNT_H