Google APIs Client Library for C++
|
Base class for component that pages through REST results. More...
#include "client/service/service_request_pager.h"
Public Member Functions | |
BaseServiceRequestPager (ClientServiceRequest *request) | |
Standard constructor. | |
virtual | ~BaseServiceRequestPager () |
Standard destructor. | |
ClientServiceRequest * | request () |
Returns the current page request. | |
HttpResponse * | http_response () |
Returns the current page response. | |
bool | is_done () const |
Determine if this was the last known page. | |
bool | NextPage () |
Fetch the next page. | |
void | Reset () |
Resets the pager back to the start. | |
Protected Member Functions | |
virtual util::Status | ExecuteNextPage ()=0 |
Does the actual messaging to the service to get the next page. | |
const string & | next_page_token () const |
Returns the token parameter to use when fetching the next page. | |
void | set_next_page_token (int64 token) |
Sets the [scalar] request token identifying the next desired page. | |
void | set_next_page_token (const StringPiece &token) |
Sets the [string] request token identifying the next desired page. |
Base class for component that pages through REST results.
This class is abstract requiring ExecuteNextPage to be implemented to instruct the pager how to specify (and determine) the next page.
Normally the concrete ServiceRequestPager is used.
BaseServiceRequestPager | ( | ClientServiceRequest * | request | ) | [explicit] |
Standard constructor.
[in] | request | A reference to a prototype request used to fetch the next page. Ownership is retained by the caller. |
virtual ~BaseServiceRequestPager | ( | ) | [virtual] |
Standard destructor.
virtual util::Status ExecuteNextPage | ( | ) | [protected, pure virtual] |
Does the actual messaging to the service to get the next page.
Implemented in ServiceRequestPager< REQUEST, DATA >.
HttpResponse* http_response | ( | ) | [inline] |
Returns the current page response.
bool is_done | ( | ) | const [inline] |
Determine if this was the last known page.
const string& next_page_token | ( | ) | const [inline, protected] |
Returns the token parameter to use when fetching the next page.
bool NextPage | ( | ) |
Fetch the next page.
ClientServiceRequest* request | ( | ) | [inline] |
Returns the current page request.
Reimplemented in ServiceRequestPager< REQUEST, DATA >.
void Reset | ( | ) |
Resets the pager back to the start.
The next iteration may be different than the previous one depending on the backend service.
void set_next_page_token | ( | int64 | token | ) | [inline, protected] |
Sets the [scalar] request token identifying the next desired page.
This is for service APIs that use scalar token values.
[in] | token | Specifies the desired page. |
void set_next_page_token | ( | const StringPiece & | token | ) | [inline, protected] |
Sets the [string] request token identifying the next desired page.
This is for service APIs that use string token values.
[in] | token | Specifies the desired page. |