cgma
|
#include <OrderedMap.hpp>
Public Member Functions | |
OrderedMap (void) | |
bool | find (X key, Y *data=NULL) const |
bool | insert (X new_key, Y new_data) |
void | erase (X key_to_erase) |
void | erase_iter (int iter_to_erase) |
X | first (int iter) const |
Y | second (int iter) const |
bool | empty (void) const |
int | size (void) const |
void | clean_out (void) |
OrderedMap< X, Y > & | operator= (const OrderedMap< X, Y > &from) |
Y | operator[] (X key) const |
Private Attributes | |
DLIList< X > | mList1 |
std::map< X, Y > | mMap |
Definition at line 20 of file OrderedMap.hpp.
OrderedMap< X, Y >::OrderedMap | ( | void | ) | [inline] |
Definition at line 28 of file OrderedMap.hpp.
{};
void OrderedMap< X, Y >::clean_out | ( | void | ) | [inline] |
Definition at line 94 of file OrderedMap.hpp.
bool OrderedMap< X, Y >::empty | ( | void | ) | const [inline] |
Definition at line 91 of file OrderedMap.hpp.
{ return ( mList1.size() == 0 ? CUBIT_TRUE : CUBIT_FALSE ); };
void OrderedMap< X, Y >::erase | ( | X | key_to_erase | ) | [inline] |
void OrderedMap< X, Y >::erase_iter | ( | int | iter_to_erase | ) | [inline] |
Definition at line 30 of file OrderedMap.hpp.
{ typename std::map<X,Y>::const_iterator iter = mMap.find( key ); if ( iter == mMap.end() ) { return CUBIT_FALSE; } if ( data ) { *data = iter->second; } return CUBIT_TRUE; };
X OrderedMap< X, Y >::first | ( | int | iter | ) | const [inline] |
Definition at line 79 of file OrderedMap.hpp.
{ return mList1[iter]; }
Definition at line 46 of file OrderedMap.hpp.
{ if ( !find( new_key ) ) { mList1.append( new_key ); mMap.insert( std::pair<X,Y>( new_key, new_data ) ); return CUBIT_TRUE; } return CUBIT_FALSE; };
OrderedMap<X,Y>& OrderedMap< X, Y >::operator= | ( | const OrderedMap< X, Y > & | from | ) | [inline] |
Y OrderedMap< X, Y >::operator[] | ( | X | key | ) | const [inline] |
Definition at line 112 of file OrderedMap.hpp.
Y OrderedMap< X, Y >::second | ( | int | iter | ) | const [inline] |
Definition at line 83 of file OrderedMap.hpp.
int OrderedMap< X, Y >::size | ( | void | ) | const [inline] |
Definition at line 92 of file OrderedMap.hpp.
{ return mList1.size(); };
Definition at line 23 of file OrderedMap.hpp.
Definition at line 24 of file OrderedMap.hpp.