Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
use consistent namespaces
[simgrid.git] / src / kernel / activity / IoImpl.cpp
index 7597010..7647a18 100644 (file)
@@ -13,9 +13,9 @@
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_io, simix, "Logging specific to SIMIX (io)");
 
-void simcall_HANDLER_io_wait(smx_simcall_t simcall, smx_activity_t synchro)
+void simcall_HANDLER_io_wait(smx_simcall_t simcall, simgrid::kernel::activity::IoImpl* synchro)
 {
-  XBT_DEBUG("Wait for execution of synchro %p, state %d", synchro.get(), (int)synchro->state_);
+  XBT_DEBUG("Wait for execution of synchro %p, state %d", synchro, (int)synchro->state_);
 
   /* Associate this simcall to the synchro */
   synchro->simcalls_.push_back(simcall);
@@ -24,20 +24,20 @@ void simcall_HANDLER_io_wait(smx_simcall_t simcall, smx_activity_t synchro)
   /* set surf's synchro */
   if (MC_is_active() || MC_record_replay_is_active()) {
     synchro->state_ = SIMIX_DONE;
-    boost::static_pointer_cast<simgrid::kernel::activity::IoImpl>(synchro)->finish();
+    synchro->finish();
     return;
   }
 
   /* If the synchro is already finished then perform the error handling */
   if (synchro->state_ != SIMIX_RUNNING)
-    boost::static_pointer_cast<simgrid::kernel::activity::IoImpl>(synchro)->finish();
+    synchro->finish();
 }
 
 namespace simgrid {
 namespace kernel {
 namespace activity {
 
-IoImpl::IoImpl(std::string name, surf::StorageImpl* storage) : ActivityImpl(std::move(name)), storage_(storage)
+IoImpl::IoImpl(const std::string& name, resource::StorageImpl* storage) : ActivityImpl(name), storage_(storage)
 {
   this->state_ = SIMIX_RUNNING;
 
@@ -51,13 +51,13 @@ IoImpl::~IoImpl()
   XBT_DEBUG("Destroy io %p", this);
 }
 
-IoImpl* IoImpl::start(sg_size_t size, simgrid::s4u::Io::OpType type)
+IoImpl* IoImpl::start(sg_size_t size, s4u::Io::OpType type)
 {
   surf_action_ = storage_->io_start(size, type);
   surf_action_->set_data(this);
 
   XBT_DEBUG("Create IO synchro %p %s", this, get_cname());
-  simgrid::kernel::activity::IoImpl::on_start(this);
+  IoImpl::on_start(this);
 
   return this;
 }
@@ -79,15 +79,14 @@ void IoImpl::post()
 {
   performed_ioops_ = surf_action_->get_cost();
   switch (surf_action_->get_state()) {
-    case simgrid::kernel::resource::Action::State::FAILED:
+    case resource::Action::State::FAILED:
       state_ = SIMIX_FAILED;
       break;
-    case simgrid::kernel::resource::Action::State::FINISHED:
+    case resource::Action::State::FINISHED:
       state_ = SIMIX_DONE;
       break;
     default:
       THROW_IMPOSSIBLE;
-      break;
   }
   on_completion(this);