Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Declare functions "const" (round #2).
[simgrid.git] / src / smpi / include / smpi_win.hpp
index 242c7ef..b50573c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2019. The SimGrid Team.
+/* Copyright (c) 2010-2020. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -11,7 +11,6 @@
 #include "smpi_errhandler.hpp"
 #include "smpi_f2c.hpp"
 #include "smpi_keyvals.hpp"
-#include "xbt/synchro.h"
 
 #include <vector>
 #include <list>
@@ -54,20 +53,20 @@ public:
   ~Win();
   int attach (void *base, MPI_Aint size);
   int detach (const void *base);
-  void get_name( char* name, int* length);
+  void get_name(char* name, int* length) const;
   void get_group( MPI_Group* group);
   void set_name(const char* name);
-  int rank();
-  int dynamic();
+  int rank() const;
+  int dynamic() const;
   int start(MPI_Group group, int assert);
   int post(MPI_Group group, int assert);
   int complete();
   MPI_Info info();
   void set_info( MPI_Info info);
   int wait();
-  MPI_Aint size();
-  void* base();
-  int disp_unit();
+  MPI_Aint size() const;
+  void* base() const;
+  int disp_unit() const;
   int fence(int assert);
   int put(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
               MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Request* request=nullptr);
@@ -78,9 +77,8 @@ public:
   int get_accumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, void *result_addr,
               int result_count, MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp, int target_count,
               MPI_Datatype target_datatype, MPI_Op op, MPI_Request* request=nullptr);
-  int compare_and_swap(const void *origin_addr, void *compare_addr,
-        void *result_addr, MPI_Datatype datatype, int target_rank,
-        MPI_Aint target_disp);
+  int compare_and_swap(const void* origin_addr, const void* compare_addr, void* result_addr, MPI_Datatype datatype,
+                       int target_rank, MPI_Aint target_disp);
   static Win* f2c(int id);
 
   int lock(int lock_type, int rank, int assert);
@@ -93,7 +91,7 @@ public:
   int flush_local_all();
   int finish_comms();
   int finish_comms(int rank);
-  int shared_query(int rank, MPI_Aint* size, int* disp_unit, void* baseptr);
+  int shared_query(int rank, MPI_Aint* size, int* disp_unit, void* baseptr) const;
   MPI_Errhandler errhandler();
   void set_errhandler( MPI_Errhandler errhandler);
 };