Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Uniformize get_impl(): const attribute, and return raw pointer.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 17 Apr 2019 18:46:11 +0000 (20:46 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 17 Apr 2019 19:39:16 +0000 (21:39 +0200)
include/simgrid/s4u/Activity.hpp
include/simgrid/s4u/Link.hpp
include/simgrid/s4u/Mailbox.hpp
include/simgrid/s4u/NetZone.hpp
include/simgrid/s4u/Storage.hpp
src/msg/msg_comm.cpp

index 8d123ef..de5b14a 100644 (file)
@@ -92,7 +92,7 @@ public:
   /** Retrieve the user data of the Activity */
   void* get_user_data() { return user_data_; }
 
-  kernel::activity::ActivityImplPtr get_impl() { return pimpl_; }
+  kernel::activity::ActivityImpl* get_impl() const { return pimpl_.get(); }
 
 #ifndef DOXYGEN
   XBT_ATTRIB_DEPRECATED_v324("Please use Activity::wait_for()") virtual void wait(double timeout) = 0;
index 4a1189d..74fb9e9 100644 (file)
@@ -33,7 +33,7 @@ class XBT_PUBLIC Link : public xbt::Extendable<Link> {
 public:
   enum class SharingPolicy { SPLITDUPLEX = 2, SHARED = 1, FATPIPE = 0 };
 
-  kernel::resource::LinkImpl* get_impl() { return pimpl_; }
+  kernel::resource::LinkImpl* get_impl() const { return pimpl_; }
 
   /** @brief Retrieve a link from its name */
   static Link* by_name(const std::string& name);
index 069618a..faffc35 100644 (file)
@@ -26,7 +26,7 @@ class XBT_PUBLIC Mailbox {
 
 public:
   /** private function, do not use. FIXME: make me protected */
-  kernel::activity::MailboxImpl* get_impl() { return pimpl_; }
+  kernel::activity::MailboxImpl* get_impl() const { return pimpl_; }
 
   /** @brief Retrieves the name of that mailbox as a C++ string */
   const xbt::string& get_name() const;
index 0ba5c13..8004e96 100644 (file)
@@ -41,7 +41,7 @@ public:
   std::vector<Host*> get_all_hosts();
   int get_host_count();
 
-  kernel::routing::NetZoneImpl* get_impl() { return pimpl_; }
+  kernel::routing::NetZoneImpl* get_impl() const { return pimpl_; }
 
 private:
   kernel::routing::NetZoneImpl* const pimpl_;
index dce77c5..09c09e2 100644 (file)
@@ -70,7 +70,7 @@ public:
 
   IoPtr write_async(sg_size_t size);
   sg_size_t write(sg_size_t size);
-  kernel::resource::StorageImpl* get_impl() { return pimpl_; }
+  kernel::resource::StorageImpl* get_impl() const { return pimpl_; }
 
 private:
   Host* attached_to_ = nullptr;
index 1f7b29c..28db1e5 100644 (file)
@@ -101,7 +101,7 @@ int MSG_comm_testany(xbt_dynar_t comms)
   msg_comm_t comm;
   unsigned int cursor;
   xbt_dynar_foreach (comms, cursor, comm) {
-    s_comms.push_back(static_cast<simgrid::kernel::activity::CommImpl*>(comm->s_comm->get_impl().get()));
+    s_comms.push_back(static_cast<simgrid::kernel::activity::CommImpl*>(comm->s_comm->get_impl()));
   }
 
   msg_error_t status = MSG_OK;
@@ -180,7 +180,7 @@ int MSG_comm_waitany(xbt_dynar_t comms)
   msg_comm_t comm;
   unsigned int cursor;
   xbt_dynar_foreach (comms, cursor, comm) {
-    s_comms.push_back(static_cast<simgrid::kernel::activity::CommImpl*>(comm->s_comm->get_impl().get()));
+    s_comms.push_back(static_cast<simgrid::kernel::activity::CommImpl*>(comm->s_comm->get_impl()));
   }
 
   msg_error_t status = MSG_OK;