Commit 0596330e authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Fixed move-semantics in Mesh and its subclasses

parent 8db5d2da
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -93,10 +93,14 @@ class Mesh

      Mesh( const Mesh& mesh );

      Mesh( Mesh&& mesh ) = default;

      template< typename Device_ >
      Mesh( const Mesh< MeshConfig, Device_ >& mesh );

      Mesh& operator=( const Mesh& mesh );
      Mesh& operator=( const Mesh& mesh ) = default;

      Mesh& operator=( Mesh&& mesh ) = default;

      template< typename Device_ >
      Mesh& operator=( const Mesh< MeshConfig, Device_ >& mesh );
+1 −12
Original line number Diff line number Diff line
@@ -59,17 +59,6 @@ Mesh( const Mesh< MeshConfig, Device_ >& mesh )
   points = mesh.getPoints();
}

template< typename MeshConfig, typename Device >
Mesh< MeshConfig, Device >&
Mesh< MeshConfig, Device >::
operator=( const Mesh& mesh )
{
   points = mesh.getPoints();
   StorageBaseType::operator=( mesh );
   EntityTagsLayerFamily::operator=( mesh );
   return *this;
}

template< typename MeshConfig, typename Device >
   template< typename Device_ >
Mesh< MeshConfig, Device >&
+4 −5
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@ public:

   explicit DualGraphLayer( const DualGraphLayer& ) = default;

   DualGraphLayer( DualGraphLayer&& ) = default;

   template< typename Device_ >
   DualGraphLayer( const DualGraphLayer< MeshConfig, Device_ >& other )
   {
@@ -41,6 +43,8 @@ public:

   DualGraphLayer& operator=( const DualGraphLayer& ) = default;

   DualGraphLayer& operator=( DualGraphLayer&& ) = default;

   template< typename Device_ >
   DualGraphLayer& operator=( const DualGraphLayer< MeshConfig, Device_ >& other )
   {
@@ -167,11 +171,6 @@ template< typename MeshConfig,
class DualGraphLayer< MeshConfig, Device, false >
{
public:
   DualGraphLayer& operator=( const DualGraphLayer& other )
   {
      return *this;
   }

   template< typename Device_ >
   DualGraphLayer& operator=( const DualGraphLayer< MeshConfig, Device_ >& other )
   {
+8 −20
Original line number Diff line number Diff line
@@ -38,10 +38,7 @@ public:

   Layer() = default;

   explicit Layer( const Layer& other )
   {
      operator=( other );
   }
   explicit Layer( const Layer& other ) = default;

   template< typename Device_ >
   Layer( const Layer< MeshConfig, Device_, DimensionTag >& other )
@@ -49,24 +46,13 @@ public:
      operator=( other );
   }

   Layer& operator=( const Layer& other )
   {
      tags.setLike( other.tags );
      boundaryIndices.setLike( other.boundaryIndices );
      interiorIndices.setLike( other.interiorIndices );
      tags = other.tags;
      boundaryIndices = other.boundaryIndices;
      interiorIndices = other.interiorIndices;
      ghostsOffset = other.ghostsOffset;
      return *this;
   }
   Layer& operator=( const Layer& other ) = default;

   Layer& operator=( Layer&& other ) = default;

   template< typename Device_ >
   Layer& operator=( const Layer< MeshConfig, Device_, DimensionTag >& other )
   {
      tags.setLike( other.tags );
      boundaryIndices.setLike( other.boundaryIndices );
      interiorIndices.setLike( other.interiorIndices );
      tags = other.tags;
      boundaryIndices = other.boundaryIndices;
      interiorIndices = other.interiorIndices;
@@ -254,10 +240,12 @@ protected:
   using TagType         = typename MeshTraits< MeshConfig, Device >::EntityTagsArrayType::ValueType;

   Layer() = default;
   explicit Layer( const Layer& other ) {}
   explicit Layer( const Layer& other ) = default;
   Layer( Layer&& other ) = default;
   template< typename Device_ >
   Layer( const Layer< MeshConfig, Device_, DimensionTag >& other ) {}
   Layer& operator=( const Layer& other ) { return *this; }
   Layer& operator=( const Layer& other ) = default;
   Layer& operator=( Layer&& other ) = default;
   template< typename Device_ >
   Layer& operator=( const Layer< MeshConfig, Device_, DimensionTag >& other ) { return *this; }

+10 −12
Original line number Diff line number Diff line
@@ -56,10 +56,9 @@ protected:

   LayerInheritor() = default;

   explicit LayerInheritor( const LayerInheritor& other )
   {
      operator=( other );
   }
   explicit LayerInheritor( const LayerInheritor& other ) = default;

   LayerInheritor( LayerInheritor&& other ) = default;

   template< typename Device_ >
   LayerInheritor( const LayerInheritor< MeshConfig, Device_, Dimension >& other )
@@ -67,12 +66,9 @@ protected:
      operator=( other );
   }

   LayerInheritor& operator=( const LayerInheritor& other )
   {
      LayerType::operator=( other );
      BaseType::operator=( other );
      return *this;
   }
   LayerInheritor& operator=( const LayerInheritor& other ) = default;

   LayerInheritor& operator=( LayerInheritor&& other ) = default;

   template< typename Device_ >
   LayerInheritor& operator=( const LayerInheritor< MeshConfig, Device_, Dimension >& other )
@@ -114,10 +110,12 @@ protected:
   void getGhostEntitiesOffset() const;

   LayerInheritor() = default;
   explicit LayerInheritor( const LayerInheritor& other ) {}
   explicit LayerInheritor( const LayerInheritor& other ) = default;
   LayerInheritor( LayerInheritor&& other ) = default;
   template< typename Device_ >
   LayerInheritor( const LayerInheritor< MeshConfig, Device_, DimensionTag< MeshConfig::meshDimension + 1 > >& other ) {}
   LayerInheritor& operator=( const LayerInheritor& other ) { return *this; }
   LayerInheritor& operator=( const LayerInheritor& other ) = default;
   LayerInheritor& operator=( LayerInheritor&& other ) = default;
   template< typename Device_ >
   LayerInheritor& operator=( const LayerInheritor< MeshConfig, Device_, DimensionTag< MeshConfig::meshDimension + 1 > >& other ) { return *this; }

Loading