Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
codacy
[simgrid.git] / src / mc / RegionSnapshot.hpp
index 42de5f8..52deff2 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2007-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -13,7 +12,7 @@
 #include <memory>
 #include <vector>
 
-#include <xbt/base.h>
+#include "xbt/base.h"
 
 #include "src/mc/AddressSpace.hpp"
 #include "src/mc/ChunkedData.hpp"
@@ -50,7 +49,7 @@ private:
   Buffer(void* data, std::size_t size, Type type = Type::Malloc) :
     data_(data), size_(size), type_(type) {}
 public:
-  Buffer() {}
+  Buffer() = default;
   void clear() noexcept;
   ~Buffer() noexcept { clear(); }
 
@@ -101,7 +100,7 @@ public:
  *  * sparse/per-page snapshots are snaapshots which shared
  *    identical pages.
  *
- *  * privatized (SMPI global variable privatisation).
+ *  * privatized (SMPI global variable privatization).
  *
  *  This is handled with a variant based approach:
  *
@@ -157,20 +156,20 @@ public:
     size_(size),
     permanent_addr_(permanent_addr)
   {}
-  ~RegionSnapshot() {}
+  ~RegionSnapshot()                     = default;
   RegionSnapshot(RegionSnapshot const&) = default;
   RegionSnapshot& operator=(RegionSnapshot const&) = default;
   RegionSnapshot(RegionSnapshot&& that)
+      : region_type_(that.region_type_)
+      , storage_type_(that.storage_type_)
+      , object_info_(that.object_info_)
+      , start_addr_(that.start_addr_)
+      , size_(that.size_)
+      , permanent_addr_(that.permanent_addr_)
+      , flat_data_(std::move(that.flat_data_))
+      , page_numbers_(std::move(that.page_numbers_))
+      , privatized_regions_(std::move(that.privatized_regions_))
   {
-    region_type_ = that.region_type_;
-    storage_type_ = that.storage_type_;
-    object_info_ = that.object_info_;
-    start_addr_ = that.start_addr_;
-    size_ = that.size_;
-    permanent_addr_ = that.permanent_addr_;
-    flat_data_ = std::move(that.flat_data_);
-    page_numbers_ = std::move(that.page_numbers_);
-    privatized_regions_ = std::move(that.privatized_regions_);
     that.clear();
   }
   RegionSnapshot& operator=(RegionSnapshot&& that)
@@ -210,7 +209,7 @@ public:
     page_numbers_.clear();
     privatized_regions_.clear();
   }
-  
+
   void flat_data(Buffer data)
   {
     storage_type_ = StorageType::Flat;
@@ -277,6 +276,6 @@ simgrid::mc::RegionSnapshot region(
 }
 }
 
-typedef class simgrid::mc::RegionSnapshot s_mc_mem_region_t, *mc_mem_region_t;
-
+typedef class simgrid::mc::RegionSnapshot s_mc_mem_region_t;
+typedef s_mc_mem_region_t* mc_mem_region_t;
 #endif