void releaseImpl();
friend class detail::PacketImpl;
- friend class intrusive_refcount_t<PacketInterpreterBase>;
+ friend class intrusive_refcount_base;
template <class PacketType> friend class PacketInterpreter;
friend class detail::packet::test::TestDriver;
friend class PacketParserBase;
#define prefix_ inline
///////////////////////////////cti.p///////////////////////////////////////
-template <class Self>
-prefix_ void senf::intrusive_refcount_t<Self>::intrusive_ptr_add_ref()
+template <class S>
+prefix_ void senf::intrusive_refcount_base::intrusive_ptr_add_ref()
{
- static_cast<Self*>(this)->add_ref();
+ static_cast<S*>(this)->add_ref();
}
-template <class Self>
-prefix_ void senf::intrusive_refcount_t<Self>::intrusive_ptr_release()
+template <class S>
+prefix_ void senf::intrusive_refcount_base::intrusive_ptr_release()
{
- if (static_cast<Self*>(this)->release()) delete this;
+ if (static_cast<S*>(this)->release()) delete this;
}
template <class Self>
prefix_ void senf::intrusive_ptr_add_ref(intrusive_refcount_t<Self>* p)
{
- p->intrusive_ptr_add_ref();
+ p->intrusive_ptr_add_ref<Self>();
}
template <class Self>
prefix_ void senf::intrusive_ptr_release(intrusive_refcount_t<Self>* p)
{
- p->intrusive_ptr_release();
+ p->intrusive_ptr_release<Self>();
}
template <class Self>
private:
refcount_t refcount_;
+ template <class S> void intrusive_ptr_add_ref();
+ template <class S> void intrusive_ptr_release();
+
+ template <class S>
+ friend void senf::intrusive_ptr_add_ref(intrusive_refcount_t<S> * p);
+ template <class S>
+ friend void senf::intrusive_ptr_release(intrusive_refcount_t<S> * p);
};
/** \brief Customizable reference count mixin for intrusive_ptr
{
protected:
intrusive_refcount_t();
-
- private:
- void intrusive_ptr_add_ref();
- void intrusive_ptr_release();
-
- template <class S>
- friend void senf::intrusive_ptr_add_ref(intrusive_refcount_t<S> * p);
- template <class S>
- friend void senf::intrusive_ptr_release(intrusive_refcount_t<S> * p);
};
/** \brief Reference count mixin for intrusive_ptr