From ac0bf6a9396efa37d528695f248e568ab5a2eb98 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Sat, 14 Oct 2017 15:48:27 +0200 Subject: [PATCH] Change name()/cname() to getName()/getCname() in surf::FileImpl. --- src/surf/FileImpl.cpp | 8 ++++---- src/surf/FileImpl.hpp | 4 ++-- src/surf/storage_n11.cpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/surf/FileImpl.cpp b/src/surf/FileImpl.cpp index 6497944880..d190065cb0 100644 --- a/src/surf/FileImpl.cpp +++ b/src/surf/FileImpl.cpp @@ -29,7 +29,7 @@ FileImpl::FileImpl(sg_storage_t st, std::string path, std::string mount) : path_ Action* FileImpl::read(sg_size_t size) { - XBT_DEBUG("READ %s on disk '%s'", cname(), location_->getCname()); + XBT_DEBUG("READ %s on disk '%s'", getCname(), location_->getCname()); if (current_position_ + size > size_) { if (current_position_ > size_) { size = 0; @@ -45,7 +45,7 @@ Action* FileImpl::read(sg_size_t size) Action* FileImpl::write(sg_size_t size) { - XBT_DEBUG("WRITE %s on disk '%s'. size '%llu/%llu'", cname(), location_->getCname(), size, size_); + XBT_DEBUG("WRITE %s on disk '%s'. size '%llu/%llu'", getCname(), location_->getCname(), size, size_); StorageAction* action = location_->write(size); action->file_ = this; @@ -79,10 +79,10 @@ int FileImpl::unlink() { /* Check if the file is on this storage */ if (location_->getContent()->find(path_) == location_->getContent()->end()) { - XBT_WARN("File %s is not on disk %s. Impossible to unlink", cname(), location_->getCname()); + XBT_WARN("File %s is not on disk %s. Impossible to unlink", getCname(), location_->getCname()); return -1; } else { - XBT_DEBUG("UNLINK %s on disk '%s'", cname(), location_->getCname()); + XBT_DEBUG("UNLINK %s on disk '%s'", getCname(), location_->getCname()); location_->usedSize_ -= size_; // Remove the file from storage diff --git a/src/surf/FileImpl.hpp b/src/surf/FileImpl.hpp index 6b2f9cce25..94337fed3a 100644 --- a/src/surf/FileImpl.hpp +++ b/src/surf/FileImpl.hpp @@ -18,8 +18,8 @@ public: FileImpl(sg_storage_t st, std::string path, std::string mount); ~FileImpl() = default; - std::string name() { return path_; } - const char* cname() { return path_.c_str(); } + const std::string& getName() const { return path_; } + const char* getCname() const { return path_.c_str(); } const char* mount() { return mount_point_.c_str(); } sg_size_t size() { return size_; } void setSize(sg_size_t size) { size_ = size; } diff --git a/src/surf/storage_n11.cpp b/src/surf/storage_n11.cpp index d61b538940..e25812ce16 100644 --- a/src/surf/storage_n11.cpp +++ b/src/surf/storage_n11.cpp @@ -89,8 +89,8 @@ void StorageN11Model::updateActionsState(double /*now*/, double delta) action->file_->incrPosition(current_progress); action->file_->setSize(action->file_->tell()); - action->storage_->getContent()->erase(action->file_->cname()); - action->storage_->getContent()->insert({action->file_->cname(), action->file_->size()}); + action->storage_->getContent()->erase(action->file_->getCname()); + action->storage_->getContent()->insert({action->file_->getCname(), action->file_->size()}); } if (action->getMaxDuration() > NO_MAX_DURATION) -- 2.20.1