json_spirit::mObject m_json_object;
const SourceSpecBuilder<ImageCtxT>* m_source_spec_builder;
- std::unique_ptr<StreamInterface> m_stream;
+ std::shared_ptr<StreamInterface> m_stream;
};
template <typename I>
int SourceSpecBuilder<I>::build_stream(
const json_spirit::mObject& source_spec_object,
- std::unique_ptr<StreamInterface>* stream) const {
+ std::shared_ptr<StreamInterface>* stream) const {
auto cct = m_image_ctx->cct;
ldout(cct, 10) << dendl;
std::unique_ptr<FormatInterface>* format) const;
int build_stream(const json_spirit::mObject& source_spec_object,
- std::unique_ptr<StreamInterface>* stream) const;
+ std::shared_ptr<StreamInterface>* stream) const;
private:
ImageCtxT* m_image_ctx;
struct SourceSpecBuilder<librbd::MockTestImageCtx> {
MOCK_CONST_METHOD2(build_stream, int(const json_spirit::mObject&,
- std::unique_ptr<StreamInterface>*));
+ std::shared_ptr<StreamInterface>*));
};
MockStreamInterface* mock_stream_interface, int r) {
EXPECT_CALL(mock_source_spec_builder, build_stream(_, _))
.WillOnce(WithArgs<1>(Invoke([mock_stream_interface, r]
- (std::unique_ptr<StreamInterface>* ptr) {
+ (std::shared_ptr<StreamInterface>* ptr) {
ptr->reset(mock_stream_interface);
return r;
})));