From: Rene Gassmoeller Date: Wed, 14 Aug 2019 21:12:53 +0000 (-0700) Subject: Move functions in anonymous namespace X-Git-Tag: v9.2.0-rc1~1240^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9f7a0fdceb661b1926e16c6f834c14d7ddfd2d6;p=dealii.git Move functions in anonymous namespace --- diff --git a/include/deal.II/particles/particle_handler.h b/include/deal.II/particles/particle_handler.h index d7e300d325..cac550d4e0 100644 --- a/include/deal.II/particles/particle_handler.h +++ b/include/deal.II/particles/particle_handler.h @@ -38,36 +38,6 @@ DEAL_II_NAMESPACE_OPEN namespace Particles { - namespace internal - { - /** - * This function packs a vector of particles into a vector - * of bytes. If there are properties associated with the - * particles they are also serialized. The function does - * not perform compression, but is faster - * than the corresponding function Utilities::pack(). - */ - template - std::vector - pack_particles(std::vector> &particles); - - /** - * This function unpacks a vector of bytes into a vector - * of particles. It assumes the vector of bytes was created - * with the pack_particles() function above. If the particles - * had properties when they were serialized this function - * requires an additional argument that is a PropertyPool - * object with the correct number of properties per particle - * to be able to correctly unpack the particles. - */ - template - std::vector> - unpack_particles( - const boost::iterator_range::const_iterator> - & data_range, - PropertyPool &property_pool = PropertyPool(0)); - } // namespace internal - /** * This class manages the storage and handling of particles. It provides * the data structures necessary to store particles efficiently, accessor diff --git a/source/particles/particle_handler.cc b/source/particles/particle_handler.cc index 27f101d6f6..491f34e79d 100644 --- a/source/particles/particle_handler.cc +++ b/source/particles/particle_handler.cc @@ -28,7 +28,7 @@ DEAL_II_NAMESPACE_OPEN namespace Particles { - namespace internal + namespace { template std::vector @@ -73,7 +73,7 @@ namespace Particles while (data < &(*data_range.end())) { - particles.push_back(Particle(data, &property_pool)); + particles.emplace_back(data, &property_pool); } Assert( @@ -85,7 +85,7 @@ namespace Particles return particles; } - } // namespace internal + } // namespace template ParticleHandler::ParticleHandler() @@ -1241,7 +1241,7 @@ namespace Particles break; } - return internal::pack_particles(stored_particles_on_cell); + return pack_particles(stored_particles_on_cell); } template @@ -1254,7 +1254,7 @@ namespace Particles // We leave this container non-const to be able to `std::move` // its contents directly into the particles multimap later. std::vector> loaded_particles_on_cell = - internal::unpack_particles(data_range, *property_pool); + unpack_particles(data_range, *property_pool); // Update the reference to the current property pool for all particles. // This was not stored, because they might be transported across process diff --git a/source/particles/particle_handler.inst.in b/source/particles/particle_handler.inst.in index 8973ca70e9..022b8568d2 100644 --- a/source/particles/particle_handler.inst.in +++ b/source/particles/particle_handler.inst.in @@ -19,21 +19,6 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS) #if deal_II_dimension <= deal_II_space_dimension namespace Particles \{ - namespace internal - \{ - template std::vector - pack_particles( - std::vector> - &particles); - - template std::vector< - Particle> - unpack_particles( - const boost::iterator_range::const_iterator> - & data_range, - PropertyPool &property_pool); - \} - template class ParticleHandler; \}