12 #ifndef SEC_DRAWN_POS_HXX
13 #define SEC_DRAWN_POS_HXX
18 #ifndef AW_POSITION_HXX
24 typedef std::map<size_t, Position>
PosMap;
30 void clear() { drawnAt.clear(); }
33 bool empty()
const {
return drawnAt.empty(); }
34 const PosMap::const_iterator
begin()
const {
return drawnAt.begin(); }
35 const PosMap::const_iterator
end()
const {
return drawnAt.end(); }
38 PosMap::const_iterator found = drawnAt.find(abs);
39 return (found == drawnAt.end()) ?
NULp : &(found->second);
44 PosMap::const_iterator found = drawnAt.lower_bound(abspos);
46 if (found == drawnAt.begin()) {
47 found = drawnAt.end();
52 if (before_abs) *before_abs = found->first;
53 return *&found->second;
58 PosMap::const_iterator found = drawnAt.upper_bound(abspos);
60 if (found == drawnAt.end()) {
61 found = drawnAt.begin();
64 if (after_abs) *after_abs = found->first;
65 return *&found->second;
69 const Position *at = drawn_at(abspos);
70 return at ? *at : drawn_after(abspos,
NULp);
77 #error SEC_drawn_pos.hxx included twice
78 #endif // SEC_DRAWN_POS_HXX
const Position & drawn_before(size_t abspos, size_t *before_abs) const
const Position & drawn_at_or_after(size_t abspos) const
const PosMap::const_iterator end() const
const Position & drawn_after(size_t abspos, size_t *after_abs) const
void announce(size_t abs, const Position &drawn)
const Position * drawn_at(size_t abs) const
std::map< size_t, Position > PosMap
const PosMap::const_iterator begin() const