Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make function "const" (sonar).
[simgrid.git] / src / kernel / resource / profile / ProfileBuilder.cpp
index e2ac345..038a0ea 100644 (file)
@@ -16,9 +16,7 @@
 #include <sstream>
 #include <string_view>
 
-namespace simgrid {
-namespace kernel {
-namespace profile {
+namespace simgrid::kernel::profile {
 
 bool DatedValue::operator==(DatedValue const& e2) const
 {
@@ -214,6 +212,8 @@ public:
         event_list.at(initial_size).date_ += loop_delay;
     }
   }
+
+  std::vector<StochasticDatedValue> get_pattern() const { return pattern; }
 };
 
 Profile* ProfileBuilder::from_string(const std::string& name, const std::string& input, double periodicity)
@@ -245,7 +245,12 @@ Profile* ProfileBuilder::from_callback(const std::string& name, const std::funct
   return new Profile(name, cb, repeat_delay);
 }
 
+} // namespace simgrid::kernel::profile
+
+std::vector<simgrid::kernel::profile::StochasticDatedValue> trace2selist( const char*  c_str) {
+  std::string str(c_str);
+  simgrid::kernel::profile::LegacyUpdateCb cb(str,0);
+  return cb.get_pattern();
+}
+
 
-} // namespace profile
-} // namespace kernel
-} // namespace simgrid