mirror of https://github.com/stella-emu/stella.git
Working on FileListWidget, and keep forgetting to commit this bit.
This commit is contained in:
parent
50cb562592
commit
bd66449412
|
@ -112,6 +112,22 @@ class LinkedObjectPool
|
||||||
myCurrent = std::next(myCurrent, 1);
|
myCurrent = std::next(myCurrent, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Advance 'current' iterator to first position in the active list.
|
||||||
|
*/
|
||||||
|
void moveToFirst() {
|
||||||
|
if(currentIsValid())
|
||||||
|
myCurrent = myList.begin();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Advance 'current' iterator to last position in the active list.
|
||||||
|
*/
|
||||||
|
void moveToLast() {
|
||||||
|
if(currentIsValid())
|
||||||
|
myCurrent = std::prev(myList.end(), 1);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Return an iterator to the first node in the active list.
|
Return an iterator to the first node in the active list.
|
||||||
*/
|
*/
|
||||||
|
@ -246,6 +262,13 @@ class LinkedObjectPool
|
||||||
bool empty() const { return size() == 0; }
|
bool empty() const { return size() == 0; }
|
||||||
bool full() const { return size() >= capacity(); }
|
bool full() const { return size() >= capacity(); }
|
||||||
|
|
||||||
|
friend ostream& operator<<(ostream& os, const LinkedObjectPool<T>& p) {
|
||||||
|
for(const auto& i: p.myList)
|
||||||
|
os << i << (p.current() == i ? "* " : " ");
|
||||||
|
return os;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::list<T> myList, myPool;
|
std::list<T> myList, myPool;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue