Verified Commit fa579d8b authored by Alberto Miranda's avatar Alberto Miranda ♨️
Browse files

Add copy constructor and assignment operator for admire::pfs_storage

parent 79d7202a
Loading
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -210,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;

+10 −0
Original line number Diff line number Diff line
@@ -946,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<impl>(*other.m_pimpl)) {}

pfs_storage&
pfs_storage::operator=(const pfs_storage& other) noexcept {
    this->m_pimpl = std::make_unique<impl>(*other.m_pimpl);
    return *this;
}

std::filesystem::path
pfs_storage::ctx::mount_point() const {
    return m_mount_point;