X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e0f1a9dae032024c4f4043e29fa878fc2a6f7699..24760d83c71aa79e6aab9d3922d30a607a6cf7da:/examples/cpp/operation-simple/s4u-operation-simple.cpp diff --git a/examples/cpp/operation-simple/s4u-operation-simple.cpp b/examples/cpp/operation-simple/s4u-operation-simple.cpp index ce60a021ff..70656e864c 100644 --- a/examples/cpp/operation-simple/s4u-operation-simple.cpp +++ b/examples/cpp/operation-simple/s4u-operation-simple.cpp @@ -29,20 +29,18 @@ int main(int argc, char* argv[]) auto jupiter = e.host_by_name("Jupiter"); // Create operations - auto exec1 = simgrid::plugins::ExecOp::create("exec1", 1e9, tremblay); - auto exec2 = simgrid::plugins::ExecOp::create("exec2", 1e9, jupiter); - auto comm = simgrid::plugins::CommOp::create("comm", 1e7, tremblay, jupiter); + auto exec1 = simgrid::plugins::ExecOp::init("exec1", 1e9, tremblay); + auto exec2 = simgrid::plugins::ExecOp::init("exec2", 1e9, jupiter); + auto comm = simgrid::plugins::CommOp::init("comm", 1e7, tremblay, jupiter); // Create the graph by defining dependencies between operations exec1->add_successor(comm); comm->add_successor(exec2); // Add a function to be called when operations end for log purpose - std::vector ops{exec1, exec2, comm}; - for (auto op : ops) - op->on_end([](simgrid::plugins::Operation* op) { - XBT_INFO("Operation %s finished (%d)", op->get_name().c_str(), op->get_count()); - }); + simgrid::plugins::Operation::on_end_cb([](simgrid::plugins::Operation* op) { + XBT_INFO("Operation %s finished (%d)", op->get_name().c_str(), op->get_count()); + }); // Enqueue two executions for operation exec1 exec1->enqueue_execs(2);