}
+XSnapshots::iterator
+XSnapshots::findPre(iterator post)
+{
+ if (post == entries.end() || post->isCurrent() || post->getType() != POST)
+ SN_THROW(IllegalSnapshotException());
+
+ for (iterator it = begin(); it != end(); ++it)
+ {
+ if (it->getType() == PRE && it->getNum() == post->getPreNum())
+ return it;
+ }
+
+ return end();
+}
+
+
XSnapshots::const_iterator
XSnapshots::findPre(const_iterator post) const
{
}
+XSnapshots::iterator
+XSnapshots::findPost(iterator pre)
+{
+ if (pre == entries.end() || pre->isCurrent() || pre->getType() != PRE)
+ SN_THROW(IllegalSnapshotException());
+
+ for (iterator it = begin(); it != end(); ++it)
+ {
+ if (it->getType() == POST && it->getPreNum() == pre->getNum())
+ return it;
+ }
+
+ return end();
+}
+
+
XSnapshots::const_iterator
XSnapshots::findPost(const_iterator pre) const
{
struct XSnapshots
{
+ typedef list<XSnapshot>::iterator iterator;
typedef list<XSnapshot>::const_iterator const_iterator;
+ iterator begin() { return entries.begin(); }
const_iterator begin() const { return entries.begin(); }
+
+ iterator end() { return entries.end(); }
const_iterator end() const { return entries.end(); }
const_iterator find(unsigned int num) const;
+ iterator findPre(iterator post);
const_iterator findPre(const_iterator post) const;
+
+ iterator findPost(iterator pre);
const_iterator findPost(const_iterator pre) const;
list<XSnapshot> entries;