Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Declare methods 'const'.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 27 Jan 2021 14:35:19 +0000 (15:35 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 27 Jan 2021 14:35:19 +0000 (15:35 +0100)
include/simgrid/s4u/Activity.hpp
src/kernel/activity/ActivityImpl.cpp
src/kernel/activity/ActivityImpl.hpp
src/s4u/s4u_Activity.cpp

index 1881740..9bd646b 100644 (file)
@@ -88,7 +88,7 @@ public:
   /** Retrieve the current state of the activity */
   Activity::State get_state() const { return state_; }
   /** Return a string representation of the activity's state (one of INITED, STARTING, STARTED, CANCELED, FINISHED) */
-  const char* get_state_str();
+  const char* get_state_str() const;
   void set_state(Activity::State state) { state_ = state; }
   /** Tests whether the given activity is terminated yet. */
   virtual bool test();
index cd4b557..b82915e 100644 (file)
@@ -40,7 +40,7 @@ double ActivityImpl::get_remaining() const
   return surf_action_ ? surf_action_->get_remains() : 0;
 }
 
-const char* ActivityImpl::get_state_str()
+const char* ActivityImpl::get_state_str() const
 {
   switch (state_) {
     case State::WAITING:
index dc4c84f..7bc0215 100644 (file)
@@ -73,7 +73,7 @@ public:
   virtual void register_simcall(smx_simcall_t simcall);
   void clean_action();
   virtual double get_remaining() const;
-  const char* get_state_str();
+  const char* get_state_str() const;
   // Support for the boost::intrusive_ptr<ActivityImpl> datatype
   friend XBT_PUBLIC void intrusive_ptr_add_ref(ActivityImpl* activity);
   friend XBT_PUBLIC void intrusive_ptr_release(ActivityImpl* activity);
index 529d08f..4c1b9e4 100644 (file)
@@ -65,7 +65,7 @@ Activity* Activity::resume()
   return this;
 }
 
-const char* Activity::get_state_str()
+const char* Activity::get_state_str() const
 {
   switch (state_) {
     case State::INITED: