From bada6666c70977a058755ccf232e7d67b24adeed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 23 Jul 2014 15:21:29 +0200 Subject: New upstream release --- libcult/cult/mm/bits/shptr.hxx | 85 ------------------------------------------ 1 file changed, 85 deletions(-) delete mode 100644 libcult/cult/mm/bits/shptr.hxx (limited to 'libcult/cult/mm/bits/shptr.hxx') diff --git a/libcult/cult/mm/bits/shptr.hxx b/libcult/cult/mm/bits/shptr.hxx deleted file mode 100644 index 7089c53..0000000 --- a/libcult/cult/mm/bits/shptr.hxx +++ /dev/null @@ -1,85 +0,0 @@ -// file : cult/mm/bits/shptr.hxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2005-2010 Boris Kolpackov -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef CULT_MM_BITS_SHPTR_HXX -#define CULT_MM_BITS_SHPTR_HXX - -#include - -#include -#include - -namespace Cult -{ - namespace MM - { - namespace Bits - { - template - class Shptr - { - protected: - ~Shptr () - { - if (c_ && c_->dec_ref ()) delete p_; - } - - Shptr (X* p, Counter* c, Boolean inc = true) - : p_ (p), c_ (c) - { - if (c_ && inc) c_->inc_ref (); - } - - protected: - X* - release_ () throw () - { - X* tmp (p_); - - c_ = 0; - p_ = 0; - - return tmp; - } - - protected: - template - Void - assign (Shptr const& bp, Boolean inc = true) - { - assign (bp.p_, bp.c_, inc); - } - - Void - assign (X* p, Counter* c, Boolean inc) - { - if (c_ && c_ == c) throw SelfAssignment (); - - if (c_) - { - Counter* t (c_); - c_ = 0; - p_ = 0; - t->dec_ref (); - } - - if (c && inc) c->inc_ref (); - - p_ = p; - c_ = c; - } - - protected: - template - friend class Shptr; - - X* p_; - Counter* c_; - }; - } - } -} - -#endif // CULT_MM_BITS_SHPTR_HXX -- cgit v1.2.3