-private:
- simgrid::kernel::activity::ActivityImplPtr pimpl_ = nullptr;
- Activity::State state_ = Activity::State::INITED;
- double remains_ = 0;
- void* user_data_ = nullptr;
-}; // class
+ AnyActivity* set_tracing_category(const std::string& category)
+ {
+ xbt_assert(get_state() == State::INITED, "Cannot change the tracing category of an activity after its start");
+ tracing_category_ = category;
+ return static_cast<AnyActivity*>(this);
+ }
+ const std::string& get_tracing_category() const { return tracing_category_; }
+
+ AnyActivity* set_user_data(void* data)
+ {
+ user_data_ = data;
+ return static_cast<AnyActivity*>(this);
+ }
+
+ void* get_user_data() const { return user_data_; }
+#ifndef DOXYGEN
+ /* The refcounting is done in the ancestor class, Activity, but we want each of the classes benefiting of the CRTP
+ * (Exec, Comm, etc) to have smart pointers too, so we define these methods here, that forward the ptr_release and
+ * add_ref to the Activity class. Hopefully, the "inline" helps to not hinder the perf here.
+ */
+ friend void inline intrusive_ptr_release(AnyActivity* a) { intrusive_ptr_release(static_cast<Activity*>(a)); }
+ friend void inline intrusive_ptr_add_ref(AnyActivity* a) { intrusive_ptr_add_ref(static_cast<Activity*>(a)); }
+#endif
+};