From c69a5ba2801b22865b81aa857531c9c7ecd77fb4 Mon Sep 17 00:00:00 2001 From: kanschat Date: Wed, 6 Oct 2010 15:47:20 +0000 Subject: [PATCH] use more verbose exception and eliminate unused ExcNotUsed git-svn-id: https://svn.dealii.org/trunk@22268 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/subscriptor.h | 8 -------- deal.II/base/source/subscriptor.cc | 6 +++--- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/deal.II/base/include/base/subscriptor.h b/deal.II/base/include/base/subscriptor.h index 850c990cc9..470979ce96 100644 --- a/deal.II/base/include/base/subscriptor.h +++ b/deal.II/base/include/base/subscriptor.h @@ -143,14 +143,6 @@ class Subscriptor DeclException2(ExcNoSubscriber, char*, char*, << "No subscriber with identifier \"" << arg2 << "\" did subscribe to this object of class " << arg1); - - /** - * Exception: object should be - * used when - * Subscriptor::unsubscribe() is - * called. - */ - DeclException0(ExcNotUsed); //@} private: diff --git a/deal.II/base/source/subscriptor.cc b/deal.II/base/source/subscriptor.cc index 3ea93b90de..1b603b8558 100644 --- a/deal.II/base/source/subscriptor.cc +++ b/deal.II/base/source/subscriptor.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2008 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -164,7 +164,8 @@ void Subscriptor::do_subscribe (const char* id) const void Subscriptor::do_unsubscribe (const char* id) const { #ifdef DEBUG - Assert (counter>0, ExcNotUsed()); + const char* name = (id != 0) ? id : unknown_subscriber; + Assert (counter>0, ExcNoSubscriber(object_info->name(), name)); // This is for the case that we do // not abort after the exception if (counter == 0) @@ -174,7 +175,6 @@ void Subscriptor::do_unsubscribe (const char* id) const --counter; #if DEAL_USE_MT == 0 - const char* name = (id != 0) ? id : unknown_subscriber; map_iterator it = counter_map.find(name); Assert (it != counter_map.end(), ExcNoSubscriber(object_info->name(), name)); Assert (it->second > 0, ExcNoSubscriber(object_info->name(), name)); -- 2.39.5