CoMMA 1.3.2
A geometric agglomerator for unstructured meshes
Loading...
Searching...
No Matches
comma::Bimap< A, B > Class Template Reference

An easy and straight forward implementation of a Bimap. More...

#include <Bimap.h>

Public Member Functions

 Bimap ()=default
 Constructor. More...
 
 ~Bimap ()=default
 Destructor. More...
 
void insert (const A &a, const B &b)
 Insertion function in the Bimap. More...
 
void print ()
 Function to print the map. More...
 
void update_nodeB (const A &a_old, const A &a_new)
 Update of the key of the map B and hence the value of the node A. More...
 
void update_nodeA (const B &b_old, const B &b_new)
 Update of the key of the map A and hence the value of the node B. More...
 
get_B (const A &a)
 Getter of the B value starting from a A value. More...
 
get_A (const B &b)
 Getter of the A value starting from a B value. More...
 
void erase_B (const A &a)
 Eraser of the value starting from a A value. More...
 
bool empty ()
 Check if the Bimap is empty. More...
 
size_t lung ()
 Returns the size of the container. More...
 

Protected Attributes

std::map< B, const A * > _mapA
 Left map
More...
 
std::map< A, const B * > _mapB
 Right map. More...
 

Detailed Description

template<typename A, typename B>
class comma::Bimap< A, B >

An easy and straight forward implementation of a Bimap.

Constructor & Destructor Documentation

◆ Bimap()

template<typename A , typename B >
comma::Bimap< A, B >::Bimap ( )
default

Constructor.

◆ ~Bimap()

template<typename A , typename B >
comma::Bimap< A, B >::~Bimap ( )
default

Destructor.

Member Function Documentation

◆ empty()

template<typename A , typename B >
bool comma::Bimap< A, B >::empty ( )
inline

Check if the Bimap is empty.

Returns
a boolean

◆ erase_B()

template<typename A , typename B >
void comma::Bimap< A, B >::erase_B ( const A &  a)
inline

Eraser of the value starting from a A value.

Parameters
[in]athe associated value we want to search in order to delete the relative entry

◆ get_A()

template<typename A , typename B >
A comma::Bimap< A, B >::get_A ( const B &  b)
inline

Getter of the A value starting from a B value.

Parameters
[in]bthe associated value we want to search
Returns
the value associated to b

◆ get_B()

template<typename A , typename B >
B comma::Bimap< A, B >::get_B ( const A &  a)
inline

Getter of the B value starting from a A value.

Parameters
[in]athe associated value we want to search
Returns
the value associated to a

◆ insert()

template<typename A , typename B >
void comma::Bimap< A, B >::insert ( const A &  a,
const B &  b 
)
inline

Insertion function in the Bimap.

Parameters
[in]aelement A to add
[in]belement B to add

◆ lung()

template<typename A , typename B >
size_t comma::Bimap< A, B >::lung ( )
inline

Returns the size of the container.

Returns
the size

◆ print()

template<typename A , typename B >
void comma::Bimap< A, B >::print ( )
inline

Function to print the map.

◆ update_nodeA()

template<typename A , typename B >
void comma::Bimap< A, B >::update_nodeA ( const B &  b_old,
const B &  b_new 
)
inline

Update of the key of the map A and hence the value of the node B.

Parameters
[in]b_oldthe old value of the node B (in case you do not know you can find it through the find.
[in]b_newthe new value we want to attribute to the node B.

◆ update_nodeB()

template<typename A , typename B >
void comma::Bimap< A, B >::update_nodeB ( const A &  a_old,
const A &  a_new 
)
inline

Update of the key of the map B and hence the value of the node A.

Parameters
[in]a_oldthe old value of the node A (in case you do not know you can find it through the find.
[in]a_newthe new value we want to attribute to the node A.

Member Data Documentation

◆ _mapA

template<typename A , typename B >
std::map<B, const A *> comma::Bimap< A, B >::_mapA
protected

Left map

◆ _mapB

template<typename A , typename B >
std::map<A, const B *> comma::Bimap< A, B >::_mapB
protected

Right map.


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