13 #ifndef STXXL_CONTAINERS_BTREE__BTREE_PAGER_H
14 #define STXXL_CONTAINERS_BTREE__BTREE_PAGER_H
19 #include <stxxl/bits/noncopyable.h>
20 #include <stxxl/bits/common/utils.h>
21 #include <stxxl/bits/compat_auto_ptr.h>
24 __STXXL_BEGIN_NAMESPACE
30 unsigned_type npages_;
31 typedef std::list<int_type> list_type;
33 compat_auto_ptr<list_type>::result history;
34 std::vector<list_type::iterator> history_entry;
42 history(new list_type),
43 history_entry(npages_)
45 for (unsigned_type i = 0; i < npages_; i++)
47 history_entry[i] = history->insert(history->end(),
static_cast<int_type
>(i));
53 return history->back();
55 void hit(int_type ipage)
57 assert(ipage < int_type(npages_));
59 history->splice(history->begin(), *history, history_entry[ipage]);
63 std::swap(npages_, obj.npages_);
66 compat_auto_ptr<list_type>::result tmp = obj.history;
67 obj.history = history;
69 std::swap(history_entry, obj.history_entry);
79 inline void swap(stxxl::btree::lru_pager & a,
80 stxxl::btree::lru_pager & b)