Signed-off-by: Casey Bodley <cbodley@redhat.com>
static void from_rados_ioctx_t(rados_ioctx_t p, IoCtx &pool);
IoCtx(const IoCtx& rhs);
IoCtx& operator=(const IoCtx& rhs);
+ IoCtx(IoCtx&& rhs) noexcept;
+ IoCtx& operator=(IoCtx&& rhs) noexcept;
~IoCtx();
return *this;
}
+librados::IoCtx::IoCtx(IoCtx&& rhs) noexcept
+ : io_ctx_impl(std::exchange(rhs.io_ctx_impl, nullptr))
+{
+}
+
+librados::IoCtx& librados::IoCtx::operator=(IoCtx&& rhs) noexcept
+{
+ if (io_ctx_impl)
+ io_ctx_impl->put();
+ io_ctx_impl = std::exchange(rhs.io_ctx_impl, nullptr);
+ return *this;
+}
+
librados::IoCtx::~IoCtx()
{
close();