spot  1.1.3
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
spot::free_list Class Referenceabstract

Manage list of free integers. More...

#include <misc/freelist.hh>

Inheritance diagram for spot::free_list:
Inheritance graph
Collaboration diagram for spot::free_list:
Collaboration graph

Public Member Functions

virtual ~free_list ()
 
int register_n (int n)
 Find n consecutive integers. More...
 
void release_n (int base, int n)
 Release n consecutive integers starting at base. More...
 
std::ostream & dump_free_list (std::ostream &os) const
 Dump the list to os for debugging. More...
 
void insert (int base, int n)
 Extend the list by inserting a new pos-lenght pair. More...
 
void remove (int base, int n=0)
 Remove n consecutive entries from the list, starting at base. More...
 
int free_count () const
 Return the number of free integers on the list. More...
 

Protected Types

typedef std::pair< int, int > pos_lenght_pair
 Such pairs describe second free integer starting at first. More...
 
typedef std::list
< pos_lenght_pair
free_list_type
 

Protected Member Functions

virtual int extend (int n)=0
 
void remove (free_list_type::iterator i, int base, int n)
 Remove n consecutive entries from the list, starting at base. More...
 

Protected Attributes

free_list_type fl
 Tracks unused BDD variables. More...
 

Detailed Description

Manage list of free integers.

Member Typedef Documentation

typedef std::list<pos_lenght_pair> spot::free_list::free_list_type
protected
typedef std::pair<int, int> spot::free_list::pos_lenght_pair
protected

Such pairs describe second free integer starting at first.

Constructor & Destructor Documentation

virtual spot::free_list::~free_list ( )
virtual

Member Function Documentation

std::ostream& spot::free_list::dump_free_list ( std::ostream &  os) const

Dump the list to os for debugging.

virtual int spot::free_list::extend ( int  n)
protectedpure virtual

Allocate n integer.

This function is called by register_n() when the free list is empty or if n consecutive integers could not be found. It should allocate more integers, possibly changing the list, and return the first integer on a range of n consecutive integer requested by the user.

Implemented in spot::bdd_dict::anon_free_list, and spot::bdd_allocator.

int spot::free_list::free_count ( ) const

Return the number of free integers on the list.

void spot::free_list::insert ( int  base,
int  n 
)

Extend the list by inserting a new pos-lenght pair.

int spot::free_list::register_n ( int  n)

Find n consecutive integers.

Browse the list of free integers until n consecutive integers are found. Extend the list (using extend()) otherwise.

Returns
the first integer of the range
void spot::free_list::release_n ( int  base,
int  n 
)

Release n consecutive integers starting at base.

void spot::free_list::remove ( int  base,
int  n = 0 
)

Remove n consecutive entries from the list, starting at base.

void spot::free_list::remove ( free_list_type::iterator  i,
int  base,
int  n 
)
protected

Remove n consecutive entries from the list, starting at base.

Member Data Documentation

free_list_type spot::free_list::fl
protected

Tracks unused BDD variables.


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

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Tue Jul 9 2013 14:04:33 for spot by doxygen 1.8.4