Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
further snake_case in routing
[simgrid.git] / src / s4u / s4u_link.cpp
index b0de6a6..d9a5089 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2013-2018. 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. */
@@ -6,7 +6,7 @@
 #include <algorithm>
 
 #include "simgrid/s4u/Link.hpp"
-#include "simgrid/sg_config.h"
+#include "simgrid/sg_config.hpp"
 #include "simgrid/simix.hpp"
 #include "src/kernel/lmm/maxmin.hpp"
 #include "src/surf/network_interface.hpp"
@@ -18,11 +18,9 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_link, s4u, "Logging specific to the S4U link
  * C API *
  *********/
 
-extern "C" {
-
 const char* sg_link_name(sg_link_t link)
 {
-  return link->getCname();
+  return link->get_cname();
 }
 sg_link_t sg_link_by_name(const char* name)
 {
@@ -68,7 +66,6 @@ void sg_link_exit()
 {
   simgrid::surf::LinkImpl::linksExit();
 }
-}
 
 /***********
  * C++ API *
@@ -83,21 +80,21 @@ Link* Link::byName(const char* name)
     return nullptr;
   return &res->piface_;
 }
-const std::string& Link::getName() const
+const std::string& Link::get_name() const
 {
-  return this->pimpl_->getName();
+  return this->pimpl_->get_name();
 }
-const char* Link::getCname() const
+const char* Link::get_cname() const
 {
-  return this->pimpl_->getCname();
+  return this->pimpl_->get_cname();
 }
 const char* Link::name()
 {
-  return getCname();
+  return get_cname();
 }
 bool Link::isUsed()
 {
-  return this->pimpl_->isUsed();
+  return this->pimpl_->is_used();
 }
 
 double Link::latency()
@@ -117,20 +114,16 @@ int Link::sharingPolicy()
 
 double Link::getUsage()
 {
-  return this->pimpl_->constraint()->get_usage();
+  return this->pimpl_->get_constraint()->get_usage();
 }
 
 void Link::turnOn()
 {
-  simgrid::simix::kernelImmediate([this]() {
-    this->pimpl_->turnOn();
-  });
+  simgrid::simix::kernelImmediate([this]() { this->pimpl_->turn_on(); });
 }
 void Link::turnOff()
 {
-  simgrid::simix::kernelImmediate([this]() {
-    this->pimpl_->turnOff();
-  });
+  simgrid::simix::kernelImmediate([this]() { this->pimpl_->turn_off(); });
 }
 
 void* Link::getData()