nds2-client - Developer 0.16.7
Loading...
Searching...
No Matches
nds_iterate_handler.hh
Go to the documentation of this file.
1#ifndef __NDS_ITERATE_HANDLER_HH__
2#define __NDS_ITERATE_HANDLER_HH__
3
4#include <memory>
5#include "nds_buffer.hh"
6
7namespace NDS
8{
9 namespace detail
10 {
11 struct conn_p_type;
12
20 : public std::enable_shared_from_this< iterate_handler >
21 {
22 public:
24 std::shared_ptr< NDS::detail::conn_p_type >&& conn_p )
25 : conn_p_{ conn_p }
26 {
27 }
28 virtual bool has_next( ) = 0;
29
30 virtual void next( buffers_type& ) = 0;
31
32 void next( );
33
34 virtual ~iterate_handler( );
35
36 virtual bool
38 {
39 return !has_next( );
40 }
41
42 void abort( );
43
44 std::shared_ptr< buffers_type > cache_;
45
46 protected:
49 {
50 return conn_p_.get( );
51 }
52
53 private:
54 std::shared_ptr< NDS::detail::conn_p_type > conn_p_;
55
56 void invalidate( );
57 };
58 }
59}
60
61#endif // __NDS_ITERATE_HANDLER_HH__
Definition nds_iterate_handler.hh:21
virtual bool done()
Definition nds_iterate_handler.hh:37
void next()
Definition nds_iterate_handler.cc:12
void invalidate()
Definition nds_iterate_handler.cc:46
std::shared_ptr< NDS::detail::conn_p_type > conn_p_
Definition nds_iterate_handler.hh:54
virtual void next(buffers_type &)=0
void abort()
Definition nds_iterate_handler.cc:32
NDS::detail::conn_p_type * conn()
Definition nds_iterate_handler.hh:48
iterate_handler(std::shared_ptr< NDS::detail::conn_p_type > &&conn_p)
Definition nds_iterate_handler.hh:23
std::shared_ptr< buffers_type > cache_
Definition nds_iterate_handler.hh:44
std::vector< buffer > buffers_type
Definition nds_buffer.hh:356
The NDS client namespace.
Definition debug_stream.cc:18
Definition nds_connection_ptype.hh:149