proxy lazy resolve progress

This commit is contained in:
Sascha Kühl
2025-08-20 16:26:59 +02:00
parent 6b24a0e413
commit f1323accda
7 changed files with 63 additions and 28 deletions
+10 -3
View File
@@ -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);