Tidy up coral::fixed_buffer interface

This commit is contained in:
kayomn 2023-02-23 00:14:24 +00:00
parent c3a49eed7f
commit da3e87fe3b
1 changed files with 8 additions and 15 deletions

View File

@ -20,13 +20,6 @@ export namespace coral {
return {0, this->filled}; return {0, this->filled};
} }
/**
* Returns the base pointer of the buffer data.
*/
u8 * begin() {
return this->data;
}
/** /**
* Returns the base pointer of the buffer data. * Returns the base pointer of the buffer data.
*/ */
@ -34,13 +27,6 @@ export namespace coral {
return this->data; return this->data;
} }
/**
* Returns the tail pointer of the buffer data.
*/
u8 * end() {
return this->data + this->cursor;
}
/** /**
* Returns the tail pointer of the buffer data. * Returns the tail pointer of the buffer data.
*/ */
@ -49,7 +35,14 @@ export namespace coral {
} }
/** /**
* Returns `true` if the buffer has been completely filled with data. * Returns `true` if the buffer is completely empty of data, otherwise `false`.
*/
bool is_empty() const {
return this->filled == capacity;
}
/**
* Returns `true` if the buffer has been completely filled with data, otherwise `false`.
*/ */
bool is_full() const { bool is_full() const {
return this->filled == capacity; return this->filled == capacity;