From: Guido Kanschat Date: Wed, 8 Mar 2006 15:13:24 +0000 (+0000) Subject: new function list_subscribers X-Git-Tag: v8.0.0~12125 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c9bb49aae7bd9c07e37af8f1b000027756f4c99;p=dealii.git new function list_subscribers git-svn-id: https://svn.dealii.org/trunk@12570 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/subscriptor.h b/deal.II/base/include/base/subscriptor.h index ad0c3c1722..f46634e90d 100644 --- a/deal.II/base/include/base/subscriptor.h +++ b/deal.II/base/include/base/subscriptor.h @@ -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 * @{ */ diff --git a/deal.II/base/source/subscriptor.cc b/deal.II/base/source/subscriptor.cc index 28d2d8d901..d164737244 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 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 #include +#include #include #include @@ -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 +}