All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Map< T > Class Template Reference

A HashTable to objects of type <T> with a label key. More...

Inheritance diagram for Map< T >:
Collaboration diagram for Map< T >:

Public Types

typedef HashTable< T, label, Hash< label > >::iterator iterator
 
typedef HashTable< T, label, Hash< label > >::const_iterator const_iterator
 
- Public Types inherited from HashTable< T, label, Hash< label > >
typedef T value_type
 Type of values the HashTable contains. More...
 
typedef Treference
 Type that can be used for storing into HashTable::value_type. More...
 
typedef const Tconst_reference
 Type that can be used for storing into constant. More...
 
typedef label size_type
 The type that can represent the size of a HashTable. More...
 

Public Member Functions

 Map (const label size=128)
 Construct given initial size. More...
 
 Map (Istream &is)
 Construct from Istream. More...
 
 Map (const Map< T > &map)
 Copy constructor. More...
 
 Map (Map< T > &&map)
 Move constructor. More...
 
 Map (HashTable< T, label, Hash< label >> &&map)
 Move constructor. More...
 
 Map (std::initializer_list< Tuple2< label, T >> map)
 Construct from an initialiser list. More...
 
void operator= (const Map< T > &map)
 
void operator= (Map< T > &&map)
 
- Public Member Functions inherited from HashTable< T, label, Hash< label > >
bool set (const label &, const T &newElmt)
 Assign a new hashedEntry, overwriting existing entries. More...
 
 HashTable (const label size=128)
 Construct given initial table size. More...
 
 HashTable (Istream &, const label size=128)
 Construct from Istream. More...
 
 HashTable (const HashTable< T, label, Hash< label > > &)
 Copy constructor. More...
 
 HashTable (HashTable< T, label, Hash< label > > &&)
 Move constructor. More...
 
 HashTable (std::initializer_list< Tuple2< label, T >>)
 Construct from an initialiser list. More...
 
 ~HashTable ()
 Destructor. More...
 
label capacity () const
 The size of the underlying table. More...
 
label size () const
 Return number of elements in table. More...
 
bool empty () const
 Return true if the hash table is empty. More...
 
bool found (const label &) const
 Return true if hashedEntry is found in table. More...
 
iterator find (const label &)
 Find and return an iterator set at the hashedEntry. More...
 
const_iterator find (const label &) const
 Find and return an const_iterator set at the hashedEntry. More...
 
List< labeltoc () const
 Return the table of contents. More...
 
List< labelsortedToc () const
 Return the table of contents as a sorted list. More...
 
OstreamprintInfo (Ostream &) const
 Print information. More...
 
bool insert (const label &, const T &newElmt)
 Insert a new hashedEntry. More...
 
bool erase (const iterator &)
 Erase a hashedEntry specified by given iterator. More...
 
bool erase (const label &)
 Erase a hashedEntry specified by the given key. More...
 
label erase (const UList< label > &)
 Remove entries given by the listed keys from this HashTable. More...
 
label erase (const HashTable< AnyType, label, AnyHash > &)
 Remove entries given by the given keys from this HashTable. More...
 
Foam::label erase (const HashTable< AnyType, label, AnyHash > &rhs)
 
void resize (const label newSize)
 Resize the hash table for efficiency. More...
 
void clear ()
 Clear all entries from table. More...
 
void clearStorage ()
 Clear the table entries and the table itself. More...
 
void shrink ()
 Shrink the allocated table to approx. twice number of elements. More...
 
void transfer (HashTable< T, label, Hash< label > > &)
 Transfer the contents of the argument table into this table. More...
 
Toperator[] (const label &)
 Find and return a hashedEntry. More...
 
const Toperator[] (const label &) const
 Find and return a hashedEntry. More...
 
Toperator() (const label &)
 Find and return a hashedEntry, create it null if not present. More...
 
void operator= (const HashTable< T, label, Hash< label > > &)
 Assignment operator. More...
 
void operator= (HashTable< T, label, Hash< label > > &&)
 Move assignment operator. More...
 
void operator= (std::initializer_list< Tuple2< label, T >>)
 Assignment to an initialiser list. More...
 
bool operator== (const HashTable< T, label, Hash< label > > &) const
 Equality. Hash tables are equal if the keys and values are equal. More...
 
bool operator!= (const HashTable< T, label, Hash< label > > &) const
 The opposite of the equality operation. Takes linear time. More...
 
iterator begin ()
 Iterator set to the beginning of the HashTable. More...
 
const_iterator begin () const
 const_iterator set to the beginning of the HashTable More...
 
const_iterator cbegin () const
 const_iterator set to the beginning of the HashTable More...
 
- Public Member Functions inherited from HashTableCore
 HashTableCore ()
 Construct null. More...
 
 ClassName ("HashTable")
 Define template name and debug. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from HashTableCore
static label canonicalSize (const label)
 Return a canonical (power-of-two) size. More...
 
static iteratorEnd cend ()
 iteratorEnd set to beyond the end of any HashTable More...
 
static iteratorEnd end ()
 iteratorEnd set to beyond the end of any HashTable More...
 
- Static Public Attributes inherited from HashTableCore
static const label maxTableSize
 Maximum allowable table size. More...
 

Detailed Description

template<class T>
class Foam::Map< T >

A HashTable to objects of type <T> with a label key.

See also
PtrMap

Definition at line 49 of file Map.H.

Member Typedef Documentation

◆ iterator

Definition at line 56 of file Map.H.

◆ const_iterator

Definition at line 59 of file Map.H.

Constructor & Destructor Documentation

◆ Map() [1/6]

Map ( const label  size = 128)
inline

Construct given initial size.

Definition at line 64 of file Map.H.

◆ Map() [2/6]

Map ( Istream is)
inline

Construct from Istream.

Definition at line 70 of file Map.H.

◆ Map() [3/6]

Map ( const Map< T > &  map)
inline

Copy constructor.

Definition at line 76 of file Map.H.

◆ Map() [4/6]

Map ( Map< T > &&  map)
inline

Move constructor.

Definition at line 82 of file Map.H.

◆ Map() [5/6]

Map ( HashTable< T, label, Hash< label >> &&  map)
inline

Move constructor.

Definition at line 88 of file Map.H.

◆ Map() [6/6]

Map ( std::initializer_list< Tuple2< label, T >>  map)
inline

Construct from an initialiser list.

Definition at line 94 of file Map.H.

Member Function Documentation

◆ operator=() [1/2]

void operator= ( const Map< T > &  map)
inline

Definition at line 102 of file Map.H.

Referenced by IOMap< T >::IOMap(), IOMap< T >::operator=(), distribution::operator=(), boundaryRegion::operator=(), and cellTable::operator=().

Here is the caller graph for this function:

◆ operator=() [2/2]

void operator= ( Map< T > &&  map)
inline

Definition at line 107 of file Map.H.


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