Skip to content
Snippets Groups Projects
Verified Commit 79d7202a authored by Alberto Miranda's avatar Alberto Miranda :hotsprings:
Browse files

Add copy constructor and assignment operator for admire::adhoc_storage

parent a1b71cb2
No related branches found
No related tags found
1 merge request!37Resolve "Missing copy constructor and assignment operator in admire::adhoc_storage and admire::pfs_storage"
......@@ -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;
......
......@@ -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<impl>(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<impl>(*other.m_pimpl)) {}
adhoc_storage&
adhoc_storage::operator=(const adhoc_storage& other) noexcept {
this->m_pimpl = std::make_unique<impl>(*other.m_pimpl);
return *this;
}
std::shared_ptr<storage::ctx>
adhoc_storage::context() const {
return std::make_shared<adhoc_storage::ctx>(m_pimpl->context());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment