@@ -98,6 +98,7 @@ namespace librados
class ObjectOperation
{
public:
+ ObjectOperation();
~ObjectOperation();
void write(uint64_t off, const bufferlist& bl);
@@ -114,7 +115,6 @@ namespace librados
private:
ObjectOperationImpl *impl;
- ObjectOperation(ObjectOperationImpl *impl_) : impl(impl_) {}
ObjectOperation(const ObjectOperation& rhs);
ObjectOperation& operator=(const ObjectOperation& rhs);
friend class IoCtx;
@@ -263,8 +263,6 @@ namespace librados
int ioctx_create(const char *name, IoCtx &pioctx);
- static ObjectOperation *operation_create();
-
/* listing objects */
int pool_list(std::list<std::string>& v);
int get_pool_stats(std::list<std::string>& v,
@@ -2729,9 +2729,10 @@ aio_create_completion(void *cb_arg, callback_t cb_complete, callback_t cb_safe)
return new AioCompletion(c);
}
-librados::ObjectOperation *librados::Rados::operation_create()
+
+librados::ObjectOperation::ObjectOperation()
{
- return new librados::ObjectOperation((ObjectOperationImpl *)new ::ObjectOperation);
+ impl = (ObjectOperationImpl *)new ::ObjectOperation;
}
librados::ObjectOperation::~ObjectOperation()
@@ -204,12 +204,11 @@ int main(int argc, const char **argv)
}
cout << "compound operation..." << std::endl;
- ObjectOperation *o = rados.operation_create();
- o->write(0, bl);
- o->setxattr("foo", bl2);
- r = io_ctx.operate(oid, o, &bl2);
+ ObjectOperation o;
+ o.write(0, bl);
+ o.setxattr("foo", bl2);
+ r = io_ctx.operate(oid, &o, &bl2);
cout << "operate result=" << r << std::endl;
- delete o;
cout << "iterating over objects..." << std::endl;
int num_objs = 0;