Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2023.
[simgrid.git] / src / kernel / actor / SynchroObserver.hpp
index 15549bd..b707161 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 {
 
 /* All the observers of Mutex transitions are very similar, so implement them all together in this class */
 class MutexObserver final : public SimcallObserver {
@@ -26,6 +24,7 @@ public:
   MutexObserver(ActorImpl* actor, mc::Transition::Type type, activity::MutexImpl* mutex);
 
   void serialize(std::stringstream& stream) const override;
+  std::string to_string() const override;
   bool is_enabled() override;
 
   activity::MutexImpl* get_mutex() const { return mutex_; }
@@ -40,6 +39,7 @@ public:
   SemaphoreObserver(ActorImpl* actor, mc::Transition::Type type, activity::SemaphoreImpl* sem);
 
   void serialize(std::stringstream& stream) const override;
+  std::string to_string() const override;
 
   activity::SemaphoreImpl* get_sem() const { return sem_; }
 };
@@ -55,12 +55,13 @@ public:
                                double timeout = -1.0);
 
   void serialize(std::stringstream& stream) const override;
+  std::string to_string() const override;
   bool is_enabled() override;
 
   double get_timeout() const { return timeout_; }
 };
 
-/* This observer is ued for BARRIER_LOCK and BARRIER_WAIT. WAIT is returning and needs the acquisition */
+/* This observer is used for BARRIER_LOCK and BARRIER_WAIT. WAIT is returning and needs the acquisition */
 class BarrierObserver final : public ResultingSimcall<bool> {
   mc::Transition::Type type_;
   activity::BarrierImpl* const barrier_                = nullptr;
@@ -73,13 +74,12 @@ public:
                   double timeout = -1.0);
 
   void serialize(std::stringstream& stream) const override;
+  std::string to_string() const override;
   bool is_enabled() override;
 
   double get_timeout() const { return timeout_; }
 };
 
-} // namespace actor
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::actor
 
 #endif