proxy lazy resolve progress
This commit is contained in:
@@ -129,10 +129,15 @@ public:
|
||||
|
||||
public:
|
||||
explicit query_result(std::unique_ptr<query_result_impl> &&impl)
|
||||
: impl_(std::move(impl)) {}
|
||||
: impl_(std::move(impl))
|
||||
, creator_([this]{ return detail::create_prototype<Type>(impl_->prototype()); } ) {}
|
||||
|
||||
query_result(std::unique_ptr<query_result_impl> &&impl, creator_func&& creator)
|
||||
: impl_(std::move(impl))
|
||||
, creator_(std::move(creator)) {}
|
||||
|
||||
iterator begin() { return std::move(++iterator(this)); }
|
||||
iterator end() { return {}; }
|
||||
static iterator end() { return {}; }
|
||||
|
||||
private:
|
||||
friend class query_result_iterator<Type>;
|
||||
@@ -143,12 +148,14 @@ private:
|
||||
|
||||
protected:
|
||||
std::unique_ptr<query_result_impl> impl_;
|
||||
creator_func creator_;
|
||||
};
|
||||
|
||||
template<typename Type>
|
||||
Type *query_result<Type>::create() {
|
||||
return detail::create_prototype<Type>(impl_->prototype());
|
||||
return creator_();
|
||||
}
|
||||
|
||||
template<typename Type>
|
||||
void query_result<Type>::bind(const Type &obj) {
|
||||
impl_->bind(obj);
|
||||
|
||||
Reference in New Issue
Block a user