Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
setter function only need a simcall in MC or with parallel execs
[simgrid.git] / src / kernel / actor / Simcall.cpp
1 /* Copyright (c) 2010-2022. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #include "src/kernel/actor/Simcall.hpp"
7 #include "simgrid/s4u/Host.hpp"
8 #include "src/kernel/actor/ActorImpl.hpp"
9 #include "src/kernel/actor/SimcallObserver.hpp"
10 #include "src/kernel/context/Context.hpp"
11 #include "xbt/log.h"
12
13 namespace simgrid::kernel::actor {
14
15 /** @brief returns a printable string representing a simcall */
16 const char* Simcall::get_cname() const
17 {
18   if (observer_ != nullptr) {
19     static std::string name;
20     name              = boost::core::demangle(typeid(*observer_).name());
21     const char* cname = name.c_str();
22     if (name.rfind("simgrid::kernel::", 0) == 0)
23       cname += 17; // strip prefix "simgrid::kernel::"
24     return cname;
25   } else {
26     return to_c_str(call_);
27   }
28 }
29 ObjectAccessSimcallItem::ObjectAccessSimcallItem()
30 {
31   take_ownership();
32 }
33 void ObjectAccessSimcallItem::take_ownership()
34 {
35   simcall_owner_ = ActorImpl::self();
36 }
37
38 } // namespace simgrid::kernel::actor