Loading src/posix_file/posix_file/file.hpp +4 −4 Original line number Diff line number Diff line Loading @@ -155,7 +155,7 @@ class file { public: file(cargo::FSPlugin::type t) { explicit file(cargo::FSPlugin::type t) { m_fs_plugin = cargo::FSPlugin::make_fs(t); }; Loading src/posix_file/posix_file/fs_plugin/fs_plugin.cpp +11 −3 Original line number Diff line number Diff line Loading @@ -12,16 +12,24 @@ namespace cargo { std::unique_ptr<FSPlugin> static std::shared_ptr<FSPlugin> m_fs_posix; static std::shared_ptr<FSPlugin> m_fs_gekkofs; std::shared_ptr<FSPlugin> FSPlugin::make_fs(type t) { switch(t) { case type::posix: case type::parallel: return std::make_unique<cargo::posix_plugin>(); if(m_fs_posix == nullptr) m_fs_posix = std::make_shared<cargo::posix_plugin>(); return m_fs_posix; #ifdef GEKKOFS_PLUGIN case type::gekkofs: return std::make_unique<cargo::gekko_plugin>(); if(m_fs_gekkofs == nullptr) m_fs_gekkofs = std::make_shared<cargo::gekko_plugin>(); return m_fs_gekkofs; #endif #ifdef HERCULES_PLUGIN case type::hercules: Loading src/posix_file/posix_file/fs_plugin/fs_plugin.hpp +3 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,9 @@ public: expand, dataclay }; static std::unique_ptr<FSPlugin> make_fs(type); static std::shared_ptr<FSPlugin> make_fs(type); // One instance per fs type virtual ~FSPlugin() = default; Loading src/posix_file/posix_file/fs_plugin/gekko_plugin.cpp +2 −6 Original line number Diff line number Diff line Loading @@ -9,18 +9,14 @@ gekko_plugin::gekko_plugin() { int result = gkfs_init(); if(result != 0) { std::cerr << "Failed to initialize gekkofs" << std::endl; } else { std::cout << "Initialized gekkofs" << std::endl; } } gekko_plugin::~gekko_plugin() { /*int result = gkfs_end(); int result = gkfs_end(); if(result != 0) { std::cerr << "Failed to finalize gekkofs" << std::endl; } else { std::cout << "Finalized gekkofs" << std::endl; }*/ } } // Override the open function int Loading Loading
src/posix_file/posix_file/file.hpp +4 −4 Original line number Diff line number Diff line Loading @@ -155,7 +155,7 @@ class file { public: file(cargo::FSPlugin::type t) { explicit file(cargo::FSPlugin::type t) { m_fs_plugin = cargo::FSPlugin::make_fs(t); }; Loading
src/posix_file/posix_file/fs_plugin/fs_plugin.cpp +11 −3 Original line number Diff line number Diff line Loading @@ -12,16 +12,24 @@ namespace cargo { std::unique_ptr<FSPlugin> static std::shared_ptr<FSPlugin> m_fs_posix; static std::shared_ptr<FSPlugin> m_fs_gekkofs; std::shared_ptr<FSPlugin> FSPlugin::make_fs(type t) { switch(t) { case type::posix: case type::parallel: return std::make_unique<cargo::posix_plugin>(); if(m_fs_posix == nullptr) m_fs_posix = std::make_shared<cargo::posix_plugin>(); return m_fs_posix; #ifdef GEKKOFS_PLUGIN case type::gekkofs: return std::make_unique<cargo::gekko_plugin>(); if(m_fs_gekkofs == nullptr) m_fs_gekkofs = std::make_shared<cargo::gekko_plugin>(); return m_fs_gekkofs; #endif #ifdef HERCULES_PLUGIN case type::hercules: Loading
src/posix_file/posix_file/fs_plugin/fs_plugin.hpp +3 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,9 @@ public: expand, dataclay }; static std::unique_ptr<FSPlugin> make_fs(type); static std::shared_ptr<FSPlugin> make_fs(type); // One instance per fs type virtual ~FSPlugin() = default; Loading
src/posix_file/posix_file/fs_plugin/gekko_plugin.cpp +2 −6 Original line number Diff line number Diff line Loading @@ -9,18 +9,14 @@ gekko_plugin::gekko_plugin() { int result = gkfs_init(); if(result != 0) { std::cerr << "Failed to initialize gekkofs" << std::endl; } else { std::cout << "Initialized gekkofs" << std::endl; } } gekko_plugin::~gekko_plugin() { /*int result = gkfs_end(); int result = gkfs_end(); if(result != 0) { std::cerr << "Failed to finalize gekkofs" << std::endl; } else { std::cout << "Finalized gekkofs" << std::endl; }*/ } } // Override the open function int Loading