Hasty Badger
Small UI library (a branch of Turbo Badger)
|
Allocator of space out of a given available space. More...
#include <tb_bitmap_fragment.h>
Classes | |
class | Space |
A chunk of space. More... | |
Public Member Functions | |
TBSpaceAllocator (int available_space) | |
bool | IsAllAvailable () const |
Return true if no allocations are currently live using this allocator. More... | |
bool | HasSpace (int needed_w) const |
Return true if the given width is currently available. More... | |
Space * | AllocSpace (int needed_w) |
Allocate the given space and return the Space, or nullptr on error. More... | |
void | FreeSpace (Space *space) |
Free the given space so it is available for new allocations. More... | |
Allocator of space out of a given available space.
TBSpaceAllocator::Space * tb::TBSpaceAllocator::AllocSpace | ( | int | needed_w | ) |
Allocate the given space and return the Space, or nullptr on error.
void tb::TBSpaceAllocator::FreeSpace | ( | Space * | space | ) |
Free the given space so it is available for new allocations.
bool tb::TBSpaceAllocator::HasSpace | ( | int | needed_w | ) | const |
Return true if the given width is currently available.
|
inline |
Return true if no allocations are currently live using this allocator.