X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5e22041a2c1ba01ba5c2337e39ebd9a590780182..5ed37babb2fa9097abe82df299c0aa259ed84d5a:/src/kernel/resource/profile/Profile.hpp?ds=sidebyside diff --git a/src/kernel/resource/profile/Profile.hpp b/src/kernel/resource/profile/Profile.hpp index 9b9402a852..1876a959d7 100644 --- a/src/kernel/resource/profile/Profile.hpp +++ b/src/kernel/resource/profile/Profile.hpp @@ -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 #include -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 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();