5 #ifndef ODB_POLYMORPHIC_OBJECT_RESULT_HXX
6 #define ODB_POLYMORPHIC_OBJECT_RESULT_HXX
19 #include <odb/details/config.hxx>
26 class polymorphic_object_result_impl:
public result_impl
33 typedef typename object_traits::id_type
id_type;
38 typedef typename object_traits::root_type
root_type;
62 if (pointer_traits::null_ptr (current_) && !
end_)
128 current_ = std::move (p);
131 guard_.reset (current_);
148 guard_.reset (current_);
163 typename pointer_traits::guard guard_;
166 template <
typename T,
typename ID>
201 return res_->load_id ();
207 return res_->load_discriminator ();
215 #include <odb/polymorphic-object-result.txx>
219 #endif // ODB_POLYMORPHIC_OBJECT_RESULT_HXX
odb::pointer_traits< pointer_type > pointer_traits
Definition: polymorphic-object-result.hxx:36
void begin()
Definition: polymorphic-object-result.hxx:76
object_traits::id_type id_type
Definition: polymorphic-object-result.hxx:33
virtual id_type load_id()=0
bool end() const
Definition: polymorphic-object-result.hxx:86
object_result_iterator(result_impl_type *res)
Definition: polymorphic-object-result.hxx:181
void release()
Definition: polymorphic-object-result.hxx:69
object_traits< T >::root_type root_type
Definition: polymorphic-object-result.hxx:174
object_traits::pointer_type pointer_type
Definition: polymorphic-object-result.hxx:35
object_traits< T >::object_type object_type
Definition: polymorphic-object-result.hxx:172
Definition: pointer-traits.hxx:28
object_traits::root_type root_type
Definition: polymorphic-object-result.hxx:38
odb::object_traits< object_type > object_traits
Definition: polymorphic-object-result.hxx:32
virtual void load(object_type *, bool fetch=true)=0
Definition: object-result.hxx:63
Definition: forward.hxx:123
polymorphic_object_result_impl(odb::connection &conn)
Definition: polymorphic-object-result.hxx:50
bool begin_
Definition: polymorphic-object-result.hxx:154
Definition: result.hxx:20
access::object_traits< T >::object_type object_type
Definition: traits.hxx:115
discriminator_type discriminator()
Definition: polymorphic-object-result.hxx:205
odb::object_traits< root_type > root_traits
Definition: polymorphic-object-result.hxx:39
Definition: traits.hxx:79
result_impl_type * res_
Definition: polymorphic-object-result.hxx:211
Definition: connection.hxx:33
id_type id()
Definition: polymorphic-object-result.hxx:199
root_traits::discriminator_type discriminator_type
Definition: polymorphic-object-result.hxx:40
object_traits< T >::pointer_type load()
Definition: polymorphic-object-result.hxx:188
object_traits< root_type >::discriminator_type discriminator_type
Definition: polymorphic-object-result.hxx:176
virtual discriminator_type load_discriminator()=0
pointer_type & current()
Definition: polymorphic-object-result.hxx:60
polymorphic_object_result_impl< object_type > result_impl_type
Definition: polymorphic-object-result.hxx:178
object_traits< T >::id_type id_type
Definition: polymorphic-object-result.hxx:173
virtual std::size_t size()=0
Definition: result.hxx:75
void current(pointer_type p, bool guard=true)
Definition: polymorphic-object-result.hxx:143
Definition: object-result.hxx:27
access::object_traits< T >::pointer_type pointer_type
Definition: traits.hxx:116
T object_type
Definition: polymorphic-object-result.hxx:31
Definition: result.hxx:56
bool end_
Definition: polymorphic-object-result.hxx:155