MDList
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
MDList< T > Class Template Reference

MDList class MDList is a dictionary based datastruture which stores (key, value) pairs. More...

#include <mdlist.h>

Public Member Functions

 MDList (int, ULL)
 MDList constructor. More...
 
void insert (ULL, T)
 Insert (key, value) to MDList. More...
 
T find (ULL)
 Searches for given key. More...
 
T remove (ULL)
 Removes the given key. More...
 

Private Member Functions

pair< Node< T > *, Node< T > * > locatePredecessor (vector< int >)
 Locate Predecessor/Parent of given coordinates. More...
 

Private Attributes

int D
 The D value of MDList. More...
 
ULL N
 The key space. More...
 
Node< T > * root
 Head or Root of the MDList. More...
 

Friends

template<class _T >
void printMDList (MDList< _T >)
 
template<class _T >
void findAndPrint (MDList< _T >, ULL)
 

Detailed Description

template<class T>
class MDList< T >

MDList class MDList is a dictionary based datastruture which stores (key, value) pairs.

It has a root node. Opoerations performed on a MDList are insert, find, remove. MDList is Lock-Free datastructure, so it is thread safe.

Constructor & Destructor Documentation

◆ MDList()

template<class T >
MDList< T >::MDList ( int  D,
ULL  N 
)

MDList constructor.

Parameters
DThe D value of MDList.
NThe key space.

Member Function Documentation

◆ find()

template<class T >
T MDList< T >::find ( ULL  key)

Searches for given key.

Parameters
keyThe key.
Returns
The value if key is present else NULL.

◆ insert()

template<class T >
void MDList< T >::insert ( ULL  key,
T  val 
)

Insert (key, value) to MDList.

Parameters
keyThe key.
valThe value.

◆ locatePredecessor()

template<class T >
pair< Node< T > *, Node< T > * > MDList< T >::locatePredecessor ( vector< int >  coordinates)
private

Locate Predecessor/Parent of given coordinates.

Parameters
coordinatesThe given coordinates.
Returns
Pair(predecessor, current) where predecessor is parent of current.

◆ remove()

template<class T >
T MDList< T >::remove ( ULL  key)

Removes the given key.

Parameters
keyThe key.
Returns
The value if key present and removed else NULL.

Friends And Related Function Documentation

◆ findAndPrint

template<class T>
template<class _T >
void findAndPrint ( MDList< _T >  ,
ULL   
)
friend

◆ printMDList

template<class T>
template<class _T >
void printMDList ( MDList< _T >  )
friend

Member Data Documentation

◆ D

template<class T>
int MDList< T >::D
private

The D value of MDList.

◆ N

template<class T>
ULL MDList< T >::N
private

The key space.

◆ root

template<class T>
Node<T>* MDList< T >::root
private

Head or Root of the MDList.


The documentation for this class was generated from the following file: