From: g0dil Date: Wed, 19 Mar 2008 15:34:10 +0000 (+0000) Subject: Utils: Fixed intrusive_refcount_t access implementation to conform to documentation X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=be1bf122a03b2105973d2dd0798a2a450cd676a6;p=senf.git Utils: Fixed intrusive_refcount_t access implementation to conform to documentation git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@746 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Packets/PacketInterpreter.hh b/Packets/PacketInterpreter.hh index 80bb016..b42cb19 100644 --- a/Packets/PacketInterpreter.hh +++ b/Packets/PacketInterpreter.hh @@ -211,7 +211,7 @@ namespace senf { void releaseImpl(); friend class detail::PacketImpl; - friend class intrusive_refcount_t; + friend class intrusive_refcount_base; template friend class PacketInterpreter; friend class detail::packet::test::TestDriver; friend class PacketParserBase; diff --git a/Utils/intrusive_refcount.cti b/Utils/intrusive_refcount.cti index a8ba41e..3e729e0 100644 --- a/Utils/intrusive_refcount.cti +++ b/Utils/intrusive_refcount.cti @@ -30,28 +30,28 @@ #define prefix_ inline ///////////////////////////////cti.p/////////////////////////////////////// -template -prefix_ void senf::intrusive_refcount_t::intrusive_ptr_add_ref() +template +prefix_ void senf::intrusive_refcount_base::intrusive_ptr_add_ref() { - static_cast(this)->add_ref(); + static_cast(this)->add_ref(); } -template -prefix_ void senf::intrusive_refcount_t::intrusive_ptr_release() +template +prefix_ void senf::intrusive_refcount_base::intrusive_ptr_release() { - if (static_cast(this)->release()) delete this; + if (static_cast(this)->release()) delete this; } template prefix_ void senf::intrusive_ptr_add_ref(intrusive_refcount_t* p) { - p->intrusive_ptr_add_ref(); + p->intrusive_ptr_add_ref(); } template prefix_ void senf::intrusive_ptr_release(intrusive_refcount_t* p) { - p->intrusive_ptr_release(); + p->intrusive_ptr_release(); } template diff --git a/Utils/intrusive_refcount.hh b/Utils/intrusive_refcount.hh index 8ce5785..7fb8f18 100644 --- a/Utils/intrusive_refcount.hh +++ b/Utils/intrusive_refcount.hh @@ -61,6 +61,13 @@ namespace senf { private: refcount_t refcount_; + template void intrusive_ptr_add_ref(); + template void intrusive_ptr_release(); + + template + friend void senf::intrusive_ptr_add_ref(intrusive_refcount_t * p); + template + friend void senf::intrusive_ptr_release(intrusive_refcount_t * p); }; /** \brief Customizable reference count mixin for intrusive_ptr @@ -115,15 +122,6 @@ namespace senf { { protected: intrusive_refcount_t(); - - private: - void intrusive_ptr_add_ref(); - void intrusive_ptr_release(); - - template - friend void senf::intrusive_ptr_add_ref(intrusive_refcount_t * p); - template - friend void senf::intrusive_ptr_release(intrusive_refcount_t * p); }; /** \brief Reference count mixin for intrusive_ptr