lab_btree
Belligerent BTrees
BTree< K, V >::DataPair Struct Reference

A fancy key-value pair which acts as elements in the BTree. More...

Public Member Functions

 DataPair (K key, V value)
 Constructs a DataPair from the given key and value. More...
 

Friends

bool operator< (const DataPair &lhs, const DataPair &rhs)
 Less than operator for a DataPair. More...
 
bool operator< (const DataPair &lhs, const K &rhs)
 Less than operator for a DataPair and a K. More...
 
bool operator< (const K &lhs, const DataPair &rhs)
 Less than operator for a K and a DataPair. More...
 
bool operator> (const DataPair &lhs, const DataPair &rhs)
 Greater than operator for a DataPair. More...
 
bool operator> (const K &lhs, const DataPair &rhs)
 Greater than operator for a K and a DataPair. More...
 
bool operator> (const DataPair &lhs, const K &rhs)
 Greater than operator for a DataPair and a K. More...
 
bool operator== (const DataPair &lhs, const DataPair &rhs)
 Equality operator for a DataPair. More...
 
bool operator== (const DataPair &lhs, const K &rhs)
 Equality operator for a DataPair and a K. More...
 
bool operator== (const K &lhs, const DataPair &rhs)
 Equality operator for a K and a DataPair. More...
 

Detailed Description

template<class K, class V>
struct BTree< K, V >::DataPair

A fancy key-value pair which acts as elements in the BTree.

Can be compared with <, >, ==. Additionally they can be compared against a K with <, > and == based on its key.

Constructor & Destructor Documentation

template<class K , class V >
BTree< K, V >::DataPair::DataPair ( key,
value 
)
inline

Constructs a DataPair from the given key and value.

Parameters
keyThe key of the pair.
valueThe value of the pair.

Friends And Related Function Documentation

template<class K , class V >
bool operator< ( const DataPair lhs,
const DataPair rhs 
)
friend

Less than operator for a DataPair.

One is less than another if its key is less than the other's key.

Parameters
lhsThe left hand of the < operator.
rhsThe right hand of the < operator.
Returns
true if lhs's key is less than rhs' key, false otherwise.
template<class K , class V >
bool operator< ( const DataPair lhs,
const K &  rhs 
)
friend

Less than operator for a DataPair and a K.

Parameters
lhsThe left hand side (DataPair) of the < operator.
rhsThe right hand side (K) of the < operator.
Returns
true if lhs's key is less than rhs, false otherwise.
template<class K , class V >
bool operator< ( const K &  lhs,
const DataPair rhs 
)
friend

Less than operator for a K and a DataPair.

Parameters
lhsThe left hand side (K) of the < operator.
rhsThe right hand side (DataPair) of the < operator.
Returns
true if lhs is less than rhs's key, false otherwise.
template<class K , class V >
bool operator> ( const DataPair lhs,
const DataPair rhs 
)
friend

Greater than operator for a DataPair.

One is greater than another if its key is greater than the other's key.

Parameters
lhsThe left hand of the > operator.
rhsThe right hand of the > operator.
Returns
true if lhs's key is greater than rhs's key, false otherwise.
template<class K , class V >
bool operator> ( const K &  lhs,
const DataPair rhs 
)
friend

Greater than operator for a K and a DataPair.

Parameters
lhsThe left hand side (K) of the > operator.
rhsThe right hand side (DataPair) of the > operator.
Returns
true if lhs is greater than rhs's key, false otherwise.
template<class K , class V >
bool operator> ( const DataPair lhs,
const K &  rhs 
)
friend

Greater than operator for a DataPair and a K.

Parameters
lhsThe left hand side (K) of the > operator.
rhsThe right hand side (DataPair) of the > operator.
Returns
true if lhs's key is greater than rhs, false otherwise.
template<class K , class V >
bool operator== ( const DataPair lhs,
const DataPair rhs 
)
friend

Equality operator for a DataPair.

One is equal to another if its key is equal to the other's key.

Parameters
lhsThe left hand of the > operator.
rhsThe right hand of the > operator.
Returns
true if lhs's key is greater than rhs's key, false otherwise.
template<class K , class V >
bool operator== ( const DataPair lhs,
const K &  rhs 
)
friend

Equality operator for a DataPair and a K.

Parameters
lhsThe left hand side (K) of the == operator.
rhsThe right hand side (DataPair) of the == operator.
Returns
true if lhs's key is equal to rhs, false otherwise.
template<class K , class V >
bool operator== ( const K &  lhs,
const DataPair rhs 
)
friend

Equality operator for a K and a DataPair.

Parameters
lhsThe left hand side (DataPair) of the == operator.
rhsThe right hand side (K) of the == operator.
Returns
true if lhs is equal to rhs's key, false otherwise.

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