diff --git a/src/common/api/admire_types.hpp b/src/common/api/admire_types.hpp index 232433dc8536d424f839e9f1767f2aa61623aa37..ca712bcc0139e19ddfc1aeefeeece024fa378ffb 100644 --- a/src/common/api/admire_types.hpp +++ b/src/common/api/admire_types.hpp @@ -176,8 +176,11 @@ struct adhoc_storage : public storage { bool should_flush); adhoc_storage(enum storage::type type, std::string id, ADM_adhoc_context_t ctx); + adhoc_storage(const adhoc_storage& other) noexcept; adhoc_storage(adhoc_storage&&) noexcept = default; adhoc_storage& + operator=(const adhoc_storage&) noexcept; + adhoc_storage& operator=(adhoc_storage&&) noexcept = default; ~adhoc_storage() override; @@ -207,8 +210,11 @@ struct pfs_storage : public storage { pfs_storage(enum storage::type type, std::string id, std::filesystem::path mount_point); pfs_storage(enum storage::type type, std::string id, ADM_pfs_context_t ctx); + pfs_storage(const pfs_storage& other) noexcept; pfs_storage(pfs_storage&&) noexcept = default; pfs_storage& + operator=(const pfs_storage& other) noexcept; + pfs_storage& operator=(pfs_storage&&) noexcept = default; ~pfs_storage() override; diff --git a/src/common/api/types.cpp b/src/common/api/types.cpp index 17ea8d468a12cc4a909276949c3178db7c2e0203..c4178299d2958650ce2663492173249928c141c1 100644 --- a/src/common/api/types.cpp +++ b/src/common/api/types.cpp @@ -924,6 +924,16 @@ adhoc_storage::adhoc_storage(enum storage::type type, std::string id, : storage(type, std::move(id)), m_pimpl(std::make_unique(adhoc_storage::ctx{ctx})) {} +adhoc_storage::adhoc_storage(const adhoc_storage& other) noexcept + : storage(other.m_type, other.m_id), + m_pimpl(std::make_unique(*other.m_pimpl)) {} + +adhoc_storage& +adhoc_storage::operator=(const adhoc_storage& other) noexcept { + this->m_pimpl = std::make_unique(*other.m_pimpl); + return *this; +} + std::shared_ptr adhoc_storage::context() const { return std::make_shared(m_pimpl->context()); @@ -936,6 +946,16 @@ pfs_storage::ctx::ctx(std::filesystem::path mount_point) pfs_storage::ctx::ctx(ADM_pfs_context_t ctx) : pfs_storage::ctx(ctx->c_mount) {} +pfs_storage::pfs_storage(const pfs_storage& other) noexcept + : storage(other.m_type, other.m_id), + m_pimpl(std::make_unique(*other.m_pimpl)) {} + +pfs_storage& +pfs_storage::operator=(const pfs_storage& other) noexcept { + this->m_pimpl = std::make_unique(*other.m_pimpl); + return *this; +} + std::filesystem::path pfs_storage::ctx::mount_point() const { return m_mount_point;