34 int next_tag(
int t,
int s = DEF_CYCLE_SIZE) {
35 TagInfo& found = create_base_tag(t, s);
36 found.current = (found.current + 1) % found.cycleSize;
37 return (found.base + found.current);
44 int preceding_tag(
int t,
int s = DEF_CYCLE_SIZE) {
45 const TagInfo& found = create_base_tag(t, s);
46 if (found.current == 0) {
47 return (found.base + found.cycleSize - 1);
49 return (found.base + found.current - 1);
56 int following_tag(
int t,
int s = DEF_CYCLE_SIZE) {
57 const TagInfo& found = create_base_tag(t, s);
58 const int following = (found.current + 1) % found.cycleSize;
59 return (found.base + following);
64 int current_tag(
int t,
int s = DEF_CYCLE_SIZE) {
65 TagInfo& found = create_base_tag(t, s);
66 return (found.base + found.current);
71 int reset_tag(
int t,
int s = DEF_CYCLE_SIZE) {
72 TagInfo& found = create_base_tag(t, s);
98 bool operator()(
const int& x,
const int& y)
const {
return x < y; }
102 std::map<int, TagInfo, TagCompare> TagList;
107 TagInfo& create_base_tag(
int t,
int s = DEF_CYCLE_SIZE) {
108 TagInfo& found = TagList[t];
109 if (found.base < 0) {