From: Gabriel Corona Date: Fri, 15 Jan 2016 12:46:42 +0000 (+0100) Subject: [s4u] s/ByName/by_name/ X-Git-Tag: v3_13~1237^2~1 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/bee936d0bbb44898371c66b1deaac3cf007ba7e2?ds=sidebyside [s4u] s/ByName/by_name/ --- diff --git a/examples/s4u/basic/s4u_basic.cpp b/examples/s4u/basic/s4u_basic.cpp index 6bbfdecbd6..c1e3ca5181 100644 --- a/examples/s4u/basic/s4u_basic.cpp +++ b/examples/s4u/basic/s4u_basic.cpp @@ -44,8 +44,8 @@ int main(int argc, char **argv) { simgrid::s4u::Engine *e = new simgrid::s4u::Engine(&argc,argv); e->loadPlatform("../../platforms/two_hosts_platform.xml"); - new Worker("worker", simgrid::s4u::Host::byName("host0"), 0, NULL); - new Master("master", simgrid::s4u::Host::byName("host1"), 0, NULL); + new Worker("worker", simgrid::s4u::Host::by_name("host0"), 0, NULL); + new Master("master", simgrid::s4u::Host::by_name("host1"), 0, NULL); e->run(); return 0; } diff --git a/examples/s4u/io/s4u_io_test.cpp b/examples/s4u/io/s4u_io_test.cpp index 4f2e993d06..0283cc797a 100644 --- a/examples/s4u/io/s4u_io_test.cpp +++ b/examples/s4u/io/s4u_io_test.cpp @@ -109,7 +109,7 @@ int main(int argc, char **argv) { simgrid::s4u::Engine *e = new simgrid::s4u::Engine(&argc,argv); e->loadPlatform("../../platforms/storage/storage.xml"); - new myHost("host", simgrid::s4u::Host::byName("denise"), 0, NULL); + new myHost("host", simgrid::s4u::Host::by_name("denise"), 0, NULL); e->run(); return 0; } diff --git a/include/simgrid/s4u/host.hpp b/include/simgrid/s4u/host.hpp index 5d5df15b7d..d9ff389334 100644 --- a/include/simgrid/s4u/host.hpp +++ b/include/simgrid/s4u/host.hpp @@ -45,13 +45,13 @@ private: public: // TODO, make me private ~Host(); public: - /** Retrieves an host from its name. */ - static s4u::Host *byName(std::string name); - /** Retrieves the host on which the current actor is running */ - static s4u::Host *current(); static Host* by_name_or_null(const char* name); static Host* by_name_or_create(const char* name); + /** Retrieves an host from its name. */ + static s4u::Host *by_name(std::string name); + /** Retrieves the host on which the current actor is running */ + static s4u::Host *current(); simgrid::xbt::string const& name() const { return name_; } diff --git a/src/s4u/s4u_actor.cpp b/src/s4u/s4u_actor.cpp index 1753479708..8264fe5eb8 100644 --- a/src/s4u/s4u_actor.cpp +++ b/src/s4u/s4u_actor.cpp @@ -62,7 +62,7 @@ void s4u::Actor::setAutoRestart(bool autorestart) { } s4u::Host *s4u::Actor::getHost() { - return s4u::Host::byName(sg_host_get_name(simcall_process_get_host(p_smx_process))); + return s4u::Host::by_name(sg_host_get_name(simcall_process_get_host(p_smx_process))); } const char* s4u::Actor::getName() { return simcall_process_get_name(p_smx_process); diff --git a/src/s4u/s4u_host.cpp b/src/s4u/s4u_host.cpp index 8701353b5d..c327312306 100644 --- a/src/s4u/s4u_host.cpp +++ b/src/s4u/s4u_host.cpp @@ -45,7 +45,7 @@ Host::~Host() { delete mounts; } -Host *Host::byName(std::string name) { +Host *Host::by_name(std::string name) { Host* host = Host::by_name_or_null(name.c_str()); // TODO, raise an exception instead? if (host == nullptr)