Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
mv category from msg_task_t to simgrid::msg::Task
[simgrid.git] / src / msg / msg_private.hpp
index 847d595..01ec91a 100644 (file)
 namespace simgrid {
 namespace msg {
 class Task {
+  std::string name_             = "";
+  std::string tracing_category_ = "";
+
 public:
   ~Task();
-  explicit Task(double flops_amount, double bytes_amount) : flops_amount(flops_amount), bytes_amount(bytes_amount) {}
+  explicit Task(std::string name, double flops_amount, double bytes_amount)
+      : name_(std::move(name)), flops_amount(flops_amount), bytes_amount(bytes_amount)
+  {
+  }
   void set_used();
   void set_not_used() { this->is_used = false; }
 
+  const std::string& get_name() const { return name_; }
+  const char* get_cname() { return name_.c_str(); }
+  void set_name(const char* new_name) { name_ = std::string(new_name); }
+  void set_tracing_category(const char* category) { tracing_category_ = category ? std::string(category) : ""; }
+  const std::string& get_tracing_category() { return tracing_category_; }
+  bool has_tracing_category() { return not tracing_category_.empty(); }
+
   kernel::activity::ExecImplPtr compute          = nullptr; /* SIMIX modeling of computation */
   s4u::CommPtr comm                              = nullptr; /* S4U modeling of communication */
   double flops_amount                            = 0.0;     /* Computation size */