From: Martin Quinson Date: Mon, 9 May 2016 15:32:31 +0000 (+0200) Subject: s4u: rename the private implementations as such X-Git-Tag: v3_14~1255 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/df9acac8643a570b52133a3011781adb0875519a s4u: rename the private implementations as such --- diff --git a/include/simgrid/s4u/actor.hpp b/include/simgrid/s4u/actor.hpp index 8c6e1fc723..24790755b2 100644 --- a/include/simgrid/s4u/actor.hpp +++ b/include/simgrid/s4u/actor.hpp @@ -95,9 +95,9 @@ public: void send(Mailbox &chan, void*payload, size_t simulatedSize); protected: - smx_process_t getInferior() {return inferior_;} + smx_process_t getInferior() {return pimpl_;} private: - smx_process_t inferior_; + smx_process_t pimpl_; }; }} // namespace simgrid::s4u diff --git a/include/simgrid/s4u/async.hpp b/include/simgrid/s4u/async.hpp index 9ef1778171..2f12e795ee 100644 --- a/include/simgrid/s4u/async.hpp +++ b/include/simgrid/s4u/async.hpp @@ -34,7 +34,7 @@ protected: virtual ~Async(); private: - simgrid::simix::Synchro *inferior_ = NULL; + simgrid::simix::Synchro *pimpl_ = NULL; private: e_s4u_async_state_t state_ = inited; diff --git a/include/simgrid/s4u/file.hpp b/include/simgrid/s4u/file.hpp index 63c3563bbc..0e976337eb 100644 --- a/include/simgrid/s4u/file.hpp +++ b/include/simgrid/s4u/file.hpp @@ -29,7 +29,7 @@ public: File(const char *fullpath, void* userdata); ~File(); private: - smx_file_t inferior_; + smx_file_t pimpl_; const char *path_; public: diff --git a/include/simgrid/s4u/mailbox.hpp b/include/simgrid/s4u/mailbox.hpp index aa5f3278de..3d1b6abd2e 100644 --- a/include/simgrid/s4u/mailbox.hpp +++ b/include/simgrid/s4u/mailbox.hpp @@ -33,7 +33,7 @@ public: ~Mailbox(); protected: - smx_mailbox_t getInferior() { return inferior_; } + smx_mailbox_t getInferior() { return pimpl_; } public: /** Get the name of that mailbox */ @@ -54,7 +54,7 @@ public: private: std::string name_; - smx_mailbox_t inferior_; + smx_mailbox_t pimpl_; static boost::unordered_map *mailboxes; friend s4u::Engine; }; diff --git a/include/simgrid/s4u/storage.hpp b/include/simgrid/s4u/storage.hpp index e67a1a9093..3d9dd19da2 100644 --- a/include/simgrid/s4u/storage.hpp +++ b/include/simgrid/s4u/storage.hpp @@ -44,7 +44,7 @@ private: static boost::unordered_map *storages_; std::string name_; - smx_storage_t inferior_; + smx_storage_t pimpl_; public: diff --git a/src/s4u/s4u_actor.cpp b/src/s4u/s4u_actor.cpp index b29b9ee30b..04962097b5 100644 --- a/src/s4u/s4u_actor.cpp +++ b/src/s4u/s4u_actor.cpp @@ -27,15 +27,15 @@ static int s4u_actor_runner(int argc, char **argv) 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) { - 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); } @@ -54,30 +54,30 @@ s4u::Actor &s4u::Actor::self() } 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() { - 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() { - return simcall_process_get_name(inferior_); + return simcall_process_get_name(pimpl_); } int s4u::Actor::getPid(){ - return simcall_process_get_PID(inferior_); + return simcall_process_get_PID(pimpl_); } void s4u::Actor::setKillTime(double time) { - simcall_process_set_kill_time(inferior_,time); + simcall_process_set_kill_time(pimpl_,time); } 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() { - simcall_process_kill(inferior_); + simcall_process_kill(pimpl_); } void s4u::Actor::sleep(double duration) { diff --git a/src/s4u/s4u_comm.cpp b/src/s4u/s4u_comm.cpp index e19a0529fb..1415742844 100644 --- a/src/s4u/s4u_comm.cpp +++ b/src/s4u/s4u_comm.cpp @@ -73,12 +73,12 @@ void s4u::Comm::start() { 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 - inferior_ = simcall_comm_irecv(receiver_->getInferior(), mailbox_->getInferior(), dstBuff_, &dstBuffSize_, + pimpl_ = simcall_comm_irecv(receiver_->getInferior(), mailbox_->getInferior(), dstBuff_, &dstBuffSize_, matchFunction_, copyDataFunction_, userData_, rate_); @@ -91,7 +91,7 @@ void s4u::Comm::wait() { 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_, @@ -110,7 +110,7 @@ void s4u::Comm::wait(double timeout) { xbt_assert(state_ == started || state_ == inited); if (state_ == started) { - simcall_comm_wait(inferior_, timeout); + simcall_comm_wait(pimpl_, timeout); state_ = finished; return; } diff --git a/src/s4u/s4u_file.cpp b/src/s4u/s4u_file.cpp index 65c4557019..2f61275aa3 100644 --- a/src/s4u/s4u_file.cpp +++ b/src/s4u/s4u_file.cpp @@ -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 - inferior_ = simcall_file_open(fullpath, Host::current()); + pimpl_ = simcall_file_open(fullpath, Host::current()); 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) { - 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) { - return simcall_file_write(inferior_,size, Host::current()); + return simcall_file_write(pimpl_,size, Host::current()); } sg_size_t File::size() { - return simcall_file_get_size(inferior_); + return simcall_file_get_size(pimpl_); } 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() { - return simcall_file_tell(inferior_); + return simcall_file_tell(pimpl_); } 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 - simcall_file_unlink(inferior_,attached); + simcall_file_unlink(pimpl_,attached); } }} // namespace simgrid::s4u diff --git a/src/s4u/s4u_mailbox.cpp b/src/s4u/s4u_mailbox.cpp index ace9d8cf2c..e8df673c95 100644 --- a/src/s4u/s4u_mailbox.cpp +++ b/src/s4u/s4u_mailbox.cpp @@ -19,7 +19,7 @@ boost::unordered_map *s4u::Mailbox::mailboxes = ne s4u::Mailbox::Mailbox(const char*name, smx_mailbox_t inferior) { - inferior_ = inferior; + pimpl_ = inferior; name_ = name; mailboxes->insert({name, this}); } @@ -42,14 +42,14 @@ s4u::Mailbox *s4u::Mailbox::byName(const char*name) { } 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) { - simcall_mbox_set_receiver(inferior_, process); + simcall_mbox_set_receiver(pimpl_, process); } smx_process_t s4u::Mailbox::receiver() { - return simcall_mbox_get_receiver(inferior_); + return simcall_mbox_get_receiver(pimpl_); } /*------- C functions -------*/ diff --git a/src/s4u/s4u_storage.cpp b/src/s4u/s4u_storage.cpp index 6b99ef8bde..afc3401bcc 100644 --- a/src/s4u/s4u_storage.cpp +++ b/src/s4u/s4u_storage.cpp @@ -15,7 +15,7 @@ namespace s4u { boost::unordered_map *Storage::storages_ = new boost::unordered_map (); Storage::Storage(std::string name, smx_storage_t inferior) { name_ = name; - inferior_ = inferior; + pimpl_ = inferior; storages_->insert({name, this}); } @@ -25,7 +25,7 @@ Storage::~Storage() { } smx_storage_t Storage::inferior() { - return inferior_; + return pimpl_; } Storage &Storage::byName(const char*name) { s4u::Storage *res = NULL; @@ -46,13 +46,13 @@ const char*Storage::name() { } sg_size_t Storage::sizeFree() { - return simcall_storage_get_free_size(inferior_); + return simcall_storage_get_free_size(pimpl_); } sg_size_t Storage::sizeUsed() { - return simcall_storage_get_used_size(inferior_); + return simcall_storage_get_used_size(pimpl_); } sg_size_t Storage::size() { - return SIMIX_storage_get_size(inferior_); + return SIMIX_storage_get_size(pimpl_); } } /* namespace s4u */