Stefan Scholz / ETL
Embed: (wiki syntax)

« Back to documentation index

multiset_base Class Reference

The base class for all sets. More...

#include <multiset.h>

Inherited by imultiset< T, TCompare >.

Data Structures

struct  Node
 The node element in the multiset. 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

 multiset_base (size_type max_size_)
 The constructor that is called from derived classes.
void attach_node (Node *parent, 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.
void next_node (Node *&position) const
 Find the next node in sequence from the node provided.
void next_node (const Node *&position) const
 Find the next node in sequence from the node provided.
void prev_node (Node *&position) const
 Find the previous node in sequence from the node provided.
void prev_node (const Node *&position) const
 Find the previous node in sequence from the node 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 multiset root.

Detailed Description

The base class for all sets.

Definition at line 123 of file multiset.h.


Member Typedef Documentation

typedef size_t size_type

The type used for determining the size of set.

Reimplemented in imultiset< T, TCompare >.

Definition at line 127 of file multiset.h.


Constructor & Destructor Documentation

multiset_base ( size_type  max_size_ ) [protected]

The constructor that is called from derived classes.

Definition at line 223 of file multiset.h.


Member Function Documentation

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

Attach the provided node to the position provided.

Definition at line 233 of file multiset.h.

size_t available (  ) const

Returns the remaining capacity.

Returns:
The remaining capacity.

Definition at line 174 of file multiset.h.

void balance_node ( Node *&  critical_node ) [protected]

Balance the critical node at the position provided as needed.

Definition at line 284 of file multiset.h.

size_type capacity (  ) const

Returns the capacity of the vector.

Returns:
The capacity of the vector.

Definition at line 165 of file multiset.h.

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

Detach the node at the position provided.

Definition at line 251 of file multiset.h.

bool empty (  ) const

Checks to see if the set is empty.

Definition at line 148 of file multiset.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 348 of file multiset.h.

bool full (  ) const

Checks to see if the set is full.

Definition at line 156 of file multiset.h.

size_type max_size (  ) const

Gets the maximum possible size of the set.

Definition at line 140 of file multiset.h.

void next_node ( Node *&  position ) const [protected]

Find the next node in sequence from the node provided.

Definition at line 364 of file multiset.h.

void next_node ( const Node *&  position ) const [protected]

Find the next node in sequence from the node provided.

Definition at line 396 of file multiset.h.

void prev_node ( Node *&  position ) const [protected]

Find the previous node in sequence from the node provided.

Definition at line 428 of file multiset.h.

void prev_node ( const Node *&  position ) const [protected]

Find the previous node in sequence from the node provided.

Definition at line 466 of file multiset.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 504 of file multiset.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 545 of file multiset.h.

size_type size (  ) const

Gets the size of the set.

Definition at line 132 of file multiset.h.


Field Documentation

const size_type CAPACITY [protected]

The maximum size of the set.

Definition at line 599 of file multiset.h.

size_type current_size [protected]

The number of the used nodes.

Definition at line 598 of file multiset.h.

Node* root_node [protected]

The node that acts as the multiset root.

Definition at line 600 of file multiset.h.