Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
trivial snake_casing of xbt::PropertyHolder
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 24 May 2018 06:58:52 +0000 (08:58 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 24 May 2018 06:59:22 +0000 (08:59 +0200)
No backward compat necessary as all subclasses are in the kernel (and
not exposed publicly yet)

src/s4u/s4u_Actor.cpp
src/s4u/s4u_Host.cpp
src/s4u/s4u_Link.cpp
src/s4u/s4u_Storage.cpp
src/simix/ActorImpl.cpp
src/surf/PropertyHolder.cpp
src/surf/PropertyHolder.hpp
src/surf/sg_platf.cpp

index 18339ed..31746fc 100644 (file)
@@ -214,18 +214,18 @@ void Actor::kill_all()
 
 std::map<std::string, std::string>* Actor::get_properties()
 {
 
 std::map<std::string, std::string>* Actor::get_properties()
 {
-  return simgrid::simix::simcall([this] { return this->pimpl_->getProperties(); });
+  return simgrid::simix::simcall([this] { return this->pimpl_->get_properties(); });
 }
 
 /** Retrieve the property value (or nullptr if not set) */
 const char* Actor::get_property(const char* key)
 {
 }
 
 /** Retrieve the property value (or nullptr if not set) */
 const char* Actor::get_property(const char* key)
 {
-  return simgrid::simix::simcall([this, key] { return pimpl_->getProperty(key); });
+  return simgrid::simix::simcall([this, key] { return pimpl_->get_property(key); });
 }
 
 void Actor::set_property(const char* key, const char* value)
 {
 }
 
 void Actor::set_property(const char* key, const char* value)
 {
-  simgrid::simix::simcall([this, key, value] { pimpl_->setProperty(key, value); });
+  simgrid::simix::simcall([this, key, value] { pimpl_->set_property(key, value); });
 }
 
 Actor* Actor::restart()
 }
 
 Actor* Actor::restart()
index e70d67e..ba215f5 100644 (file)
@@ -206,18 +206,18 @@ void Host::route_to(Host* dest, std::vector<kernel::resource::LinkImpl*>& links,
 /** Get the properties assigned to a host */
 std::map<std::string, std::string>* Host::getProperties()
 {
 /** Get the properties assigned to a host */
 std::map<std::string, std::string>* Host::getProperties()
 {
-  return simgrid::simix::simcall([this] { return this->pimpl_->getProperties(); });
+  return simgrid::simix::simcall([this] { return this->pimpl_->get_properties(); });
 }
 
 /** Retrieve the property value (or nullptr if not set) */
 const char* Host::get_property(const char* key)
 {
 }
 
 /** Retrieve the property value (or nullptr if not set) */
 const char* Host::get_property(const char* key)
 {
-  return this->pimpl_->getProperty(key);
+  return this->pimpl_->get_property(key);
 }
 
 void Host::set_property(std::string key, std::string value)
 {
 }
 
 void Host::set_property(std::string key, std::string value)
 {
-  simgrid::simix::simcall([this, key, value] { this->pimpl_->setProperty(key, value); });
+  simgrid::simix::simcall([this, key, value] { this->pimpl_->set_property(key, value); });
 }
 
 /** @brief Get the peak processor speed (in flops/s), at the specified pstate  */
 }
 
 /** @brief Get the peak processor speed (in flops/s), at the specified pstate  */
index a3b44a6..8d37930 100644 (file)
@@ -101,11 +101,11 @@ void Link::set_latency_trace(tmgr_trace_t trace)
 
 const char* Link::get_property(const char* key)
 {
 
 const char* Link::get_property(const char* key)
 {
-  return this->pimpl_->getProperty(key);
+  return this->pimpl_->get_property(key);
 }
 void Link::set_property(std::string key, std::string value)
 {
 }
 void Link::set_property(std::string key, std::string value)
 {
-  simgrid::simix::simcall([this, key, value] { this->pimpl_->setProperty(key, value); });
+  simgrid::simix::simcall([this, key, value] { this->pimpl_->set_property(key, value); });
 }
 } // namespace s4u
 } // namespace simgrid
 }
 } // namespace s4u
 } // namespace simgrid
index a0e7699..aa0904d 100644 (file)
@@ -57,17 +57,17 @@ Host* Storage::getHost()
 
 std::map<std::string, std::string>* Storage::getProperties()
 {
 
 std::map<std::string, std::string>* Storage::getProperties()
 {
-  return simgrid::simix::simcall([this] { return pimpl_->getProperties(); });
+  return simgrid::simix::simcall([this] { return pimpl_->get_properties(); });
 }
 
 const char* Storage::getProperty(std::string key)
 {
 }
 
 const char* Storage::getProperty(std::string key)
 {
-  return this->pimpl_->getProperty(key);
+  return this->pimpl_->get_property(key);
 }
 
 void Storage::setProperty(std::string key, std::string value)
 {
 }
 
 void Storage::setProperty(std::string key, std::string value)
 {
-  simgrid::simix::simcall([this, key, value] { this->pimpl_->setProperty(key, value); });
+  simgrid::simix::simcall([this, key, value] { this->pimpl_->set_property(key, value); });
 }
 
 sg_size_t Storage::read(sg_size_t size)
 }
 
 sg_size_t Storage::read(sg_size_t size)
index ec224ed..bbea0fc 100644 (file)
@@ -321,7 +321,7 @@ smx_actor_t SIMIX_process_create(const char* name, std::function<void()> code, v
   /* Add properties */
   if (properties != nullptr)
     for (auto const& kv : *properties)
   /* Add properties */
   if (properties != nullptr)
     for (auto const& kv : *properties)
-      process->setProperty(kv.first, kv.second);
+      process->set_property(kv.first, kv.second);
 
   /* Make sure that the process is initialized for simix, in case we are called from the Host::onCreation signal */
   if (host->extension<simgrid::simix::Host>() == nullptr)
 
   /* Make sure that the process is initialized for simix, in case we are called from the Host::onCreation signal */
   if (host->extension<simgrid::simix::Host>() == nullptr)
@@ -382,7 +382,7 @@ smx_actor_t SIMIX_process_attach(const char* name, void* data, const char* hostn
   /* Add properties */
   if (properties != nullptr)
     for (auto const& kv : *properties)
   /* Add properties */
   if (properties != nullptr)
     for (auto const& kv : *properties)
-      process->setProperty(kv.first, kv.second);
+      process->set_property(kv.first, kv.second);
 
   /* Add the process to it's host process list */
   host->extension<simgrid::simix::Host>()->process_list.push_back(*process);
 
   /* Add the process to it's host process list */
   host->extension<simgrid::simix::Host>()->process_list.push_back(*process);
@@ -713,7 +713,7 @@ void SIMIX_process_yield(smx_actor_t self)
     /* Add the process to the list of process to restart, only if the host is down */
     if (self->auto_restart && self->host->is_off()) {
       SIMIX_host_add_auto_restart_process(self->host, self->get_cname(), self->code, self->getUserData(),
     /* Add the process to the list of process to restart, only if the host is down */
     if (self->auto_restart && self->host->is_off()) {
       SIMIX_host_add_auto_restart_process(self->host, self->get_cname(), self->code, self->getUserData(),
-                                          SIMIX_timer_get_date(self->kill_timer), self->getProperties(),
+                                          SIMIX_timer_get_date(self->kill_timer), self->get_properties(),
                                           self->auto_restart);
     }
     XBT_DEBUG("Process %s@%s is dead", self->get_cname(), self->host->get_cname());
                                           self->auto_restart);
     }
     XBT_DEBUG("Process %s@%s is dead", self->get_cname(), self->host->get_cname());
index 78c027b..eed6a29 100644 (file)
@@ -13,7 +13,7 @@ PropertyHolder::~PropertyHolder() {
 }
 
 /** @brief Return the property associated to the provided key (or nullptr if not existing) */
 }
 
 /** @brief Return the property associated to the provided key (or nullptr if not existing) */
-const char* PropertyHolder::getProperty(std::string key)
+const char* PropertyHolder::get_property(std::string key)
 {
   if (properties_ == nullptr)
     return nullptr;
 {
   if (properties_ == nullptr)
     return nullptr;
@@ -22,7 +22,7 @@ const char* PropertyHolder::getProperty(std::string key)
 }
 
 /** @brief Change the value of a given key in the property set */
 }
 
 /** @brief Change the value of a given key in the property set */
-void PropertyHolder::setProperty(std::string key, std::string value)
+void PropertyHolder::set_property(std::string key, std::string value)
 {
   if (not properties_)
     properties_       = new std::map<std::string, std::string>;
 {
   if (not properties_)
     properties_       = new std::map<std::string, std::string>;
@@ -30,7 +30,7 @@ void PropertyHolder::setProperty(std::string key, std::string value)
 }
 
 /** @brief Return the whole set of properties. Don't mess with it, dude! */
 }
 
 /** @brief Return the whole set of properties. Don't mess with it, dude! */
-std::map<std::string, std::string>* PropertyHolder::getProperties()
+std::map<std::string, std::string>* PropertyHolder::get_properties()
 {
   if (not properties_)
     properties_ = new std::map<std::string, std::string>;
 {
   if (not properties_)
     properties_ = new std::map<std::string, std::string>;
index 98e3b5b..02eb5b9 100644 (file)
@@ -21,13 +21,13 @@ public:
   PropertyHolder() = default;
   ~PropertyHolder();
 
   PropertyHolder() = default;
   ~PropertyHolder();
 
-  const char* getProperty(std::string key);
-  void setProperty(std::string id, std::string value);
+  const char* get_property(std::string key);
+  void set_property(std::string id, std::string value);
 
   /* FIXME: This should not be exposed, as users may do bad things with the dict they got (it's not a copy).
    * But some user API expose this call so removing it is not so easy.
    */
 
   /* FIXME: This should not be exposed, as users may do bad things with the dict they got (it's not a copy).
    * But some user API expose this call so removing it is not so easy.
    */
-  std::map<std::string, std::string>* getProperties();
+  std::map<std::string, std::string>* get_properties();
 
 private:
   std::map<std::string, std::string>* properties_ = nullptr;
 
 private:
   std::map<std::string, std::string>* properties_ = nullptr;
index 3b0eed0..cff7f9e 100644 (file)
@@ -126,7 +126,7 @@ void sg_platf_new_link(simgrid::kernel::routing::LinkCreationArgs* link)
 
     if (link->properties) {
       for (auto const& elm : *link->properties)
 
     if (link->properties) {
       for (auto const& elm : *link->properties)
-        l->setProperty(elm.first, elm.second);
+        l->set_property(elm.first, elm.second);
     }
 
     if (link->latency_trace)
     }
 
     if (link->latency_trace)
@@ -363,7 +363,7 @@ void sg_platf_new_storage(simgrid::kernel::routing::StorageCreationArgs* storage
 
   if (storage->properties) {
     for (auto const& elm : *storage->properties)
 
   if (storage->properties) {
     for (auto const& elm : *storage->properties)
-      s->setProperty(elm.first, elm.second);
+      s->set_property(elm.first, elm.second);
     delete storage->properties;
   }
 }
     delete storage->properties;
   }
 }