Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
s4u: rename the private implementations as such
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 9 May 2016 15:32:31 +0000 (17:32 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 9 May 2016 15:32:31 +0000 (17:32 +0200)
include/simgrid/s4u/actor.hpp
include/simgrid/s4u/async.hpp
include/simgrid/s4u/file.hpp
include/simgrid/s4u/mailbox.hpp
include/simgrid/s4u/storage.hpp
src/s4u/s4u_actor.cpp
src/s4u/s4u_comm.cpp
src/s4u/s4u_file.cpp
src/s4u/s4u_mailbox.cpp
src/s4u/s4u_storage.cpp

index 8c6e1fc..2479075 100644 (file)
@@ -95,9 +95,9 @@ public:
   void send(Mailbox &chan, void*payload, size_t simulatedSize);
 
 protected:
   void send(Mailbox &chan, void*payload, size_t simulatedSize);
 
 protected:
-  smx_process_t getInferior() {return inferior_;}
+  smx_process_t getInferior() {return pimpl_;}
 private:
 private:
-  smx_process_t inferior_;
+  smx_process_t pimpl_;
 };
 }} // namespace simgrid::s4u
 
 };
 }} // namespace simgrid::s4u
 
index 9ef1778..2f12e79 100644 (file)
@@ -34,7 +34,7 @@ protected:
   virtual ~Async();
   
 private:
   virtual ~Async();
   
 private:
-  simgrid::simix::Synchro *inferior_ = NULL;
+  simgrid::simix::Synchro *pimpl_ = NULL;
 
 private:
   e_s4u_async_state_t state_ = inited;
 
 private:
   e_s4u_async_state_t state_ = inited;
index 63c3563..0e97633 100644 (file)
@@ -29,7 +29,7 @@ public:
   File(const char *fullpath, void* userdata);
   ~File();
 private:
   File(const char *fullpath, void* userdata);
   ~File();
 private:
-  smx_file_t inferior_;
+  smx_file_t pimpl_;
   const char *path_;
 
 public:
   const char *path_;
 
 public:
index aa5f327..3d1b6ab 100644 (file)
@@ -33,7 +33,7 @@ public:
   ~Mailbox();
   
 protected:
   ~Mailbox();
   
 protected:
-  smx_mailbox_t getInferior() { return inferior_; }
+  smx_mailbox_t getInferior() { return pimpl_; }
 
 public:
   /** Get the name of that mailbox */
 
 public:
   /** Get the name of that mailbox */
@@ -54,7 +54,7 @@ public:
 
 private:
   std::string name_;
 
 private:
   std::string name_;
-  smx_mailbox_t inferior_;
+  smx_mailbox_t pimpl_;
   static boost::unordered_map<std::string, Mailbox *> *mailboxes;
   friend s4u::Engine;
 };
   static boost::unordered_map<std::string, Mailbox *> *mailboxes;
   friend s4u::Engine;
 };
index e67a1a9..3d9dd19 100644 (file)
@@ -44,7 +44,7 @@ private:
 
   static boost::unordered_map<std::string, Storage *> *storages_;
   std::string name_;
 
   static boost::unordered_map<std::string, Storage *> *storages_;
   std::string name_;
-  smx_storage_t inferior_;
+  smx_storage_t pimpl_;
 
 
 public:
 
 
 public:
index b29b9ee..0496209 100644 (file)
@@ -27,15 +27,15 @@ static int s4u_actor_runner(int argc, char **argv)
 using namespace simgrid;
 
 s4u::Actor::Actor(smx_process_t smx_proc) {
 using namespace simgrid;
 
 s4u::Actor::Actor(smx_process_t smx_proc) {
-  inferior_ = smx_proc;
+  pimpl_ = smx_proc;
 }
 s4u::Actor::Actor(const char *name, s4u::Host *host, int argc, char **argv)
     : s4u::Actor::Actor(name,host, argc,argv, -1) {
 }
 s4u::Actor::Actor(const char *name, s4u::Host *host, int argc, char **argv, double killTime) {
 }
 s4u::Actor::Actor(const char *name, s4u::Host *host, int argc, char **argv)
     : s4u::Actor::Actor(name,host, argc,argv, -1) {
 }
 s4u::Actor::Actor(const char *name, s4u::Host *host, int argc, char **argv, double killTime) {
-  inferior_ = simcall_process_create(name, s4u_actor_runner, this, host->name().c_str(), killTime, argc, argv, NULL/*properties*/,0);
+  pimpl_ = simcall_process_create(name, s4u_actor_runner, this, host->name().c_str(), killTime, argc, argv, NULL/*properties*/,0);
 
 
-  xbt_assert(inferior_,"Cannot create the actor");
+  xbt_assert(pimpl_,"Cannot create the actor");
 //  TRACE_msg_process_create(procname, simcall_process_get_PID(p_smx_process), host->getInferior());
 //  simcall_process_on_exit(p_smx_process,(int_f_pvoid_pvoid_t)TRACE_msg_process_kill,p_smx_process);
 }
 //  TRACE_msg_process_create(procname, simcall_process_get_PID(p_smx_process), host->getInferior());
 //  simcall_process_on_exit(p_smx_process,(int_f_pvoid_pvoid_t)TRACE_msg_process_kill,p_smx_process);
 }
@@ -54,30 +54,30 @@ s4u::Actor &s4u::Actor::self()
 }
 
 void s4u::Actor::setAutoRestart(bool autorestart) {
 }
 
 void s4u::Actor::setAutoRestart(bool autorestart) {
-  simcall_process_auto_restart_set(inferior_,autorestart);
+  simcall_process_auto_restart_set(pimpl_,autorestart);
 }
 
 s4u::Host *s4u::Actor::getHost() {
 }
 
 s4u::Host *s4u::Actor::getHost() {
-  return s4u::Host::by_name(sg_host_get_name(simcall_process_get_host(inferior_)));
+  return s4u::Host::by_name(sg_host_get_name(simcall_process_get_host(pimpl_)));
 }
 const char* s4u::Actor::getName() {
 }
 const char* s4u::Actor::getName() {
-  return simcall_process_get_name(inferior_);
+  return simcall_process_get_name(pimpl_);
 }
 int s4u::Actor::getPid(){
 }
 int s4u::Actor::getPid(){
-  return simcall_process_get_PID(inferior_);
+  return simcall_process_get_PID(pimpl_);
 }
 
 void s4u::Actor::setKillTime(double time) {
 }
 
 void s4u::Actor::setKillTime(double time) {
-  simcall_process_set_kill_time(inferior_,time);
+  simcall_process_set_kill_time(pimpl_,time);
 }
 double s4u::Actor::getKillTime() {
 }
 double s4u::Actor::getKillTime() {
-  return simcall_process_get_kill_time(inferior_);
+  return simcall_process_get_kill_time(pimpl_);
 }
 void s4u::Actor::killAll() {
   simcall_process_killall(1);
 }
 void s4u::Actor::kill() {
 }
 void s4u::Actor::killAll() {
   simcall_process_killall(1);
 }
 void s4u::Actor::kill() {
-  simcall_process_kill(inferior_);
+  simcall_process_kill(pimpl_);
 }
 
 void s4u::Actor::sleep(double duration) {
 }
 
 void s4u::Actor::sleep(double duration) {
index e19a052..1415742 100644 (file)
@@ -73,12 +73,12 @@ void s4u::Comm::start() {
   xbt_assert(state_ == inited);
 
   if (srcBuff_ != NULL) { // Sender side
   xbt_assert(state_ == inited);
 
   if (srcBuff_ != NULL) { // Sender side
-    inferior_ = simcall_comm_isend(sender_->getInferior(), mailbox_->getInferior(), remains_, rate_,
+    pimpl_ = simcall_comm_isend(sender_->getInferior(), mailbox_->getInferior(), remains_, rate_,
         srcBuff_, srcBuffSize_,
         matchFunction_, cleanFunction_, copyDataFunction_,
         userData_, detached_);
   } else if (dstBuff_ != NULL) { // Receiver side
         srcBuff_, srcBuffSize_,
         matchFunction_, cleanFunction_, copyDataFunction_,
         userData_, detached_);
   } else if (dstBuff_ != NULL) { // Receiver side
-    inferior_ = simcall_comm_irecv(receiver_->getInferior(), mailbox_->getInferior(), dstBuff_, &dstBuffSize_,
+    pimpl_ = simcall_comm_irecv(receiver_->getInferior(), mailbox_->getInferior(), dstBuff_, &dstBuffSize_,
         matchFunction_, copyDataFunction_,
         userData_, rate_);
 
         matchFunction_, copyDataFunction_,
         userData_, rate_);
 
@@ -91,7 +91,7 @@ void s4u::Comm::wait() {
   xbt_assert(state_ == started || state_ == inited);
 
   if (state_ == started)
   xbt_assert(state_ == started || state_ == inited);
 
   if (state_ == started)
-    simcall_comm_wait(inferior_, -1/*timeout*/);
+    simcall_comm_wait(pimpl_, -1/*timeout*/);
   else {// p_state == inited. Save a simcall and do directly a blocking send/recv
     if (srcBuff_ != NULL) {
       simcall_comm_send(sender_->getInferior(), mailbox_->getInferior(), remains_, rate_,
   else {// p_state == inited. Save a simcall and do directly a blocking send/recv
     if (srcBuff_ != NULL) {
       simcall_comm_send(sender_->getInferior(), mailbox_->getInferior(), remains_, rate_,
@@ -110,7 +110,7 @@ void s4u::Comm::wait(double timeout) {
   xbt_assert(state_ == started || state_ == inited);
 
   if (state_ == started) {
   xbt_assert(state_ == started || state_ == inited);
 
   if (state_ == started) {
-    simcall_comm_wait(inferior_, timeout);
+    simcall_comm_wait(pimpl_, timeout);
     state_ = finished;
     return;
   }
     state_ = finished;
     return;
   }
index 65c4557..2f61275 100644 (file)
@@ -22,36 +22,36 @@ namespace s4u {
 
 File::File(const char*fullpath, void *userdata) {
   // this cannot fail because we get a xbt_die if the mountpoint does not exist
 
 File::File(const char*fullpath, void *userdata) {
   // this cannot fail because we get a xbt_die if the mountpoint does not exist
-  inferior_ = simcall_file_open(fullpath, Host::current());
+  pimpl_ = simcall_file_open(fullpath, Host::current());
   path_ = fullpath;
 }
 
 File::~File() {
   path_ = fullpath;
 }
 
 File::~File() {
-  simcall_file_close(inferior_, Host::current());
+  simcall_file_close(pimpl_, Host::current());
 }
 
 sg_size_t File::read(sg_size_t size) {
 }
 
 sg_size_t File::read(sg_size_t size) {
-  return simcall_file_read(inferior_, size, Host::current());
+  return simcall_file_read(pimpl_, size, Host::current());
 }
 sg_size_t File::write(sg_size_t size) {
 }
 sg_size_t File::write(sg_size_t size) {
-  return simcall_file_write(inferior_,size, Host::current());
+  return simcall_file_write(pimpl_,size, Host::current());
 }
 sg_size_t File::size() {
 }
 sg_size_t File::size() {
-  return simcall_file_get_size(inferior_);
+  return simcall_file_get_size(pimpl_);
 }
 
 void File::seek(sg_size_t pos) {
 }
 
 void File::seek(sg_size_t pos) {
-  simcall_file_seek(inferior_,pos,SEEK_SET);
+  simcall_file_seek(pimpl_,pos,SEEK_SET);
 }
 sg_size_t File::tell() {
 }
 sg_size_t File::tell() {
-  return simcall_file_tell(inferior_);
+  return simcall_file_tell(pimpl_);
 }
 void File::move(const char*fullpath) {
 }
 void File::move(const char*fullpath) {
-  simcall_file_move(inferior_,fullpath);
+  simcall_file_move(pimpl_,fullpath);
 }
 void File::unlink() {
   sg_host_t attached = Host::current(); // FIXME: we should check where this file is attached
 }
 void File::unlink() {
   sg_host_t attached = Host::current(); // FIXME: we should check where this file is attached
-  simcall_file_unlink(inferior_,attached);
+  simcall_file_unlink(pimpl_,attached);
 }
 
 }} // namespace simgrid::s4u
 }
 
 }} // namespace simgrid::s4u
index ace9d8c..e8df673 100644 (file)
@@ -19,7 +19,7 @@ boost::unordered_map <std::string, s4u::Mailbox *> *s4u::Mailbox::mailboxes = ne
 
 
 s4u::Mailbox::Mailbox(const char*name, smx_mailbox_t inferior) {
 
 
 s4u::Mailbox::Mailbox(const char*name, smx_mailbox_t inferior) {
-  inferior_ = inferior;
+  pimpl_ = inferior;
   name_ = name;
   mailboxes->insert({name, this});
 }
   name_ = name;
   mailboxes->insert({name, this});
 }
@@ -42,14 +42,14 @@ s4u::Mailbox *s4u::Mailbox::byName(const char*name) {
 }
 
 bool s4u::Mailbox::empty() {
 }
 
 bool s4u::Mailbox::empty() {
-  return nullptr == simcall_mbox_get_head(inferior_);
+  return nullptr == simcall_mbox_get_head(pimpl_);
 }
 
 void s4u::Mailbox::setReceiver(smx_process_t process) {
 }
 
 void s4u::Mailbox::setReceiver(smx_process_t process) {
-  simcall_mbox_set_receiver(inferior_, process);
+  simcall_mbox_set_receiver(pimpl_, process);
 }
 smx_process_t s4u::Mailbox::receiver() {
 }
 smx_process_t s4u::Mailbox::receiver() {
-  return simcall_mbox_get_receiver(inferior_);
+  return simcall_mbox_get_receiver(pimpl_);
 }
 
 /*------- C functions -------*/
 }
 
 /*------- C functions -------*/
index 6b99ef8..afc3401 100644 (file)
@@ -15,7 +15,7 @@ namespace s4u {
 boost::unordered_map <std::string, Storage *> *Storage::storages_ = new boost::unordered_map<std::string, Storage*> ();
 Storage::Storage(std::string name, smx_storage_t inferior) {
   name_ = name;
 boost::unordered_map <std::string, Storage *> *Storage::storages_ = new boost::unordered_map<std::string, Storage*> ();
 Storage::Storage(std::string name, smx_storage_t inferior) {
   name_ = name;
-  inferior_ = inferior;
+  pimpl_ = inferior;
 
   storages_->insert({name, this});
 }
 
   storages_->insert({name, this});
 }
@@ -25,7 +25,7 @@ Storage::~Storage() {
 }
 
 smx_storage_t Storage::inferior() {
 }
 
 smx_storage_t Storage::inferior() {
-  return inferior_;
+  return pimpl_;
 }
 Storage &Storage::byName(const char*name) {
   s4u::Storage *res = NULL;
 }
 Storage &Storage::byName(const char*name) {
   s4u::Storage *res = NULL;
@@ -46,13 +46,13 @@ const char*Storage::name() {
 }
 
 sg_size_t Storage::sizeFree() {
 }
 
 sg_size_t Storage::sizeFree() {
-  return simcall_storage_get_free_size(inferior_);
+  return simcall_storage_get_free_size(pimpl_);
 }
 sg_size_t Storage::sizeUsed() {
 }
 sg_size_t Storage::sizeUsed() {
-  return simcall_storage_get_used_size(inferior_);
+  return simcall_storage_get_used_size(pimpl_);
 }
 sg_size_t Storage::size() {
 }
 sg_size_t Storage::size() {
-  return SIMIX_storage_get_size(inferior_);
+  return SIMIX_storage_get_size(pimpl_);
 }
 
 } /* namespace s4u */
 }
 
 } /* namespace s4u */