X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2Fintrusive_refcount.cci;h=99b23bc189503f456a014261fef8df6632c73696;hb=5443435c4c2b6e4386c5334b5b8358273f2bae93;hp=a6a9d1a996fb9e2edb5f00a35cfef60ff6ee7879;hpb=c52cd7d87dbb525c1267aad27391b8b7365dbb57;p=senf.git diff --git a/Utils/intrusive_refcount.cci b/Utils/intrusive_refcount.cci index a6a9d1a..99b23bc 100644 --- a/Utils/intrusive_refcount.cci +++ b/Utils/intrusive_refcount.cci @@ -1,9 +1,9 @@ // $Id$ // -// Copyright (C) 2006 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Stefan Bund +// Copyright (C) 2006 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -20,54 +20,46 @@ // Free Software Foundation, Inc., // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// Definition of inline non-template functions +/** \file + \brief intrusive_refcount inline non-template implementation */ //#include "intrusive_refcount.ih" // Custom includes -#include +#include "senfassert.hh" #define prefix_ inline ///////////////////////////////cci.p/////////////////////////////////////// -prefix_ satcom::lib::intrusive_refcount::refcount_t satcom::lib::intrusive_refcount::refcount() +prefix_ senf::intrusive_refcount_base::refcount_t senf::intrusive_refcount_base::refcount() { return refcount_; } -prefix_ bool satcom::lib::intrusive_refcount::is_shared() +prefix_ bool senf::intrusive_refcount_base::is_shared() { return refcount()>1; } -prefix_ satcom::lib::intrusive_refcount::intrusive_refcount() +prefix_ senf::intrusive_refcount_base::intrusive_refcount_base() : refcount_(0) {} -prefix_ satcom::lib::intrusive_refcount::~intrusive_refcount() -{} - -prefix_ void satcom::lib::intrusive_refcount::add_ref() +prefix_ void senf::intrusive_refcount_base::add_ref() { ++refcount_; } -prefix_ bool satcom::lib::intrusive_refcount::release() +prefix_ bool senf::intrusive_refcount_base::release() { - BOOST_ASSERT(refcount_>0); + SENF_ASSERT(refcount_>0 && + "senf::intrusive_refcount_base: Internal inconsistency: " + "Calling release on dead object."); return --refcount_ == 0; } -prefix_ void satcom::lib::intrusive_ptr_add_ref(intrusive_refcount* p) -{ - p->add_ref(); -} - -prefix_ void satcom::lib::intrusive_ptr_release(intrusive_refcount* p) -{ - if (p->release()) - delete p; -} +prefix_ senf::intrusive_refcount::intrusive_refcount() +{} ///////////////////////////////cci.e/////////////////////////////////////// #undef prefix_ @@ -75,5 +67,10 @@ prefix_ void satcom::lib::intrusive_ptr_release(intrusive_refcount* p) // Local Variables: // mode: c++ -// c-file-style: "satcom" +// fill-column: 100 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// comment-column: 40 // End: