Stefan Scholz / ETL
Embed: (wiki syntax)

« Back to documentation index

set_base Class Reference

The base class for all sets. More...

#include <set.h>

Inherited by iset< T, TCompare >.

Data Structures

struct  Node
 The node element in the set. More...

Public Types

typedef size_t size_type
 The type used for determining the size of set.

Public Member Functions

size_type size () const
 Gets the size of the set.
size_type max_size () const
 Gets the maximum possible size of the set.
bool empty () const
 Checks to see if the set is empty.
bool full () const
 Checks to see if the set is full.
size_type capacity () const
 Returns the capacity of the vector.
size_t available () const
 Returns the remaining capacity.

Protected Member Functions

 set_base (size_type max_size_)
 The constructor that is called from derived classes.
void attach_node (Node *&position, Node &node)
 Attach the provided node to the position provided.
void detach_node (Node *&position, Node *&replacement)
 Detach the node at the position provided.
void balance_node (Node *&critical_node)
 Balance the critical node at the position provided as needed.
Nodefind_limit_node (Node *position, const int8_t dir) const
 Find the node whose key would go before all the other keys from the position provided.
const Nodefind_limit_node (const Node *position, const int8_t dir) const
 Find the node whose key would go before all the other keys from the position provided.
void rotate_2node (Node *&position, uint_least8_t dir)
 Rotate two nodes at the position provided the to balance the tree.
void rotate_3node (Node *&position, uint_least8_t dir, uint_least8_t third)
 Rotate three nodes at the position provided the to balance the tree.

Protected Attributes

size_type current_size
 The number of the used nodes.
const size_type CAPACITY
 The maximum size of the set.
Noderoot_node
 The node that acts as the set root.

Detailed Description

The base class for all sets.

Definition at line 124 of file set.h.


Member Typedef Documentation

typedef size_t size_type

The type used for determining the size of set.

Reimplemented in iset< T, TCompare >.

Definition at line 128 of file set.h.


Constructor & Destructor Documentation

set_base ( size_type  max_size_ ) [protected]

The constructor that is called from derived classes.

Definition at line 222 of file set.h.


Member Function Documentation

void attach_node ( Node *&  position,
Node node 
) [protected]

Attach the provided node to the position provided.

Definition at line 233 of file set.h.

size_t available (  ) const

Returns the remaining capacity.

Returns:
The remaining capacity.

Definition at line 175 of file set.h.

void balance_node ( Node *&  critical_node ) [protected]

Balance the critical node at the position provided as needed.

Definition at line 272 of file set.h.

size_type capacity (  ) const

Returns the capacity of the vector.

Returns:
The capacity of the vector.

Definition at line 166 of file set.h.

void detach_node ( Node *&  position,
Node *&  replacement 
) [protected]

Detach the node at the position provided.

Definition at line 248 of file set.h.

bool empty (  ) const

Checks to see if the set is empty.

Definition at line 149 of file set.h.

Node* find_limit_node ( Node position,
const int8_t  dir 
) const [protected]

Find the node whose key would go before all the other keys from the position provided.

Definition at line 336 of file set.h.

const Node* find_limit_node ( const Node position,
const int8_t  dir 
) const [protected]

Find the node whose key would go before all the other keys from the position provided.

Definition at line 353 of file set.h.

bool full (  ) const

Checks to see if the set is full.

Definition at line 157 of file set.h.

size_type max_size (  ) const

Gets the maximum possible size of the set.

Definition at line 141 of file set.h.

void rotate_2node ( Node *&  position,
uint_least8_t  dir 
) [protected]

Rotate two nodes at the position provided the to balance the tree.

Definition at line 369 of file set.h.

void rotate_3node ( Node *&  position,
uint_least8_t  dir,
uint_least8_t  third 
) [protected]

Rotate three nodes at the position provided the to balance the tree.

Definition at line 399 of file set.h.

size_type size (  ) const

Gets the size of the set.

Definition at line 133 of file set.h.


Field Documentation

const size_type CAPACITY [protected]

The maximum size of the set.

Definition at line 437 of file set.h.

size_type current_size [protected]

The number of the used nodes.

Definition at line 436 of file set.h.

Node* root_node [protected]

The node that acts as the set root.

Definition at line 438 of file set.h.