From: Christian Heinrich Date: Fri, 29 Jun 2018 09:21:57 +0000 (+0200) Subject: [S4U] Actor: Add 'const' keyword to getter methods X-Git-Tag: v3_21~604 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/76a018f7f259011afdaf57e31439dee9313fad4c?ds=inline [S4U] Actor: Add 'const' keyword to getter methods This signals to users that calling these methods will not change the state of the object. --- diff --git a/src/simix/ActorImpl.hpp b/src/simix/ActorImpl.hpp index 3dd5f0cf11..c650cd2027 100644 --- a/src/simix/ActorImpl.hpp +++ b/src/simix/ActorImpl.hpp @@ -114,14 +114,14 @@ private: bool daemon = false; public: void daemonize(); - bool isDaemon() { return daemon; } /** Whether this actor has been daemonized */ - bool isSuspended() { return suspended; } + bool isDaemon() const { return daemon; } /** Whether this actor has been daemonized */ + bool isSuspended() const { return suspended; } simgrid::s4u::Actor* restart(); smx_activity_t suspend(ActorImpl* issuer); void resume(); smx_activity_t sleep(double duration); void setUserData(void* data) { userdata = data; } - void* getUserData() { return userdata; } + void* getUserData() const { return userdata; } }; /* Used to keep the list of actors blocked on a synchro */