A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git]
/
src
/
s4u
/
s4u_storage.cpp
diff --git
a/src/s4u/s4u_storage.cpp
b/src/s4u/s4u_storage.cpp
index
092afea
..
96f9733
100644
(file)
--- a/
src/s4u/s4u_storage.cpp
+++ b/
src/s4u/s4u_storage.cpp
@@
-3,13
+3,18
@@
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "
../surf/StorageImpl
.hpp"
+#include "
simgrid/s4u/File
.hpp"
#include "simgrid/s4u/Host.hpp"
#include "simgrid/s4u/Storage.hpp"
#include "simgrid/simix.hpp"
#include "simgrid/s4u/Host.hpp"
#include "simgrid/s4u/Storage.hpp"
#include "simgrid/simix.hpp"
+#include "src/surf/StorageImpl.hpp"
#include <unordered_map>
namespace simgrid {
#include <unordered_map>
namespace simgrid {
+namespace xbt {
+template class Extendable<simgrid::s4u::Storage>;
+}
+
namespace s4u {
std::map<std::string, Storage*>* allStorages()
namespace s4u {
std::map<std::string, Storage*>* allStorages()
@@
-30,9
+35,14
@@
Storage* Storage::byName(std::string name)
return &res->piface_;
}
return &res->piface_;
}
-const char* Storage::getName()
+const std::string& Storage::getName() const
+{
+ return pimpl_->getName();
+}
+
+const char* Storage::getCname() const
{
{
- return pimpl_->
c
name();
+ return pimpl_->
getC
name();
}
const char* Storage::getType()
}
const char* Storage::getType()
@@
-45,39
+55,36
@@
Host* Storage::getHost()
return attached_to_;
}
return attached_to_;
}
-sg_size_t Storage::getSizeFree()
-{
- return simgrid::simix::kernelImmediate([this] { return pimpl_->getFreeSize(); });
-}
-s
g_size_t Storage::getSizeUsed
()
+s
td::map<std::string, std::string>* Storage::getProperties
()
{
{
- return simgrid::simix::kernelImmediate([this] { return pimpl_->get
UsedSize
(); });
+ return simgrid::simix::kernelImmediate([this] { return pimpl_->get
Properties
(); });
}
}
-
sg_size_t Storage::getSize(
)
+
const char* Storage::getProperty(std::string key
)
{
{
- return
pimpl_->getSize(
);
+ return
this->pimpl_->getProperty(key
);
}
}
-
std::map<std::string, std::string>* Storage::getProperties(
)
+
void Storage::setProperty(std::string key, std::string value
)
{
{
-
return simgrid::simix::kernelImmediate([this] { return pimpl_->getProperties(
); });
+
simgrid::simix::kernelImmediate([this, key, value] { this->pimpl_->setProperty(key, value
); });
}
}
-
const char* Storage::getProperty(const char* key
)
+
std::map<std::string, sg_size_t>* Storage::getContent(
)
{
{
- return this->pimpl_->getProperty(key);
+ FileSystemStorageExt* file_system = extension<FileSystemStorageExt>();
+ return file_system->getContent();
}
}
-
void Storage::setProperty(const char* key, const char* valu
e)
+
sg_size_t Storage::read(sg_size_t siz
e)
{
{
-
simgrid::simix::kernelImmediate([this, key, value] { this->pimpl_->setProperty(key, value); }
);
+
return simcall_storage_read(pimpl_, size
);
}
}
-s
td::map<std::string, sg_size_t>* Storage::getContent(
)
+s
g_size_t Storage::write(sg_size_t size
)
{
{
- return sim
grid::simix::kernelImmediate([this] { return pimpl_->getContent(); }
);
+ return sim
call_storage_write(pimpl_, size
);
}
/*************
}
/*************