From: bangerth Date: Sun, 21 Aug 2011 00:00:54 +0000 (+0000) Subject: It makes Clang happier if we forward declare things as struct instead of class if... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c9040fad421148594e7c8f61c9e5b214799c9bf;p=dealii-svn.git It makes Clang happier if we forward declare things as struct instead of class if they are in fact declared as structs. git-svn-id: https://svn.dealii.org/trunk@24128 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/dofs/dof_accessor.h b/deal.II/include/deal.II/dofs/dof_accessor.h index 54e6a49ca9..4328240c6f 100644 --- a/deal.II/include/deal.II/dofs/dof_accessor.h +++ b/deal.II/include/deal.II/dofs/dof_accessor.h @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------- // $Id$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -748,10 +748,10 @@ class DoFAccessor : public internal::DoFAccessor::Inheritance friend class DoFHandler; template friend class hp::DoFHandler; - friend class internal::DoFHandler::Policy::Implementation; - friend class internal::DoFHandler::Implementation; - friend class internal::hp::DoFHandler::Implementation; - friend class internal::DoFCellAccessor::Implementation; + friend struct internal::DoFHandler::Policy::Implementation; + friend struct internal::DoFHandler::Implementation; + friend struct internal::hp::DoFHandler::Implementation; + friend struct internal::DoFCellAccessor::Implementation; }; @@ -1372,10 +1372,10 @@ class DoFAccessor<0,DH<1,spacedim> > : public TriaAccessor<0,1,spacedim> template friend class DoFHandler; template friend class hp::DoFHandler; - friend class internal::DoFHandler::Policy::Implementation; - friend class internal::DoFHandler::Implementation; - friend class internal::hp::DoFHandler::Implementation; - friend class internal::DoFCellAccessor::Implementation; + friend struct internal::DoFHandler::Policy::Implementation; + friend struct internal::DoFHandler::Implementation; + friend struct internal::hp::DoFHandler::Implementation; + friend struct internal::DoFCellAccessor::Implementation; }; @@ -2068,7 +2068,7 @@ class DoFCellAccessor : public DoFAccessor * function */ template friend class DoFHandler; - friend class internal::DoFCellAccessor::Implementation; + friend struct internal::DoFCellAccessor::Implementation; }; diff --git a/deal.II/include/deal.II/dofs/dof_handler.h b/deal.II/include/deal.II/dofs/dof_handler.h index 49f225b0a6..5daca5c768 100644 --- a/deal.II/include/deal.II/dofs/dof_handler.h +++ b/deal.II/include/deal.II/dofs/dof_handler.h @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------- // $Id$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -138,7 +138,7 @@ namespace internal * renumber_dofs(vector) function with the array, which * converts old into new degree of freedom indices. * - * + * *

Serializing (loading or storing) DoFHandler objects

* * Like many other classes in deal.II, the DoFHandler class can stream @@ -1237,7 +1237,7 @@ class DoFHandler : public Subscriptor void load (Archive & ar, const unsigned int version); BOOST_SERIALIZATION_SPLIT_MEMBER() - + /** * @todo Replace by ExcInternalError. */ @@ -1395,11 +1395,11 @@ class DoFHandler : public Subscriptor */ template friend class DoFAccessor; template friend class DoFCellAccessor; - friend class internal::DoFAccessor::Implementation; - friend class internal::DoFCellAccessor::Implementation; + friend struct internal::DoFAccessor::Implementation; + friend struct internal::DoFCellAccessor::Implementation; - friend class internal::DoFHandler::Implementation; - friend class internal::DoFHandler::Policy::Implementation; + friend struct internal::DoFHandler::Implementation; + friend struct internal::DoFHandler::Policy::Implementation; }; @@ -1498,14 +1498,14 @@ void DoFHandler::save (Archive & ar, ar & number_cache; ar & levels; ar & faces; - + // write out the number of triangulation cells and later check // during loading that this number is indeed correct; same with something that // identifies the FE and the policy unsigned int n_cells = tria->n_cells(); std::string fe_name = selected_fe->get_name(); std::string policy_name = typeid(*policy).name(); - + ar & n_cells & fe_name & policy_name; } @@ -1518,7 +1518,7 @@ void DoFHandler::load (Archive & ar, ar & block_info_object; ar & vertex_dofs; ar & number_cache; - + // boost::serialization can restore pointers just fine, but if the // pointer object still points to something useful, that object is // not destroyed and we end up with a memory leak. consequently, @@ -1528,7 +1528,7 @@ void DoFHandler::load (Archive & ar, levels.resize (0); delete faces; faces = 0; - + ar & levels; ar & faces; @@ -1536,10 +1536,10 @@ void DoFHandler::load (Archive & ar, unsigned int n_cells; std::string fe_name; std::string policy_name; - - ar & n_cells & fe_name & policy_name; - AssertThrow (n_cells == tria->n_cells(), + ar & n_cells & fe_name & policy_name; + + AssertThrow (n_cells == tria->n_cells(), ExcMessage ("The object being loaded into does not match the triangulation " "that has been stored previously.")); AssertThrow (fe_name == selected_fe->get_name(), diff --git a/deal.II/include/deal.II/grid/tria.h b/deal.II/include/deal.II/grid/tria.h index f9954ab1c2..8c5b892128 100644 --- a/deal.II/include/deal.II/grid/tria.h +++ b/deal.II/include/deal.II/grid/tria.h @@ -262,13 +262,13 @@ namespace internal * of this object. */ std::size_t memory_consumption () const; - + /** - * Read or write the data of this object to or + * Read or write the data of this object to or * from a stream for the purpose of serialization - */ + */ template - void serialize (Archive & ar, + void serialize (Archive & ar, const unsigned int version); }; @@ -329,11 +329,11 @@ namespace internal std::size_t memory_consumption () const; /** - * Read or write the data of this object to or + * Read or write the data of this object to or * from a stream for the purpose of serialization - */ + */ template - void serialize (Archive & ar, + void serialize (Archive & ar, const unsigned int version); }; @@ -395,11 +395,11 @@ namespace internal std::size_t memory_consumption () const; /** - * Read or write the data of this object to or + * Read or write the data of this object to or * from a stream for the purpose of serialization - */ + */ template - void serialize (Archive & ar, + void serialize (Archive & ar, const unsigned int version); }; } @@ -3757,11 +3757,11 @@ class Triangulation : public Subscriptor template friend class TriaAccessor; friend class CellAccessor; - friend class internal::TriaAccessor::Implementation; + friend struct internal::TriaAccessor::Implementation; friend class hp::DoFHandler; - friend class internal::Triangulation::Implementation; + friend struct internal::Triangulation::Implementation; }; @@ -3772,7 +3772,7 @@ namespace internal namespace Triangulation { template - void NumberCache<1>::serialize (Archive & ar, + void NumberCache<1>::serialize (Archive & ar, const unsigned int) { ar & n_levels; @@ -3780,28 +3780,28 @@ namespace internal ar & n_active_lines & n_active_lines_level; } - + template - void NumberCache<2>::serialize (Archive & ar, + void NumberCache<2>::serialize (Archive & ar, const unsigned int version) { this->NumberCache<1>::serialize (ar, version); - + ar & n_quads & n_quads_level; ar & n_active_quads & n_active_quads_level; } - + template - void NumberCache<3>::serialize (Archive & ar, + void NumberCache<3>::serialize (Archive & ar, const unsigned int version) { this->NumberCache<2>::serialize (ar, version); - + ar & n_hexes & n_hexes_level; ar & n_active_hexes & n_active_hexes_level; } - + } } @@ -3849,7 +3849,7 @@ Triangulation::get_vertices () const template template void -Triangulation::save (Archive & ar, +Triangulation::save (Archive & ar, const unsigned int) const { // as discussed in the documentation, do @@ -3861,7 +3861,7 @@ Triangulation::save (Archive & ar, ar & faces; ar & vertices; ar & vertices_used; - + ar & anisotropic_refinement; ar & number_cache; @@ -3873,13 +3873,13 @@ Triangulation::save (Archive & ar, template template void -Triangulation::load (Archive & ar, +Triangulation::load (Archive & ar, const unsigned int) { // clear previous content. this also calls // the respective signal clear (); - + // as discussed in the documentation, do // not store the signals as well as // boundary and manifold descrption @@ -3889,7 +3889,7 @@ Triangulation::load (Archive & ar, ar & faces; ar & vertices; ar & vertices_used; - + ar & anisotropic_refinement; ar & number_cache; diff --git a/deal.II/include/deal.II/grid/tria_accessor.h b/deal.II/include/deal.II/grid/tria_accessor.h index 426ed34b51..d6564f7134 100644 --- a/deal.II/include/deal.II/grid/tria_accessor.h +++ b/deal.II/include/deal.II/grid/tria_accessor.h @@ -1579,8 +1579,8 @@ class TriaAccessor : public TriaAccessorBase template friend class Triangulation; - friend class internal::Triangulation::Implementation; - friend class internal::TriaAccessor::Implementation; + friend struct internal::Triangulation::Implementation; + friend struct internal::TriaAccessor::Implementation; }; @@ -1855,7 +1855,7 @@ class TriaAccessor<0, 1, spacedim> * refers to. */ Point center () const; - + /** * Pointer to the @p ith line * bounding this object. Will @@ -2879,8 +2879,7 @@ class CellAccessor : public TriaAccessor template friend class Triangulation; - friend class internal::Triangulation::Implementation; - + friend struct internal::Triangulation::Implementation; }; diff --git a/deal.II/include/deal.II/hp/dof_handler.h b/deal.II/include/deal.II/hp/dof_handler.h index e3cc6aa144..80f7d2bd3b 100644 --- a/deal.II/include/deal.II/hp/dof_handler.h +++ b/deal.II/include/deal.II/hp/dof_handler.h @@ -1123,10 +1123,10 @@ namespace hp void create_active_fe_table (); /** - * Functions that will be triggered - * through signals whenever the + * Functions that will be triggered + * through signals whenever the * triangulation is modified. - * + * * Here they are used to * administrate the the * active_fe_fields during the @@ -1134,7 +1134,7 @@ namespace hp */ void pre_refinement_action (); void post_refinement_action (); - + /** * Compute identities between @@ -1295,14 +1295,14 @@ namespace hp * triangulation changes. */ std::vector tria_listeners; - + /** * Make accessor objects friends. */ template friend class dealii::DoFAccessor; template friend class dealii::DoFCellAccessor; - friend class internal::DoFAccessor::Implementation; - friend class internal::DoFCellAccessor::Implementation; + friend struct internal::DoFAccessor::Implementation; + friend struct internal::DoFCellAccessor::Implementation; /** * Likewise for DoFLevel @@ -1313,7 +1313,7 @@ namespace hp */ template friend class internal::hp::DoFLevel; template friend class internal::hp::DoFObjects; - friend class internal::hp::DoFHandler::Implementation; + friend struct internal::hp::DoFHandler::Implementation; };