lintel 0.2.0
Loading...
Searching...
No Matches
Page.h
Go to the documentation of this file.
1#ifndef LINTEL_PAGE_H
2#define LINTEL_PAGE_H
3
4#include <optional>
5#include <string>
6#include <utility>
7#include <vector>
8
9namespace lintel {
14template<typename T> class Page
15{
16private:
18 std::vector<T> m_items;
20 bool m_hasMore;
22 std::optional<std::string> m_nextAfter;
23
24public:
31 Page(std::vector<T> items, const bool hasMore, std::optional<std::string> nextAfter)
32 : m_items(std::move(items)), m_hasMore(hasMore), m_nextAfter(std::move(nextAfter))
33 {}
34
36 [[nodiscard]] const std::vector<T> &getItems() const { return m_items; }
37
39 [[nodiscard]] bool hasMore() const { return m_hasMore; }
40
42 [[nodiscard]] const std::optional<std::string> &getNextAfter() const { return m_nextAfter; }
43};
44
45}// namespace lintel
46#endif// LINTEL_PAGE_H
Definition Page.h:15
const std::optional< std::string > & getNextAfter() const
Definition Page.h:42
const std::vector< T > & getItems() const
Definition Page.h:36
Page(std::vector< T > items, const bool hasMore, std::optional< std::string > nextAfter)
Definition Page.h:31
bool hasMore() const
Definition Page.h:39
Definition BaseFeature.h:6
constexpr std::string_view type_name()
Definition TypeName.h:9