Google APIs Client Library for C++
|
A pager over referenced REST APIs having a standard paging interface. More...
#include "client/service/service_request_pager.h"
Public Member Functions | |
ServiceRequestPager (REQUEST *request, DATA *page_data_storage) | |
Standard constructor. | |
virtual | ~ServiceRequestPager () |
Standard destructor. | |
DATA * | data () |
Returns the current page data. | |
REQUEST * | request () |
Returns the current page request. | |
virtual util::Status | ExecuteNextPage () |
Fetches the next page, if any. |
A pager over referenced REST APIs having a standard paging interface.
This template relies on the existence of REQUEST.set_page_token and RESPONSE.get_next_page_token methods to control the page iteration.
This class does not own the request or data objects. See the EncapsulatedServiceRequestPager as a variant that adds memory management.
REQUEST | must be a subclass of ClientServiceRequest and have a set_page_token method. |
DATA | must be a subclass of SerializableJson and have a get_next_page_token method. |
ServiceRequestPager | ( | REQUEST * | request, |
DATA * | page_data_storage | ||
) | [inline] |
Standard constructor.
[in] | request | The prototype request used to fetch pages. The caller retains ownershp. |
[in] | page_data_storage | Holds the underlying response data returned for the last requested page. The claeer retains ownership. |
virtual ~ServiceRequestPager | ( | ) | [inline, virtual] |
Standard destructor.
DATA* data | ( | ) | [inline] |
Returns the current page data.
virtual util::Status ExecuteNextPage | ( | ) | [inline, virtual] |
Fetches the next page, if any.
To distinguish the difference between a failure and no more pages, check the http_response()->http_status().
This method is called by the base class which guards with is_done so we dont need to check here. But we'll do so anyway just to be sure it didnt get here through some other route.
Implements BaseServiceRequestPager.
REQUEST* request | ( | ) | [inline] |
Returns the current page request.
Reimplemented from BaseServiceRequestPager.