cesium-native 0.46.0
|
Allows access to a set of resources from a paginated list. More...
#include <CesiumITwinClient/PagedList.h>
Public Types | |
using | PageOperation |
Callback used to obtain a page of results from a URL. | |
Public Member Functions | |
PagedList (rapidjson::Document &doc, std::vector< T > &&items, PageOperation &&operation) | |
Creates a new PagedList from a set of items, an iTwin API response, and a callback to retrieve more items. | |
T & | operator[] (size_t index) |
Returns the contained item at index . | |
const T & | operator[] (size_t index) const |
Returns the contained item at index . | |
size_t | size () const |
Returns the number of contained items. | |
auto | begin () |
The begin iterator of the underlying vector. | |
auto | begin () const |
The begin iterator of the underlying vector. | |
auto | end () |
The end iterator of the underlying vector. | |
auto | end () const |
The end iterator of the underlying vector. | |
CesiumAsync::Future< CesiumUtility::Result< PagedList< T > > > | next (CesiumAsync::AsyncSystem &asyncSystem, Connection &connection) const |
Returns a future that will return the next page of items. | |
CesiumAsync::Future< CesiumUtility::Result< PagedList< T > > > | prev (CesiumAsync::AsyncSystem &asyncSystem, Connection &connection) const |
Returns a future that will return the previous page of items. | |
Allows access to a set of resources from a paginated list.
Many endpoints in the iTwin API return links to the previous and next pages, if any, in their results. This class allows these links to be easily traversed.
Definition at line 26 of file PagedList.h.
using CesiumITwinClient::PagedList< T >::PageOperation |
Callback used to obtain a page of results from a URL.
Definition at line 31 of file PagedList.h.
|
inline |
Creates a new PagedList
from a set of items, an iTwin API response, and a callback to retrieve more items.
doc | The JSON document obtained from the iTwin API. |
items | The parsed items that should be returned to the user. |
operation | Callback that can obtain a new page of results from a given URL. |
Definition at line 43 of file PagedList.h.
|
inline |
The begin
iterator of the underlying vector.
Definition at line 94 of file PagedList.h.
|
inline |
The begin
iterator of the underlying vector.
Definition at line 98 of file PagedList.h.
|
inline |
The end
iterator of the underlying vector.
Definition at line 103 of file PagedList.h.
|
inline |
The end
iterator of the underlying vector.
Definition at line 107 of file PagedList.h.
|
inline |
Returns a future that will return the next page of items.
asyncSystem | The AsyncSystem to use. |
connection | The Connection to use to fetch the next page of results. |
Definition at line 117 of file PagedList.h.
|
inline |
Returns the contained item at index
.
Definition at line 79 of file PagedList.h.
|
inline |
Returns the contained item at index
.
Definition at line 84 of file PagedList.h.
|
inline |
Returns a future that will return the previous page of items.
asyncSystem | The AsyncSystem to use. |
connection | The Connection to use to fetch the previous page of results. |
Definition at line 134 of file PagedList.h.
|
inline |
Returns the number of contained items.
Definition at line 89 of file PagedList.h.