From 5901a7d814ef3c475058d0cc958bebc21c81238c Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 24 May 2018 08:58:52 +0200 Subject: [PATCH] trivial snake_casing of xbt::PropertyHolder No backward compat necessary as all subclasses are in the kernel (and not exposed publicly yet) --- src/s4u/s4u_Actor.cpp | 6 +++--- src/s4u/s4u_Host.cpp | 6 +++--- src/s4u/s4u_Link.cpp | 4 ++-- src/s4u/s4u_Storage.cpp | 6 +++--- src/simix/ActorImpl.cpp | 6 +++--- src/surf/PropertyHolder.cpp | 6 +++--- src/surf/PropertyHolder.hpp | 6 +++--- src/surf/sg_platf.cpp | 4 ++-- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/s4u/s4u_Actor.cpp b/src/s4u/s4u_Actor.cpp index 18339edffd..31746fcca3 100644 --- a/src/s4u/s4u_Actor.cpp +++ b/src/s4u/s4u_Actor.cpp @@ -214,18 +214,18 @@ void Actor::kill_all() std::map* 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) { - 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) { - simgrid::simix::simcall([this, key, value] { pimpl_->setProperty(key, value); }); + simgrid::simix::simcall([this, key, value] { pimpl_->set_property(key, value); }); } Actor* Actor::restart() diff --git a/src/s4u/s4u_Host.cpp b/src/s4u/s4u_Host.cpp index e70d67e785..ba215f595a 100644 --- a/src/s4u/s4u_Host.cpp +++ b/src/s4u/s4u_Host.cpp @@ -206,18 +206,18 @@ void Host::route_to(Host* dest, std::vector& links, /** Get the properties assigned to a host */ std::map* 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) { - return this->pimpl_->getProperty(key); + return this->pimpl_->get_property(key); } 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 */ diff --git a/src/s4u/s4u_Link.cpp b/src/s4u/s4u_Link.cpp index a3b44a6d78..8d37930930 100644 --- a/src/s4u/s4u_Link.cpp +++ b/src/s4u/s4u_Link.cpp @@ -101,11 +101,11 @@ void Link::set_latency_trace(tmgr_trace_t trace) 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) { - 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 diff --git a/src/s4u/s4u_Storage.cpp b/src/s4u/s4u_Storage.cpp index a0e76998a5..aa0904d859 100644 --- a/src/s4u/s4u_Storage.cpp +++ b/src/s4u/s4u_Storage.cpp @@ -57,17 +57,17 @@ Host* Storage::getHost() std::map* 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) { - return this->pimpl_->getProperty(key); + return this->pimpl_->get_property(key); } 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) diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index ec224ed131..bbea0fc328 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -321,7 +321,7 @@ smx_actor_t SIMIX_process_create(const char* name, std::function code, v /* 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() == 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) - process->setProperty(kv.first, kv.second); + process->set_property(kv.first, kv.second); /* Add the process to it's host process list */ host->extension()->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(), - 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()); diff --git a/src/surf/PropertyHolder.cpp b/src/surf/PropertyHolder.cpp index 78c027bbcd..eed6a29679 100644 --- a/src/surf/PropertyHolder.cpp +++ b/src/surf/PropertyHolder.cpp @@ -13,7 +13,7 @@ PropertyHolder::~PropertyHolder() { } /** @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; @@ -22,7 +22,7 @@ const char* PropertyHolder::getProperty(std::string key) } /** @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; @@ -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! */ -std::map* PropertyHolder::getProperties() +std::map* PropertyHolder::get_properties() { if (not properties_) properties_ = new std::map; diff --git a/src/surf/PropertyHolder.hpp b/src/surf/PropertyHolder.hpp index 98e3b5b1a4..02eb5b9289 100644 --- a/src/surf/PropertyHolder.hpp +++ b/src/surf/PropertyHolder.hpp @@ -21,13 +21,13 @@ public: 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. */ - std::map* getProperties(); + std::map* get_properties(); private: std::map* properties_ = nullptr; diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 3b0eed0673..cff7f9e696 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -126,7 +126,7 @@ void sg_platf_new_link(simgrid::kernel::routing::LinkCreationArgs* link) 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) @@ -363,7 +363,7 @@ void sg_platf_new_storage(simgrid::kernel::routing::StorageCreationArgs* storage 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; } } -- 2.20.1