Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add operation to plugin doc
[simgrid.git] / src / kernel / actor / CommObserver.hpp
index 2358e5a08eb74ef204e50e70619a3c4d8eaf0eec..b631a5e9fe5a099382aa0f622630841c86b2d4cf 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2019-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2019-2023. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -13,9 +13,7 @@
 
 #include <string>
 
-namespace simgrid {
-namespace kernel {
-namespace actor {
+namespace simgrid::kernel::actor {
 
 class ActivityTestSimcall final : public ResultingSimcall<bool> {
   activity::ActivityImpl* const activity_;
@@ -25,9 +23,9 @@ public:
       : ResultingSimcall(actor, true), activity_(activity)
   {
   }
-  bool is_visible() const override { return true; }
   activity::ActivityImpl* get_activity() const { return activity_; }
   void serialize(std::stringstream& stream) const override;
+  std::string to_string() const override;
 };
 
 class ActivityTestanySimcall final : public ResultingSimcall<ssize_t> {
@@ -37,10 +35,10 @@ class ActivityTestanySimcall final : public ResultingSimcall<ssize_t> {
 
 public:
   ActivityTestanySimcall(ActorImpl* actor, const std::vector<activity::ActivityImpl*>& activities);
-  bool is_visible() const override { return true; }
   bool is_enabled() override { return true; /* can return -1 if no activity is ready */ }
   void serialize(std::stringstream& stream) const override;
-  int get_max_consider() override;
+  std::string to_string() const override;
+  int get_max_consider() const override;
   void prepare(int times_considered) override;
   const std::vector<activity::ActivityImpl*>& get_activities() const { return activities_; }
   int get_value() const { return next_value_; }
@@ -56,7 +54,7 @@ public:
   {
   }
   void serialize(std::stringstream& stream) const override;
-  bool is_visible() const override { return true; }
+  std::string to_string() const override;
   bool is_enabled() override;
   activity::ActivityImpl* get_activity() const { return activity_; }
   void set_activity(activity::ActivityImpl* activity) { activity_ = activity; }
@@ -73,9 +71,9 @@ public:
   ActivityWaitanySimcall(ActorImpl* actor, const std::vector<activity::ActivityImpl*>& activities, double timeout);
   bool is_enabled() override;
   void serialize(std::stringstream& stream) const override;
-  bool is_visible() const override { return true; }
+  std::string to_string() const override;
   void prepare(int times_considered) override;
-  int get_max_consider() override;
+  int get_max_consider() const override;
   const std::vector<activity::ActivityImpl*>& get_activities() const { return activities_; }
   double get_timeout() const { return timeout_; }
   int get_value() const { return next_value_; }
@@ -118,7 +116,7 @@ public:
   {
   }
   void serialize(std::stringstream& stream) const override;
-  bool is_visible() const override { return true; }
+  std::string to_string() const override;
   activity::MailboxImpl* get_mailbox() const { return mbox_; }
   double get_payload_size() const { return payload_size_; }
   double get_rate() const { return rate_; }
@@ -162,7 +160,7 @@ public:
   {
   }
   void serialize(std::stringstream& stream) const override;
-  bool is_visible() const override { return true; }
+  std::string to_string() const override;
   activity::MailboxImpl* get_mailbox() const { return mbox_; }
   double get_rate() const { return rate_; }
   unsigned char* get_dst_buff() const { return dst_buff_; }
@@ -175,8 +173,6 @@ public:
   auto const& get_copy_data_fun() const { return copy_data_fun_; }
 };
 
-} // namespace actor
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::actor
 
 #endif