Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[s4u] s/ByName/by_name/
authorGabriel Corona <gabriel.corona@loria.fr>
Fri, 15 Jan 2016 12:46:42 +0000 (13:46 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Fri, 15 Jan 2016 12:57:16 +0000 (13:57 +0100)
examples/s4u/basic/s4u_basic.cpp
examples/s4u/io/s4u_io_test.cpp
include/simgrid/s4u/host.hpp
src/s4u/s4u_actor.cpp
src/s4u/s4u_host.cpp

index 6bbfdec..c1e3ca5 100644 (file)
@@ -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");
 
        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;
 }
        e->run();
        return 0;
 }
index 4f2e993..0283cc7 100644 (file)
@@ -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");
 
        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;
 }
        e->run();
        return 0;
 }
index 5d5df15..d9ff389 100644 (file)
@@ -45,13 +45,13 @@ private:
 public: // TODO, make me private
        ~Host();
 public:
 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);
 
   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_; }
 
 
        simgrid::xbt::string const& name() const { return name_; }
 
index 1753479..8264fe5 100644 (file)
@@ -62,7 +62,7 @@ void s4u::Actor::setAutoRestart(bool autorestart) {
 }
 
 s4u::Host *s4u::Actor::getHost() {
 }
 
 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);
 }
 const char* s4u::Actor::getName() {
        return simcall_process_get_name(p_smx_process);
index 8701353..c327312 100644 (file)
@@ -45,7 +45,7 @@ Host::~Host() {
                delete mounts;
 }
 
                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)
        Host* host = Host::by_name_or_null(name.c_str());
        // TODO, raise an exception instead?
        if (host == nullptr)