#include "objclass/objclass.h"
#include "osd/osd_types.h"
#include <arpa/inet.h>
-#include <boost/bind.hpp>
#include <boost/shared_ptr.hpp>
#include <deque>
+#include <functional>
#include <list>
#include <vector>
#include "include/ceph_assert.h"
return client->wait_for_latest_osdmap();
}
+using namespace std::placeholders;
+
namespace librados {
AioCompletion::~AioCompletion()
int IoCtx::create(const std::string& oid, bool exclusive) {
TestIoCtxImpl *ctx = reinterpret_cast<TestIoCtxImpl*>(io_ctx_impl);
return ctx->execute_operation(
- oid, boost::bind(&TestIoCtxImpl::create, _1, _2, exclusive,
+ oid, std::bind(&TestIoCtxImpl::create, _1, _2, exclusive,
ctx->get_snap_context()));
}
bufferlist& inbl, bufferlist& outbl) {
TestIoCtxImpl *ctx = reinterpret_cast<TestIoCtxImpl*>(io_ctx_impl);
return ctx->execute_operation(
- oid, boost::bind(&TestIoCtxImpl::exec, _1, _2,
+ oid, std::bind(&TestIoCtxImpl::exec, _1, _2,
librados_test_stub::get_class_handler(), cls,
method, inbl, &outbl, ctx->get_snap_read(),
ctx->get_snap_context()));
int IoCtx::list_snaps(const std::string& o, snap_set_t *out_snaps) {
TestIoCtxImpl *ctx = reinterpret_cast<TestIoCtxImpl*>(io_ctx_impl);
return ctx->execute_operation(
- o, boost::bind(&TestIoCtxImpl::list_snaps, _1, _2, out_snaps));
+ o, std::bind(&TestIoCtxImpl::list_snaps, _1, _2, out_snaps));
}
int IoCtx::list_watchers(const std::string& o,
std::list<obj_watch_t> *out_watchers) {
TestIoCtxImpl *ctx = reinterpret_cast<TestIoCtxImpl*>(io_ctx_impl);
return ctx->execute_operation(
- o, boost::bind(&TestIoCtxImpl::list_watchers, _1, _2, out_watchers));
+ o, std::bind(&TestIoCtxImpl::list_watchers, _1, _2, out_watchers));
}
int IoCtx::notify(const std::string& o, uint64_t ver, bufferlist& bl) {
std::map<std::string, bufferlist> *out_vals) {
TestIoCtxImpl *ctx = reinterpret_cast<TestIoCtxImpl*>(io_ctx_impl);
return ctx->execute_operation(
- oid, boost::bind(&TestIoCtxImpl::omap_get_vals, _1, _2, start_after, "",
+ oid, std::bind(&TestIoCtxImpl::omap_get_vals, _1, _2, start_after, "",
max_return, out_vals));
}
uint64_t off) {
TestIoCtxImpl *ctx = reinterpret_cast<TestIoCtxImpl*>(io_ctx_impl);
return ctx->execute_operation(
- oid, boost::bind(&TestIoCtxImpl::read, _1, _2, len, off, &bl,
+ oid, std::bind(&TestIoCtxImpl::read, _1, _2, len, off, &bl,
ctx->get_snap_read()));
}
int IoCtx::remove(const std::string& oid) {
TestIoCtxImpl *ctx = reinterpret_cast<TestIoCtxImpl*>(io_ctx_impl);
return ctx->execute_operation(
- oid, boost::bind(&TestIoCtxImpl::remove, _1, _2, ctx->get_snap_context()));
+ oid, std::bind(&TestIoCtxImpl::remove, _1, _2, ctx->get_snap_context()));
}
int IoCtx::selfmanaged_snap_create(uint64_t *snapid) {
bufferlist& bl, size_t len, uint64_t off) {
TestIoCtxImpl *ctx = reinterpret_cast<TestIoCtxImpl*>(io_ctx_impl);
return ctx->execute_operation(
- oid, boost::bind(&TestIoCtxImpl::sparse_read, _1, _2, off, len, &m, &bl,
+ oid, std::bind(&TestIoCtxImpl::sparse_read, _1, _2, off, len, &m, &bl,
ctx->get_snap_read()));
}
int IoCtx::stat(const std::string& oid, uint64_t *psize, time_t *pmtime) {
TestIoCtxImpl *ctx = reinterpret_cast<TestIoCtxImpl*>(io_ctx_impl);
return ctx->execute_operation(
- oid, boost::bind(&TestIoCtxImpl::stat, _1, _2, psize, pmtime));
+ oid, std::bind(&TestIoCtxImpl::stat, _1, _2, psize, pmtime));
}
int IoCtx::tmap_update(const std::string& oid, bufferlist& cmdbl) {
TestIoCtxImpl *ctx = reinterpret_cast<TestIoCtxImpl*>(io_ctx_impl);
return ctx->execute_operation(
- oid, boost::bind(&TestIoCtxImpl::tmap_update, _1, _2, cmdbl));
+ oid, std::bind(&TestIoCtxImpl::tmap_update, _1, _2, cmdbl));
}
int IoCtx::trunc(const std::string& oid, uint64_t off) {
TestIoCtxImpl *ctx = reinterpret_cast<TestIoCtxImpl*>(io_ctx_impl);
return ctx->execute_operation(
- oid, boost::bind(&TestIoCtxImpl::truncate, _1, _2, off,
+ oid, std::bind(&TestIoCtxImpl::truncate, _1, _2, off,
ctx->get_snap_context()));
}
uint64_t off) {
TestIoCtxImpl *ctx = reinterpret_cast<TestIoCtxImpl*>(io_ctx_impl);
return ctx->execute_operation(
- oid, boost::bind(&TestIoCtxImpl::write, _1, _2, bl, len, off,
+ oid, std::bind(&TestIoCtxImpl::write, _1, _2, bl, len, off,
ctx->get_snap_context()));
}
int IoCtx::write_full(const std::string& oid, bufferlist& bl) {
TestIoCtxImpl *ctx = reinterpret_cast<TestIoCtxImpl*>(io_ctx_impl);
return ctx->execute_operation(
- oid, boost::bind(&TestIoCtxImpl::write_full, _1, _2, bl,
+ oid, std::bind(&TestIoCtxImpl::write_full, _1, _2, bl,
ctx->get_snap_context()));
}
uint64_t off) {
TestIoCtxImpl *ctx = reinterpret_cast<TestIoCtxImpl*>(io_ctx_impl);
return ctx->execute_operation(
- oid, boost::bind(&TestIoCtxImpl::writesame, _1, _2, bl, len, off,
+ oid, std::bind(&TestIoCtxImpl::writesame, _1, _2, bl, len, off,
ctx->get_snap_context()));
}
int IoCtx::cmpext(const std::string& oid, uint64_t off, bufferlist& cmp_bl) {
TestIoCtxImpl *ctx = reinterpret_cast<TestIoCtxImpl*>(io_ctx_impl);
return ctx->execute_operation(
- oid, boost::bind(&TestIoCtxImpl::cmpext, _1, _2, off, cmp_bl,
+ oid, std::bind(&TestIoCtxImpl::cmpext, _1, _2, off, cmp_bl,
ctx->get_snap_read()));
}
void ObjectOperation::assert_exists() {
TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(impl);
- o->ops.push_back(boost::bind(&TestIoCtxImpl::assert_exists, _1, _2, _4));
+ o->ops.push_back(std::bind(&TestIoCtxImpl::assert_exists, _1, _2, _4));
}
void ObjectOperation::exec(const char *cls, const char *method,
bufferlist& inbl) {
TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(impl);
- o->ops.push_back(boost::bind(&TestIoCtxImpl::exec, _1, _2,
+ o->ops.push_back(std::bind(&TestIoCtxImpl::exec, _1, _2,
librados_test_stub::get_class_handler(), cls,
method, inbl, _3, _4, _5));
}
void ObjectOperation::cmpext(uint64_t off, const bufferlist& cmp_bl,
int *prval) {
TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(impl);
- ObjectOperationTestImpl op = boost::bind(&TestIoCtxImpl::cmpext, _1, _2, off,
+ ObjectOperationTestImpl op = std::bind(&TestIoCtxImpl::cmpext, _1, _2, off,
cmp_bl, _4);
if (prval != NULL) {
- op = boost::bind(save_operation_result,
- boost::bind(op, _1, _2, _3, _4, _5), prval);
+ op = std::bind(save_operation_result,
+ std::bind(op, _1, _2, _3, _4, _5), prval);
}
o->ops.push_back(op);
}
void ObjectReadOperation::list_snaps(snap_set_t *out_snaps, int *prval) {
TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(impl);
- ObjectOperationTestImpl op = boost::bind(&TestIoCtxImpl::list_snaps, _1, _2,
+ ObjectOperationTestImpl op = std::bind(&TestIoCtxImpl::list_snaps, _1, _2,
out_snaps);
if (prval != NULL) {
- op = boost::bind(save_operation_result,
- boost::bind(op, _1, _2, _3, _4, _5), prval);
+ op = std::bind(save_operation_result,
+ std::bind(op, _1, _2, _3, _4, _5), prval);
}
o->ops.push_back(op);
}
int *prval) {
TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(impl);
- ObjectOperationTestImpl op = boost::bind(&TestIoCtxImpl::list_watchers, _1,
+ ObjectOperationTestImpl op = std::bind(&TestIoCtxImpl::list_watchers, _1,
_2, out_watchers);
if (prval != NULL) {
- op = boost::bind(save_operation_result,
- boost::bind(op, _1, _2, _3, _4, _5), prval);
+ op = std::bind(save_operation_result,
+ std::bind(op, _1, _2, _3, _4, _5), prval);
}
o->ops.push_back(op);
}
ObjectOperationTestImpl op;
if (pbl != NULL) {
- op = boost::bind(&TestIoCtxImpl::read, _1, _2, len, off, pbl, _4);
+ op = std::bind(&TestIoCtxImpl::read, _1, _2, len, off, pbl, _4);
} else {
- op = boost::bind(&TestIoCtxImpl::read, _1, _2, len, off, _3, _4);
+ op = std::bind(&TestIoCtxImpl::read, _1, _2, len, off, _3, _4);
}
if (prval != NULL) {
- op = boost::bind(save_operation_result,
- boost::bind(op, _1, _2, _3, _4, _5), prval);
+ op = std::bind(save_operation_result,
+ std::bind(op, _1, _2, _3, _4, _5), prval);
}
o->ops.push_back(op);
}
ObjectOperationTestImpl op;
if (pbl != NULL) {
- op = boost::bind(&TestIoCtxImpl::sparse_read, _1, _2, off, len, m, pbl, _4);
+ op = std::bind(&TestIoCtxImpl::sparse_read, _1, _2, off, len, m, pbl, _4);
} else {
- op = boost::bind(&TestIoCtxImpl::sparse_read, _1, _2, off, len, m, _3, _4);
+ op = std::bind(&TestIoCtxImpl::sparse_read, _1, _2, off, len, m, _3, _4);
}
if (prval != NULL) {
- op = boost::bind(save_operation_result,
- boost::bind(op, _1, _2, _3, _4, _5), prval);
+ op = std::bind(save_operation_result,
+ std::bind(op, _1, _2, _3, _4, _5), prval);
}
o->ops.push_back(op);
}
void ObjectReadOperation::stat(uint64_t *psize, time_t *pmtime, int *prval) {
TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(impl);
- ObjectOperationTestImpl op = boost::bind(&TestIoCtxImpl::stat, _1, _2,
+ ObjectOperationTestImpl op = std::bind(&TestIoCtxImpl::stat, _1, _2,
psize, pmtime);
if (prval != NULL) {
- op = boost::bind(save_operation_result,
- boost::bind(op, _1, _2, _3, _4, _5), prval);
+ op = std::bind(save_operation_result,
+ std::bind(op, _1, _2, _3, _4, _5), prval);
}
o->ops.push_back(op);
}
void ObjectWriteOperation::append(const bufferlist &bl) {
TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(impl);
- o->ops.push_back(boost::bind(&TestIoCtxImpl::append, _1, _2, bl, _5));
+ o->ops.push_back(std::bind(&TestIoCtxImpl::append, _1, _2, bl, _5));
}
void ObjectWriteOperation::create(bool exclusive) {
TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(impl);
- o->ops.push_back(boost::bind(&TestIoCtxImpl::create, _1, _2, exclusive, _5));
+ o->ops.push_back(std::bind(&TestIoCtxImpl::create, _1, _2, exclusive, _5));
}
void ObjectWriteOperation::omap_set(const std::map<std::string, bufferlist> &map) {
TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(impl);
- o->ops.push_back(boost::bind(&TestIoCtxImpl::omap_set, _1, _2, boost::ref(map)));
+ o->ops.push_back(std::bind(&TestIoCtxImpl::omap_set, _1, _2, boost::ref(map)));
}
void ObjectWriteOperation::remove() {
TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(impl);
- o->ops.push_back(boost::bind(&TestIoCtxImpl::remove, _1, _2, _5));
+ o->ops.push_back(std::bind(&TestIoCtxImpl::remove, _1, _2, _5));
}
void ObjectWriteOperation::selfmanaged_snap_rollback(uint64_t snapid) {
TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(impl);
- o->ops.push_back(boost::bind(&TestIoCtxImpl::selfmanaged_snap_rollback,
+ o->ops.push_back(std::bind(&TestIoCtxImpl::selfmanaged_snap_rollback,
_1, _2, snapid));
}
void ObjectWriteOperation::set_alloc_hint(uint64_t expected_object_size,
uint64_t expected_write_size) {
TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(impl);
- o->ops.push_back(boost::bind(&TestIoCtxImpl::set_alloc_hint, _1, _2,
+ o->ops.push_back(std::bind(&TestIoCtxImpl::set_alloc_hint, _1, _2,
expected_object_size, expected_write_size, 0,
_5));
}
uint64_t expected_write_size,
uint32_t flags) {
TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(impl);
- o->ops.push_back(boost::bind(&TestIoCtxImpl::set_alloc_hint, _1, _2,
+ o->ops.push_back(std::bind(&TestIoCtxImpl::set_alloc_hint, _1, _2,
expected_object_size, expected_write_size, flags,
_5));
}
void ObjectWriteOperation::tmap_update(const bufferlist& cmdbl) {
TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(impl);
- o->ops.push_back(boost::bind(&TestIoCtxImpl::tmap_update, _1, _2,
+ o->ops.push_back(std::bind(&TestIoCtxImpl::tmap_update, _1, _2,
cmdbl));
}
void ObjectWriteOperation::truncate(uint64_t off) {
TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(impl);
- o->ops.push_back(boost::bind(&TestIoCtxImpl::truncate, _1, _2, off, _5));
+ o->ops.push_back(std::bind(&TestIoCtxImpl::truncate, _1, _2, off, _5));
}
void ObjectWriteOperation::write(uint64_t off, const bufferlist& bl) {
TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(impl);
- o->ops.push_back(boost::bind(&TestIoCtxImpl::write, _1, _2, bl, bl.length(),
+ o->ops.push_back(std::bind(&TestIoCtxImpl::write, _1, _2, bl, bl.length(),
off, _5));
}
void ObjectWriteOperation::write_full(const bufferlist& bl) {
TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(impl);
- o->ops.push_back(boost::bind(&TestIoCtxImpl::write_full, _1, _2, bl, _5));
+ o->ops.push_back(std::bind(&TestIoCtxImpl::write_full, _1, _2, bl, _5));
}
void ObjectWriteOperation::writesame(uint64_t off, uint64_t len,
const bufferlist& bl) {
TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(impl);
- o->ops.push_back(boost::bind(&TestIoCtxImpl::writesame, _1, _2, bl, len,
+ o->ops.push_back(std::bind(&TestIoCtxImpl::writesame, _1, _2, bl, len,
off, _5));
}
void ObjectWriteOperation::zero(uint64_t off, uint64_t len) {
TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(impl);
- o->ops.push_back(boost::bind(&TestIoCtxImpl::zero, _1, _2, off, len, _5));
+ o->ops.push_back(std::bind(&TestIoCtxImpl::zero, _1, _2, off, len, _5));
}
Rados::Rados() : client(NULL) {
#include <memory>
#include <optional>
#include <string>
-#include <boost/bind.hpp>
+#include <functional>
#include <boost/system/system_error.hpp>
namespace bs = boost::system;
+using namespace std::placeholders;
namespace neorados {
namespace detail {
void Op::assert_exists() {
auto o = *reinterpret_cast<librados::TestObjectOperationImpl**>(&impl);
- o->ops.push_back(boost::bind(
+ o->ops.push_back(std::bind(
&librados::TestIoCtxImpl::assert_exists, _1, _2, _4));
}
void Op::cmpext(uint64_t off, ceph::buffer::list&& cmp_bl, std::size_t* s) {
auto o = *reinterpret_cast<librados::TestObjectOperationImpl**>(&impl);
- librados::ObjectOperationTestImpl op = boost::bind(
+ librados::ObjectOperationTestImpl op = std::bind(
&librados::TestIoCtxImpl::cmpext, _1, _2, off, cmp_bl, _4);
if (s != nullptr) {
- op = boost::bind(
- save_operation_size, boost::bind(op, _1, _2, _3, _4, _5), s);
+ op = std::bind(
+ save_operation_size, std::bind(op, _1, _2, _3, _4, _5), s);
}
o->ops.push_back(op);
}
(out != nullptr ? out : outbl), snap_id, snapc);
};
if (ec != nullptr) {
- op = boost::bind(
- save_operation_ec, boost::bind(op, _1, _2, _3, _4, _5), ec);
+ op = std::bind(
+ save_operation_ec, std::bind(op, _1, _2, _3, _4, _5), ec);
}
o->ops.push_back(op);
}
std::string(method).c_str(), inbl, outbl, snap_id, snapc);
};
if (ec != NULL) {
- op = boost::bind(
- save_operation_ec, boost::bind(op, _1, _2, _3, _4, _5), ec);
+ op = std::bind(
+ save_operation_ec, std::bind(op, _1, _2, _3, _4, _5), ec);
}
o->ops.push_back(op);
}
auto o = *reinterpret_cast<librados::TestObjectOperationImpl**>(&impl);
librados::ObjectOperationTestImpl op;
if (out != nullptr) {
- op = boost::bind(&librados::TestIoCtxImpl::read, _1, _2, len, off, out, _4);
+ op = std::bind(&librados::TestIoCtxImpl::read, _1, _2, len, off, out, _4);
} else {
- op = boost::bind(&librados::TestIoCtxImpl::read, _1, _2, len, off, _3, _4);
+ op = std::bind(&librados::TestIoCtxImpl::read, _1, _2, len, off, _3, _4);
}
if (ec != NULL) {
- op = boost::bind(
- save_operation_ec, boost::bind(op, _1, _2, _3, _4, _5), ec);
+ op = std::bind(
+ save_operation_ec, std::bind(op, _1, _2, _3, _4, _5), ec);
}
o->ops.push_back(op);
}
return r;
};
if (ec != NULL) {
- op = boost::bind(save_operation_ec,
- boost::bind(op, _1, _2, _3, _4, _5), ec);
+ op = std::bind(save_operation_ec,
+ std::bind(op, _1, _2, _3, _4, _5), ec);
}
o->ops.push_back(op);
}
void WriteOp::create(bool exclusive) {
auto o = *reinterpret_cast<librados::TestObjectOperationImpl**>(&impl);
- o->ops.push_back(boost::bind(
+ o->ops.push_back(std::bind(
&librados::TestIoCtxImpl::create, _1, _2, exclusive, _5));
}
void WriteOp::write(uint64_t off, ceph::buffer::list&& bl) {
auto o = *reinterpret_cast<librados::TestObjectOperationImpl**>(&impl);
- o->ops.push_back(boost::bind(
+ o->ops.push_back(std::bind(
&librados::TestIoCtxImpl::write, _1, _2, bl, bl.length(), off, _5));
}
void WriteOp::write_full(ceph::buffer::list&& bl) {
auto o = *reinterpret_cast<librados::TestObjectOperationImpl**>(&impl);
- o->ops.push_back(boost::bind(
+ o->ops.push_back(std::bind(
&librados::TestIoCtxImpl::write_full, _1, _2, bl, _5));
}
void WriteOp::remove() {
auto o = *reinterpret_cast<librados::TestObjectOperationImpl**>(&impl);
- o->ops.push_back(boost::bind(
+ o->ops.push_back(std::bind(
&librados::TestIoCtxImpl::remove, _1, _2, _5));
}
void WriteOp::truncate(uint64_t off) {
auto o = *reinterpret_cast<librados::TestObjectOperationImpl**>(&impl);
- o->ops.push_back(boost::bind(
+ o->ops.push_back(std::bind(
&librados::TestIoCtxImpl::truncate, _1, _2, off, _5));
}
void WriteOp::zero(uint64_t off, uint64_t len) {
auto o = *reinterpret_cast<librados::TestObjectOperationImpl**>(&impl);
- o->ops.push_back(boost::bind(
+ o->ops.push_back(std::bind(
&librados::TestIoCtxImpl::zero, _1, _2, off, len, _5));
}
void WriteOp::writesame(std::uint64_t off, std::uint64_t write_len,
ceph::buffer::list&& bl) {
auto o = *reinterpret_cast<librados::TestObjectOperationImpl**>(&impl);
- o->ops.push_back(boost::bind(
+ o->ops.push_back(std::bind(
&librados::TestIoCtxImpl::writesame, _1, _2, bl, write_len, off, _5));
}