@@ -133,7 +133,8 @@ void capiocl::Engine::add(std::string &path, std::vector<std::string> &producers
133133 const std::string &fire_rule, bool permanent, bool exclude,
134134 const std::vector<std::string> &dependencies) {
135135 _locations.emplace (path, std::make_tuple (producers, consumers, commit_rule, fire_rule,
136- permanent, exclude, true , 0 , 0 , dependencies, false ));
136+ permanent, exclude, true , 0 , 0 , dependencies,
137+ false | this ->store_all_in_memory ));
137138}
138139
139140void capiocl::Engine::newFile (const std::string &path) {
@@ -444,6 +445,7 @@ void capiocl::Engine::setStoreFileInMemory(const std::filesystem::path &path) {
444445}
445446
446447void capiocl::Engine::setAllStoreInMemory () {
448+ this ->store_all_in_memory = true ;
447449 for (const auto &[fst, snd] : _locations) {
448450 this ->setStoreFileInMemory (fst);
449451 }
@@ -459,9 +461,15 @@ void capiocl::Engine::setStoreFileInFileSystem(const std::filesystem::path &path
459461}
460462
461463bool capiocl::Engine::isStoredInMemory (const std::filesystem::path &path) {
464+
465+ if (this ->store_all_in_memory ) {
466+ return true ;
467+ }
468+
462469 if (const auto itm = _locations.find (path); itm != _locations.end ()) {
463470 return std::get<10 >(itm->second );
464471 }
472+
465473 this ->newFile (path);
466474 return isStoredInMemory (path);
467475}
@@ -470,7 +478,7 @@ std::vector<std::string> capiocl::Engine::getFileToStoreInMemory() {
470478 std::vector<std::string> files;
471479
472480 for (const auto &[path, file] : _locations) {
473- if (std::get<10 >(file)) {
481+ if (std::get<10 >(file) || this -> store_all_in_memory ) {
474482 files.push_back (path);
475483 }
476484 }
0 commit comments