]> https://gitweb.dealii.org/ - dealii.git/commitdiff
new function list_subscribers
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Wed, 8 Mar 2006 15:13:24 +0000 (15:13 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Wed, 8 Mar 2006 15:13:24 +0000 (15:13 +0000)
git-svn-id: https://svn.dealii.org/trunk@12570 0785d39b-7218-0410-832d-ea1e28bc413d

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

index ad0c3c1722bdb6dcb1ab6a24ed19367c6cdcab74..f46634e90d124677a04bfcc4e10c545775768700 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -114,6 +114,11 @@ class Subscriptor
                                      */
     unsigned int n_subscriptions () const;
 
+                                    /**
+                                     * List the subscribers to #deallog.
+                                     */
+    void list_subscribers () const;
+    
                                     /** @addtogroup Exceptions
                                      * @{ */
     
index 28d2d8d9013baa354b23a2a71e57f2fa27d7fbd7..d1647372442c27ebc56d96b7561dd03cd9e51644 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 by the deal.II authors
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -14,6 +14,7 @@
 
 #include <base/thread_management.h>
 #include <base/subscriptor.h>
+#include <base/logstream.h>
 
 #include <typeinfo>
 #include <string>
@@ -134,3 +135,17 @@ unsigned int Subscriptor::n_subscriptions () const
 {
   return counter;
 }
+
+
+void Subscriptor::list_subscribers () const
+{
+#if DEAL_USE_MT == 0
+  for (map_iterator it = counter_map.begin();
+  it != counter_map.end(); ++it)
+    deallog << it->second << '/'
+           << counter << " subscriptions from \""
+           << it->first << '\"' << std::endl;
+#else
+  deallog << "No subscriber listing with multithreading" << std::endl;
+#endif
+}

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.