]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
use more verbose exception and eliminate unused ExcNotUsed
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 6 Oct 2010 15:47:20 +0000 (15:47 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 6 Oct 2010 15:47:20 +0000 (15:47 +0000)
git-svn-id: https://svn.dealii.org/trunk@22268 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/subscriptor.h
deal.II/base/source/subscriptor.cc

index 850c990cc97584872110bb495e6a5d5f0799a94e..470979ce9609849323456904307f10c8edd4e228 100644 (file)
@@ -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:
index 3ea93b90dead5066b6ed5b10caddf2cebfbfed32..1b603b8558e9d48cba4b5e25ecd1b5866f748b35 100644 (file)
@@ -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));

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.