Hasty Badger
Small UI library (a branch of Turbo Badger)
 All Classes Namespaces Functions Variables Enumerations Enumerator Friends Groups Pages
tb::TBSpaceAllocator Class Reference

Allocator of space out of a given available space. More...

#include <tb_bitmap_fragment.h>

Inheritance diagram for tb::TBSpaceAllocator:
tb::TBFragmentSpaceAllocator

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...
 
SpaceAllocSpace (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...
 

Detailed Description

Allocator of space out of a given available space.

Member Function Documentation

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.

bool tb::TBSpaceAllocator::IsAllAvailable ( ) const
inline

Return true if no allocations are currently live using this allocator.


The documentation for this class was generated from the following files: