FreeFOAM The Cross-Platform CFD Toolkit
PtrMap< T > Class Template Reference

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

#include <OpenFOAM/PtrMap.H>


Detailed Description

template<class T>
class Foam::PtrMap< T >

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

See also:
Map, HashPtrTable

Definition at line 50 of file PtrMap.H.

+ Inheritance diagram for PtrMap< T >:
+ Collaboration diagram for PtrMap< T >:

List of all members.

Public Member Functions

 PtrMap (const label size=128)
 Construct given initial map size.
 PtrMap (Istream &is)
 Construct from Istream.
 PtrMap (const PtrMap< T > &map)
 Construct as copy.
- Public Member Functions inherited from HashPtrTable< T, label, Hash< label > >
 HashPtrTable (const label size=128)
 Construct given initial table size.
 HashPtrTable (Istream &, const INew &)
 Construct from Istream using given Istream constructor class.
 HashPtrTable (Istream &)
 Construct from Istream using default Istream constructor class.
 HashPtrTable (const HashPtrTable< T, label, Hash< label > > &)
 Construct as copy.
 ~HashPtrTable ()
Tremove (iterator &)
 Remove and return the pointer specified by given iterator.
bool erase (iterator &)
 Erase an hashedEntry specified by given iterator.
void clear ()
 Clear all entries from table.
void operator= (const HashPtrTable< T, label, Hash< label > > &)
- Public Member Functions inherited from HashTable< T *, label, Hash< label > >
bool set (const label &, const T *&newElmt)
 Assign a new hashedEntry, overwriting existing entries.
 HashTable (const label size=128)
 Construct given initial table size.
 HashTable (Istream &, const label size=128)
 Construct from Istream.
 HashTable (const HashTable< T *, label, Hash< label > > &)
 Construct as copy.
 HashTable (const Xfer< HashTable< T *, label, Hash< label > > > &)
 Construct by transferring the parameter contents.
 ~HashTable ()
label size () const
 Return number of elements in table.
bool empty () const
 Return true if the hash table is empty.
bool found (const label &) const
 Return true if hashedEntry is found in table.
iterator find (const label &)
 Find and return an iterator set at the hashedEntry.
const_iterator find (const label &) const
 Find and return an const_iterator set at the hashedEntry.
List< label > toc () const
 Return the table of contents.
List< label > sortedToc () const
 Return the table of contents as a sorted list.
OstreamprintInfo (Ostream &) const
 Print information.
bool insert (const label &, const T *&newElmt)
 Insert a new hashedEntry.
bool erase (const iterator &)
 Erase an hashedEntry specified by given iterator.
bool erase (const label &)
 Erase an hashedEntry specified by given key if in table.
label erase (const UList< label > &)
 Remove entries given by the listed keys from this HashTable.
label erase (const HashTable< AnyType, label, AnyHash > &)
 Remove entries given by the given keys from this HashTable.
void resize (const label newSize)
 Resize the hash table for efficiency.
void clearStorage ()
 Clear the table entries and the table itself.
void transfer (HashTable< T *, label, Hash< label > > &)
 Transfer the contents of the argument table into this table.
Xfer< HashTable< T *, label,
Hash< label > > > 
xfer ()
 Transfer contents to the Xfer container.
T *& operator[] (const label &)
 Find and return an hashedEntry.
const T *& operator[] (const label &) const
 Find and return an hashedEntry.
T *& operator() (const label &)
 Find and return an hashedEntry, create it null if not present.
void operator= (const HashTable< T *, label, Hash< label > > &)
 Assignment.
bool operator== (const HashTable< T *, label, Hash< label > > &) const
 Equality. Two hash tables are equal if all contents of first are.
bool operator!= (const HashTable< T *, label, Hash< label > > &) const
 The opposite of the equality operation. Takes linear time.
iterator begin ()
 iterator set to the begining of the HashTable
const_iterator begin () const
 const_iterator set to the beginning of the HashTable
const iterator & end ()
 iterator set to beyond the end of the HashTable
const const_iterator & end () const
 const_iterator set to beyond the end of the HashTable
const_iterator cbegin () const
 const_iterator set to the beginning of the HashTable
const const_iterator & cend () const
 const_iterator set to beyond the end of the HashTable

Additional Inherited Members

- Public Types inherited from HashPtrTable< T, label, Hash< label > >
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 Tvalue_type
 Type of values the HashTable contains.
typedef T *& reference
 Type that can be used for storing into HashTable::value_type.
typedef const T *& const_reference
 Type that can be used for storing into constant.
typedef label size_type
 The type that can represent the size of a HashTable.

Constructor & Destructor Documentation

PtrMap ( const label  size = 128)
inline

Construct given initial map size.

Definition at line 60 of file PtrMap.H.

PtrMap ( Istream is)
inline

Construct from Istream.

Definition at line 66 of file PtrMap.H.

PtrMap ( const PtrMap< T > &  map)
inline

Construct as copy.

Definition at line 72 of file PtrMap.H.


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