addrRangeTree< T > Class Template Reference

#include <addrRange.h>

Data Structures

struct  entry

Public Member Functions

 addrRangeTree ()
virtual ~addrRangeTree ()
int size () const
bool empty () const
void insert (T *value)
void remove (Address key)
virtual bool find (Address key, T *&value) const
virtual bool find (Address start, Address end, std::vector< T * > &ranges) const
virtual bool precessor (Address key, T *&value) const
virtual bool successor (Address key, T *&value) const
T ** elements (T **buffer) const
bool elements (pdvector< T * > &buffer) const
void clear ()

Private Types

typedef struct addrRangeTree::entry entry

Private Member Functions

void leftRotate (entry *pivot)
void rightRotate (entry *pivot)
void deleteFixup (entry *x)
entrytreeInsert (Address key, T *value)
entrytreeSuccessor (entry *x) const
entryfind_internal (Address element) const
void traverse (T **all, entry *node, int &n) const
void traverse (pdvector< T * > &all, entry *node) const
void destroy (entry *node)
 addrRangeTree (const addrRangeTree &)
bool precessor_internal (Address key, entry *&value) const
bool successor_internal (Address key, entry *&value) const

Private Attributes

entrynil
int setSize
entrysetData

Detailed Description

template<class T>
class addrRangeTree< T >

T should inherit from addrRange

Definition at line 71 of file addrRange.h.


Member Typedef Documentation

template<class T >
typedef struct addrRangeTree::entry addrRangeTree< T >::entry [private]

tree implementation structure. Used to implement the RB tree


Constructor & Destructor Documentation

template<class T >
addrRangeTree< T >::addrRangeTree ( const addrRangeTree< T > &   )  [inline, private]

copy constructor

Definition at line 352 of file addrRange.h.

template<class T >
addrRangeTree< T >::addrRangeTree (  )  [inline]

constructor. The default comparison structure is used

Definition at line 425 of file addrRange.h.

References addrRangeTree< T >::nil, and addrRangeTree< T >::setData.

template<class T >
virtual addrRangeTree< T >::~addrRangeTree (  )  [inline, virtual]

destructor which deletes all tree structure and allocated entries

Definition at line 433 of file addrRange.h.

References addrRangeTree< T >::destroy(), addrRangeTree< T >::nil, and addrRangeTree< T >::setData.


Member Function Documentation

template<class T >
void addrRangeTree< T >::clear (  )  [inline]
template<class T >
void addrRangeTree< T >::deleteFixup ( entry x  )  [inline, private]
template<class T >
void addrRangeTree< T >::destroy ( entry node  )  [inline, private]
template<class T >
bool addrRangeTree< T >::elements ( pdvector< T * > &  buffer  )  const [inline]
template<class T >
T** addrRangeTree< T >::elements ( T **  buffer  )  const [inline]

fill an buffer array with the sorted elements of the addrRangeTree in ascending order according to comparison function if the addrRangeTree is empty it retuns NULL, other wise it returns the input argument.

Definition at line 616 of file addrRange.h.

References addrRangeTree< T >::nil, addrRangeTree< T >::setData, and addrRangeTree< T >::traverse().

template<class T >
bool addrRangeTree< T >::empty (  )  const [inline]

returns true if tree is empty

Definition at line 446 of file addrRange.h.

References addrRangeTree< T >::nil, and addrRangeTree< T >::setData.

template<class T >
virtual bool addrRangeTree< T >::find ( Address  start,
Address  end,
std::vector< T * > &  ranges 
) const [inline, virtual]

Fills in the vector with all address ranges that overlap with the address range defined by (start, end]

Definition at line 561 of file addrRange.h.

References addrRangeTree< T >::entry::key, addrRangeTree< T >::nil, addrRangeTree< T >::precessor_internal(), addrRangeTree< T >::successor_internal(), addrRangeTree< T >::treeSuccessor(), and addrRangeTree< T >::entry::value.

template<class T >
virtual bool addrRangeTree< T >::find ( Address  key,
T *&  value 
) const [inline, virtual]

returns true if the argument is member of the addrRangeTree

Parameters:
e the element that will be searched for

Definition at line 538 of file addrRange.h.

References addrRangeTree< T >::precessor().

template<class T >
entry* addrRangeTree< T >::find_internal ( Address  element  )  const [inline, private]
template<class T >
void addrRangeTree< T >::insert ( T *  value  )  [inline]
template<class T >
void addrRangeTree< T >::leftRotate ( entry pivot  )  [inline, private]
template<class T >
virtual bool addrRangeTree< T >::precessor ( Address  key,
T *&  value 
) const [inline, virtual]

Returns the largest value less than or equal to the key given

Definition at line 587 of file addrRange.h.

References addrRangeTree< T >::precessor_internal(), and addrRangeTree< T >::entry::value.

Referenced by addrRangeTree< T >::find().

template<class T >
bool addrRangeTree< T >::precessor_internal ( Address  key,
entry *&  value 
) const [inline, private]
template<class T >
void addrRangeTree< T >::remove ( Address  key  )  [inline]
template<class T >
void addrRangeTree< T >::rightRotate ( entry pivot  )  [inline, private]
template<class T >
int addrRangeTree< T >::size (  )  const [inline]

returns the cardinality of the tree , number of elements

Definition at line 440 of file addrRange.h.

References addrRangeTree< T >::setSize.

template<class T >
virtual bool addrRangeTree< T >::successor ( Address  key,
T *&  value 
) const [inline, virtual]

Returns the smallest value greater than or equal to the key given

Definition at line 601 of file addrRange.h.

References addrRangeTree< T >::successor_internal(), and addrRangeTree< T >::entry::value.

template<class T >
bool addrRangeTree< T >::successor_internal ( Address  key,
entry *&  value 
) const [inline, private]
template<class T >
void addrRangeTree< T >::traverse ( pdvector< T * > &  all,
entry node 
) const [inline, private]
template<class T >
void addrRangeTree< T >::traverse ( T **  all,
entry node,
int &  n 
) const [inline, private]
template<class T >
entry* addrRangeTree< T >::treeInsert ( Address  key,
T *  value 
) [inline, private]
template<class T >
entry* addrRangeTree< T >::treeSuccessor ( entry x  )  const [inline, private]

Field Documentation

template<class T >
entry* addrRangeTree< T >::nil [private]
template<class T >
entry* addrRangeTree< T >::setData [private]
template<class T >
int addrRangeTree< T >::setSize [private]

The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 12 Jul 2013 for SymtabAPI by  doxygen 1.6.1