Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members

spot::bdd_allocator Class Reference

Manage ranges of variables. More...

#include <bddalloc.hh>

Inheritance diagram for spot::bdd_allocator:

Inheritance graph
[legend]
Collaboration diagram for spot::bdd_allocator:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 bdd_allocator ()
 Default constructor.

int allocate_variables (int n)
 Allocate n BDD variables.

void release_variables (int base, int n)
 Release n BDD variables starting at base.

std::ostream & dump_free_list (std::ostream &os) const
 Dump the list to os for debugging.


Static Public Member Functions

void initialize ()
 Initialize the BDD library.


Protected Attributes

int lvarnum
 number of variables in use in this allocator.


Static Protected Attributes

bool initialized
 Whether the BDD library has been initialized.


Private Types

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

typedef std::list< pos_lenght_pairfree_list_type

Private Member Functions

void extvarnum (int more)
 Require more variables.

virtual int extend (int n)
int register_n (int n)
 Find n consecutive integers.

void release_n (int base, int n)
 Release n consecutive integers starting at base.

void insert (int base, int n)
 Extend the list by inserting a new pos-lenght pair.

void remove (int base, int n=0)
 Remove n consecutive entries from the list, starting at base.

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


Private Attributes

free_list_type fl
 Tracks unused BDD variables.


Detailed Description

Manage ranges of variables.


Member Typedef Documentation

typedef std::list<pos_lenght_pair> spot::free_list::free_list_type [protected, inherited]
 

typedef std::pair<int, int> spot::free_list::pos_lenght_pair [protected, inherited]
 

Such pairs describe second free integer starting at first.


Constructor & Destructor Documentation

spot::bdd_allocator::bdd_allocator  ) 
 

Default constructor.


Member Function Documentation

int spot::bdd_allocator::allocate_variables int  n  ) 
 

Allocate n BDD variables.

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

Dump the list to os for debugging.

virtual int spot::bdd_allocator::extend int  n  )  [private, 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.

Implements spot::free_list.

void spot::bdd_allocator::extvarnum int  more  )  [private]
 

Require more variables.

void spot::bdd_allocator::initialize  )  [static]
 

Initialize the BDD library.

void spot::free_list::insert int  base,
int  n
[inherited]
 

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

int spot::free_list::register_n int  n  )  [inherited]
 

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
[inherited]
 

Release n consecutive integers starting at base.

void spot::bdd_allocator::release_variables int  base,
int  n
 

Release n BDD variables starting at base.

void spot::free_list::remove free_list_type::iterator  i,
int  base,
int  n
[protected, inherited]
 

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

void spot::free_list::remove int  base,
int  n = 0
[inherited]
 

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


Member Data Documentation

free_list_type spot::free_list::fl [protected, inherited]
 

Tracks unused BDD variables.

bool spot::bdd_allocator::initialized [static, protected]
 

Whether the BDD library has been initialized.

int spot::bdd_allocator::lvarnum [protected]
 

number of variables in use in this allocator.


The documentation for this class was generated from the following file:
Generated on Tue Jun 29 17:01:35 2004 for spot by doxygen 1.3.7