Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Define ActivityImpl::get_{name,cname}.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 13 Feb 2019 10:37:31 +0000 (11:37 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 13 Feb 2019 16:51:16 +0000 (17:51 +0100)
src/kernel/activity/ActivityImpl.hpp

index 70f17ce..6d14c86 100644 (file)
@@ -26,10 +26,12 @@ public:
   explicit ActivityImpl(std::string name) : name_(std::move(name)) {}
   virtual ~ActivityImpl() = default;
   e_smx_state_t state_ = SIMIX_WAITING; /* State of the activity */
-  std::string name_;                    /* Activity name if any */
   std::list<smx_simcall_t> simcalls_;   /* List of simcalls waiting for this activity */
   resource::Action* surf_action_ = nullptr;
 
+  const std::string& get_name() const { return name_; }
+  const char* get_cname() const { return name_.c_str(); }
+
   virtual void suspend();
   virtual void resume();
   virtual void post()    = 0; // What to do when a simcall terminates
@@ -42,6 +44,7 @@ public:
 
 private:
   std::atomic_int_fast32_t refcount_{0};
+  std::string name_;                    /* Activity name if any */
 
 public:
   static simgrid::xbt::signal<void(ActivityImplPtr)> on_suspended;