Stefan Scholz / ETL
Embed: (wiki syntax)

« Back to documentation index

map_base Class Reference

The base class for all maps. More...

#include <map.h>

Inherited by imap< TKey, TMapped, TKeyCompare >, and imap< TKey, TValue, TCompare >.

Data Structures

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

Public Types

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

Public Member Functions

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

Protected Member Functions

 map_base (size_type max_size_)
 The constructor that is called from derived classes.
void balance_node (Node *&critical_node)
 Balance the critical node at the position provided as needed.
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.
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 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.

Protected Attributes

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

Detailed Description

The base class for all maps.

Definition at line 125 of file map.h.


Member Typedef Documentation

typedef size_t size_type

The type used for determining the size of map.

Reimplemented in imap< TKey, TMapped, TKeyCompare >, and imap< TKey, TValue, TCompare >.

Definition at line 129 of file map.h.


Constructor & Destructor Documentation

map_base ( size_type  max_size_ ) [protected]

The constructor that is called from derived classes.

Definition at line 228 of file map.h.


Member Function Documentation

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

Attach the provided node to the position provided.

Definition at line 406 of file map.h.

size_t available (  ) const

Returns the remaining capacity.

Returns:
The remaining capacity.

Definition at line 176 of file map.h.

void balance_node ( Node *&  critical_node ) [protected]

Balance the critical node at the position provided as needed.

Definition at line 239 of file map.h.

size_type capacity (  ) const

Returns the capacity of the vector.

Returns:
The capacity of the vector.

Definition at line 167 of file map.h.

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

Detach the node at the position provided.

Definition at line 421 of file map.h.

bool empty (  ) const

Checks to see if the map is empty.

Definition at line 150 of file map.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 373 of file map.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 390 of file map.h.

bool full (  ) const

Checks to see if the map is full.

Definition at line 158 of file map.h.

size_type max_size (  ) const

Gets the maximum possible size of the map.

Definition at line 142 of file map.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 302 of file map.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 332 of file map.h.

size_type size (  ) const

Gets the size of the map.

Definition at line 134 of file map.h.


Field Documentation

const size_type CAPACITY [protected]

The maximum size of the map.

Definition at line 443 of file map.h.

size_type current_size [protected]

The number of the used nodes.

Definition at line 442 of file map.h.

Node* root_node [protected]

The node that acts as the map root.

Definition at line 444 of file map.h.