From e31f73d19a6673e655e4ba1c14f110d48c22ea02 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 23 Feb 2005 04:09:08 +0000 Subject: [PATCH] One more class that needs a virtual destructor. git-svn-id: https://svn.dealii.org/trunk@9906 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/grid/tria.h | 38 ++++++++++++++++++++++++----- deal.II/deal.II/source/grid/tria.cc | 11 +++++++-- deal.II/doc/news/changes.html | 9 +++++++ 3 files changed, 50 insertions(+), 8 deletions(-) diff --git a/deal.II/deal.II/include/grid/tria.h b/deal.II/deal.II/include/grid/tria.h index 06d891c6dd..6d9ac660ee 100644 --- a/deal.II/deal.II/include/grid/tria.h +++ b/deal.II/deal.II/include/grid/tria.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -1596,11 +1596,37 @@ class Triangulation : public Subscriptor * For an example see hpDoFHandler(). */ class RefinementListener - { - public: - virtual void pre_refinement_notification (const Triangulation &tria); - virtual void post_refinement_notification (const Triangulation &tria); - }; + { + public: + /** + * Destructor. Does nothing, but is + * declared virtual because this + * class also has virtual functions. + */ + virtual ~RefinementListener (); + + /** + * Before refinement is actually + * performed, the triangulation class + * calls this method on all objects + * derived from this class and + * registered with the triangulation. + */ + virtual + void + pre_refinement_notification (const Triangulation &tria); + + /** + * After refinement is actually + * performed, the triangulation class + * calls this method on all objects + * derived from this class and + * registered with the triangulation. + */ + virtual + void + post_refinement_notification (const Triangulation &tria); + }; /** * Create a triangulation and create diff --git a/deal.II/deal.II/source/grid/tria.cc b/deal.II/deal.II/source/grid/tria.cc index ccb5c51619..20539f2bae 100644 --- a/deal.II/deal.II/source/grid/tria.cc +++ b/deal.II/deal.II/source/grid/tria.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -8982,7 +8982,14 @@ void Triangulation::update_number_cache () } -// Refinement listeners + +template +Triangulation::RefinementListener::~RefinementListener () +{} + + + + template void Triangulation:: RefinementListener::pre_refinement_notification (const Triangulation &) diff --git a/deal.II/doc/news/changes.html b/deal.II/doc/news/changes.html index 729d2ef8b0..250dca9cc1 100644 --- a/deal.II/doc/news/changes.html +++ b/deal.II/doc/news/changes.html @@ -72,6 +72,15 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK

deal.II

    +
  1. + Fixed: The class Triangulation::RefinementListener had only + virtual abstract functions but no virtual destructor. This caused + warnings with some compilers, and is generally bad practice + anyway. This is now fixed. +
    + (WB, 2005/02/22) +

    +
  2. New: Function FETools::compute_embedding_matrices allows for -- 2.39.5