16 namespace duds {
namespace ui {
105 return !pages.empty() && (spot == pages.size() - 1);
120 return pages.empty();
125 PageStack::size_type
size()
const {
134 return pages.at(spot);
139 PageStack::const_iterator
begin()
const {
140 return pages.cbegin();
145 PageStack::const_reverse_iterator
rbegin()
const {
146 return pages.crbegin();
151 PageStack::const_iterator
end()
const {
157 PageStack::const_reverse_iterator
rend()
const {
158 return pages.crend();
165 return pages.cbegin() +
spot;
171 PageStack::const_reverse_iterator
rcurrent()
const {
172 return pages.crend() - spot - 1;
178 #endif // #ifndef PATH_HPP bool move(int steps)
Changes the current page by the given amount.
PageStack::const_reverse_iterator rend() const
Reverse iterator to the start of the page stack.
bool atEnd() const
True if the current page is the end of the page sequence.
bool atStart() const
True if the current page is the start of the page sequence.
PageStack::const_reverse_iterator rcurrent() const
Reverse iterator to the current page.
bool forward()
Changes the current page to the page that was pushed after the current page.
PageStack::const_iterator begin() const
Iterator to the start of the page stack.
void push(const PageSptr &page)
Pushes a new page after the current page.
PageStack::size_type size() const
Returns the number of pages in the page stack.
bool back()
Changes the current page to the page that was pushed before the current page.
bool empty() const
Returns true if the page stack is empty.
const PageSptr & currentPage() const
Returns the current page.
void clear()
Clears out the stack of all pages.
PageStack::const_iterator end() const
Iterator to the end of the page stack.
void clearPastCurrent()
Clears all pages on the stack that are forward of the current page.
Path()
Constructs a new empty path.
std::vector< PageSptr > PageStack
The type used to store the page path.
PageStack::const_iterator current() const
Iterator to the current page.
PageStack::const_reverse_iterator rbegin() const
Reverse iterator to the end of the page stack.
std::shared_ptr< Page > PageSptr
A shared pointer to a Page.
PageStack pages
The pages in path order.
int spot
Index of the current page.
Stores a list of pages the user has visited in the order of the visits.