Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2023.
[simgrid.git] / src / kernel / resource / profile / Profile.hpp
index 9b9402a..1876a95 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-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. */
@@ -15,9 +15,7 @@
 #include <vector>
 #include <string>
 
-namespace simgrid {
-namespace kernel {
-namespace profile {
+namespace simgrid::kernel::profile {
 
 /** @brief A profile is a set of timed values, encoding the value that a variable takes at what time
  *
@@ -54,11 +52,16 @@ private:
   std::vector<DatedValue> event_list;
   FutureEvtSet* fes_  = nullptr;
   double repeat_delay;
+
+  bool get_enough_events(size_t index)
+  {
+    if (index >= event_list.size() && cb)
+      cb(event_list);
+    return index < event_list.size();
+  }
 };
 
-} // namespace profile
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::profile
 
 /** Module finalizer: frees all profiles */
 XBT_PUBLIC void tmgr_finalize();