accomodate os changes

This commit is contained in:
Green Sky 2025-05-06 00:22:31 +02:00
parent 8603a22cbb
commit c8507c3054
No known key found for this signature in database
GPG Key ID: DBE05085D874AB4A
2 changed files with 10 additions and 10 deletions

View File

@ -3,7 +3,7 @@
#include <solanaceae/contact/contact_store_i.hpp> #include <solanaceae/contact/contact_store_i.hpp>
#include <solanaceae/message3/message_serializer.hpp> #include <solanaceae/message3/message_serializer.hpp>
#include <solanaceae/object_store/backends/filesystem_storage.hpp> #include <solanaceae/object_store/backends/filesystem_storage_atomic.hpp>
#include <solanaceae/message_fragment_store/message_fragment_store.hpp> #include <solanaceae/message_fragment_store/message_fragment_store.hpp>
#include <entt/entt.hpp> #include <entt/entt.hpp>
@ -13,7 +13,7 @@
#include <limits> #include <limits>
#include <iostream> #include <iostream>
static std::unique_ptr<Backends::FilesystemStorage> g_fsb = nullptr; static std::unique_ptr<Backends::FilesystemStorageAtomic> g_fsb = nullptr;
static std::unique_ptr<MessageFragmentStore> g_mfs = nullptr; static std::unique_ptr<MessageFragmentStore> g_mfs = nullptr;
constexpr const char* plugin_name = "MessageFragmentStore"; constexpr const char* plugin_name = "MessageFragmentStore";
@ -43,7 +43,7 @@ SOLANA_PLUGIN_EXPORT uint32_t solana_plugin_start(struct SolanaAPI* solana_api)
// static store, could be anywhere tho // static store, could be anywhere tho
// construct with fetched dependencies // construct with fetched dependencies
g_fsb = std::make_unique<Backends::FilesystemStorage>(*os, "test2_message_store/"); // TODO: use config? g_fsb = std::make_unique<Backends::FilesystemStorageAtomic>(*os, "test2_message_store/"); // TODO: use config?
g_mfs = std::make_unique<MessageFragmentStore>(*cs, *rmm, *os, *g_fsb, *g_fsb, *msnj); g_mfs = std::make_unique<MessageFragmentStore>(*cs, *rmm, *os, *g_fsb, *g_fsb, *msnj);
// register types // register types

View File

@ -1,6 +1,6 @@
#include <solanaceae/contact/contact_store_impl.hpp> #include <solanaceae/contact/contact_store_impl.hpp>
#include <solanaceae/object_store/object_store.hpp> #include <solanaceae/object_store/object_store.hpp>
#include <solanaceae/object_store/backends/filesystem_storage.hpp> #include <solanaceae/object_store/backends/filesystem_storage_atomic.hpp>
#include <solanaceae/object_store/meta_components.hpp> #include <solanaceae/object_store/meta_components.hpp>
#include <solanaceae/object_store/serializer_json.hpp> #include <solanaceae/object_store/serializer_json.hpp>
#include <solanaceae/message_fragment_store/message_fragment_store.hpp> #include <solanaceae/message_fragment_store/message_fragment_store.hpp>
@ -33,8 +33,8 @@ int main(int argc, const char** argv) {
ObjectStore2 os_src; ObjectStore2 os_src;
ObjectStore2 os_dst; ObjectStore2 os_dst;
Backends::FilesystemStorage fsb_src(os_src, argv[1]); Backends::FilesystemStorageAtomic fsb_src(os_src, argv[1]);
Backends::FilesystemStorage fsb_dst(os_dst, argv[2]); Backends::FilesystemStorageAtomic fsb_dst(os_dst, argv[2]);
ContactStore4Impl cs; // dummy ContactStore4Impl cs; // dummy
RegistryMessageModelImpl rmm(cs); // dummy RegistryMessageModelImpl rmm(cs); // dummy
@ -50,16 +50,16 @@ int main(int argc, const char** argv) {
// hookup events // hookup events
struct EventListener : public ObjectStoreEventI { struct EventListener : public ObjectStoreEventI {
ObjectStore2& _os_src; ObjectStore2& _os_src;
Backends::FilesystemStorage& _fsb_src; Backends::FilesystemStorageAtomic& _fsb_src;
ObjectStore2& _os_dst; ObjectStore2& _os_dst;
Backends::FilesystemStorage& _fsb_dst; Backends::FilesystemStorageAtomic& _fsb_dst;
EventListener( EventListener(
ObjectStore2& os_src, ObjectStore2& os_src,
Backends::FilesystemStorage& fsb_src, Backends::FilesystemStorageAtomic& fsb_src,
ObjectStore2& os_dst, ObjectStore2& os_dst,
Backends::FilesystemStorage& fsb_dst Backends::FilesystemStorageAtomic& fsb_dst
) : ) :
_os_src(os_src), _os_src(os_src),
_fsb_src(fsb_src), _fsb_src(fsb_src),