summaryrefslogtreecommitdiff
path: root/page.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'page.cpp')
-rw-r--r--page.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/page.cpp b/page.cpp
index 7f56fc9..6ded950 100644
--- a/page.cpp
+++ b/page.cpp
@@ -58,14 +58,14 @@ struct Page {
dest->element_count = element_count;
}
- void operator++(int) {
+ void move_gap_forward() {
assert(gap_end < PAGE_SIZE);
elements[gap_start] = elements[gap_end];
gap_start++;
gap_end++;
}
- void operator--(int) {
+ void move_gap_backward() {
assert(gap_start > 0);
gap_end--;
gap_start--;
@@ -85,4 +85,12 @@ struct Page {
element_count--;
}
+ bool is_empty() {
+ return element_count == 0;
+ }
+
+ bool is_full() {
+ return gap_start == gap_end;
+ }
+
};