Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename create to init. add init with name only. add setters
[simgrid.git] / include / simgrid / kernel / Timer.hpp
index 78a12552a0ddc4ad1c342cd0952ba030e864a9f3..3a98068f9bee00276654b4bcc4334101a8dfd1c8 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2021. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2021-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. */
@@ -27,15 +26,14 @@ inline auto& kernel_timers() // avoid static initialization order fiasco
 /** @brief Timer datatype */
 class Timer {
   const double date_;
+  xbt::Task<void()> callback;
+  std::remove_reference_t<decltype(kernel_timers())>::handle_type handle_;
 
 public:
   double get_date() const { return date_; }
 
-  std::remove_reference_t<decltype(kernel_timers())>::handle_type handle_;
-
   Timer(double date, xbt::Task<void()>&& callback) : date_(date), callback(std::move(callback)) {}
 
-  xbt::Task<void()> callback;
   void remove();
 
   template <class F> static inline Timer* set(double date, F callback)