IOobjectList Class Reference

List of IOobjects with searching and retrieving facilities. More...

Inheritance diagram for IOobjectList:
Collaboration diagram for IOobjectList:

Public Member Functions

 IOobjectList (const label nIoObjects=128)
 Construct given an initial estimate for the number of entries. More...
 
 IOobjectList (const objectRegistry &db, const fileName &instance, const fileName &local="", IOobject::readOption r=IOobject::MUST_READ, IOobject::writeOption w=IOobject::NO_WRITE, bool registerObject=true)
 Construct from objectRegistry and instance path. More...
 
 IOobjectList (const IOobjectList &)
 Copy constructor. More...
 
 ~IOobjectList ()
 Destructor. More...
 
bool add (IOobject &)
 Add an IOobject to the list. More...
 
bool remove (IOobject &)
 Remove an IOobject from the list. More...
 
IOobjectlookup (const word &name) const
 Lookup a given name and return IOobject ptr if found else nullptr. More...
 
IOobjectList lookup (const wordRe &name) const
 Return the list for all IOobects whose name matches name. More...
 
IOobjectList lookup (const wordReList &patterns) const
 Return the list for all IOobects whose name matches name. More...
 
IOobjectList lookupClass (const word &className) const
 Return the list for all IOobjects of a given class. More...
 
wordList names () const
 Return the list of names of the IOobjects. More...
 
wordList sortedNames () const
 Return the sorted list of names of the IOobjects. More...
 
wordList names (const word &className) const
 Return the list of names of the IOobjects of given class. More...
 
wordList sortedNames (const word &className) const
 Return the sorted list of names of the IOobjects of given class. More...
 
void operator= (const IOobjectList &)=delete
 Disallow default bitwise assignment. More...
 
- Public Member Functions inherited from HashPtrTable< IOobject >
 HashPtrTable (const label size=128)
 Construct given initial table size. More...
 
 HashPtrTable (Istream &, const INew &)
 Construct from Istream using given Istream constructor class. More...
 
 HashPtrTable (Istream &)
 Construct from Istream using default Istream constructor class. More...
 
 HashPtrTable (const dictionary &)
 Construct from dictionary using default dictionary constructor. More...
 
 HashPtrTable (const HashPtrTable< IOobject, word, string::hash > &)
 Copy constructor. More...
 
 HashPtrTable (HashPtrTable< IOobject, word, string::hash > &&)
 Move constructor. More...
 
 ~HashPtrTable ()
 Destructor. More...
 
IOobjectremove (iterator &)
 Remove and return the pointer specified by given iterator. More...
 
bool erase (iterator &)
 Erase an hashedEntry specified by given iterator. More...
 
void clear ()
 Clear all entries from table. More...
 
void write (Ostream &os) const
 Write. More...
 
void operator= (const HashPtrTable< IOobject, word, string::hash > &)
 Assignment operator. More...
 
void operator= (HashPtrTable< IOobject, word, string::hash > &&)
 Move assignment operator. More...
 
- Public Member Functions inherited from HashTable< T, Key, Hash >
 HashTable (const label size=128)
 Construct given initial table size. More...
 
 HashTable (Istream &, const label size=128)
 Construct from Istream. More...
 
 HashTable (const UList< Key > &keyList, const UList< T > &elmtList)
 Construct from a list of keys and list of elements. More...
 
 HashTable (const HashTable< T, Key, Hash > &)
 Copy constructor. More...
 
 HashTable (HashTable< T, Key, Hash > &&)
 Move constructor. More...
 
 HashTable (std::initializer_list< Tuple2< Key, 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 Key &) const
 Return true if hashedEntry is found in table. More...
 
iterator find (const Key &)
 Find and return an iterator set at the hashedEntry. More...
 
const_iterator find (const Key &) const
 Find and return an const_iterator set at the hashedEntry. More...
 
List< Key > toc () const
 Return the table of contents. More...
 
List< Key > sortedToc () const
 Return the table of contents as a sorted list. More...
 
List< const_iteratorsorted () const
 Return a sorted list of constant iterators. More...
 
OstreamprintInfo (Ostream &) const
 Print information. More...
 
bool insert (const Key &, const T &newElmt)
 Insert a new hashedEntry. More...
 
void insert (const HashTable< T, Key, Hash > &)
 Insert all the entries from the given HashTable. More...
 
bool set (const Key &, const T &newElmt)
 Set a new hashedEntry, overwriting existing entries. More...
 
void set (const HashTable< T, Key, Hash > &)
 Insert all the entries from the given HashTable,. More...
 
bool erase (const iterator &)
 Erase a hashedEntry specified by given iterator. More...
 
bool erase (const Key &)
 Erase a hashedEntry specified by the given key. More...
 
label erase (const UList< Key > &)
 Remove entries given by the listed keys from this HashTable. More...
 
template<class AnyType , class AnyHash >
label erase (const HashTable< AnyType, Key, AnyHash > &)
 Remove entries given by the given keys from this HashTable. More...
 
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, Key, Hash > &)
 Transfer the contents of the argument table into this table. More...
 
Toperator[] (const Key &)
 Find and return a hashedEntry. More...
 
const Toperator[] (const Key &) const
 Find and return a hashedEntry. More...
 
Toperator() (const Key &)
 Find and return a hashedEntry, create it null if not present. More...
 
void operator= (const HashTable< T, Key, Hash > &)
 Assignment operator. More...
 
void operator= (HashTable< T, Key, Hash > &&)
 Move assignment operator. More...
 
void operator= (std::initializer_list< Tuple2< Key, T >>)
 Assignment to an initialiser list. More...
 
bool operator== (const HashTable< T, Key, Hash > &) const
 Equality. Hash tables are equal if the keys and values are equal. More...
 
bool operator!= (const HashTable< T, Key, Hash > &) const
 The opposite of the equality operation. Takes linear time. More...
 
iterator begin ()
 Iterator set to the beginning of the HashTable. More...
 
const_iterator cbegin () const
 const_iterator set to the beginning of the HashTable More...
 
const_iterator begin () const
 const_iterator set to the beginning of the HashTable More...
 
template<class AnyType , class AnyHash >
Foam::label erase (const HashTable< AnyType, Key, AnyHash > &rhs)
 
- Public Member Functions inherited from HashTableCore
 HashTableCore ()
 Construct null. More...
 
 ClassName ("HashTable")
 Define template name and debug. More...
 

Additional Inherited Members

- Public Types inherited from HashPtrTable< IOobject >
typedef HashTable< IOobject *, word, string::hash >::iterator iterator
 
typedef HashTable< IOobject *, word, string::hash >::const_iterator const_iterator
 
- Public Types inherited from HashTable< T, Key, Hash >
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...
 
- 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

List of IOobjects with searching and retrieving facilities.

Source files

Definition at line 50 of file IOobjectList.H.

Constructor & Destructor Documentation

◆ IOobjectList() [1/3]

IOobjectList ( const label  nIoObjects = 128)
explicit

Construct given an initial estimate for the number of entries.

Definition at line 32 of file IOobjectList.C.

◆ IOobjectList() [2/3]

IOobjectList ( const objectRegistry db,
const fileName instance,
const fileName local = "",
IOobject::readOption  r = IOobject::MUST_READ,
IOobject::writeOption  w = IOobject::NO_WRITE,
bool  registerObject = true 
)

Construct from objectRegistry and instance path.

Definition at line 38 of file IOobjectList.C.

References Foam::fileHandler(), forAll, IOobject::headerOk(), HashTable< T, Key, Hash >::insert(), and fileOperation::readObjects().

Here is the call graph for this function:

◆ IOobjectList() [3/3]

IOobjectList ( const IOobjectList ioOL)

Copy constructor.

Definition at line 85 of file IOobjectList.C.

◆ ~IOobjectList()

Destructor.

Definition at line 93 of file IOobjectList.C.

Member Function Documentation

◆ add()

bool add ( IOobject io)

Add an IOobject to the list.

Definition at line 99 of file IOobjectList.C.

References Foam::vtkWriteOps::insert(), and IOobject::name().

Here is the call graph for this function:

◆ remove()

bool remove ( IOobject io)

Remove an IOobject from the list.

Definition at line 105 of file IOobjectList.C.

References erase(), HashTable< T *, word, string::hash >::find(), and IOobject::name().

Here is the call graph for this function:

◆ lookup() [1/3]

Foam::IOobject * lookup ( const word name) const

Lookup a given name and return IOobject ptr if found else nullptr.

Definition at line 121 of file IOobjectList.C.

References Foam::endl(), InfoInFunction, and Foam::name().

Here is the call graph for this function:

◆ lookup() [2/3]

Foam::IOobjectList lookup ( const wordRe name) const

Return the list for all IOobects whose name matches name.

Definition at line 146 of file IOobjectList.C.

References Foam::endl(), forAllConstIter, InfoInFunction, HashTable< T, Key, Hash >::insert(), string::match(), and Foam::name().

Here is the call graph for this function:

◆ lookup() [3/3]

Foam::IOobjectList lookup ( const wordReList patterns) const

Return the list for all IOobects whose name matches name.

Definition at line 167 of file IOobjectList.C.

References Foam::endl(), forAllConstIter, InfoInFunction, HashTable< T, Key, Hash >::insert(), wordReListMatcher::match(), and Foam::name().

Here is the call graph for this function:

◆ lookupClass()

Foam::IOobjectList lookupClass ( const word className) const

Return the list for all IOobjects of a given class.

Definition at line 190 of file IOobjectList.C.

References ClassName, Foam::endl(), forAllConstIter, InfoInFunction, and HashTable< T, Key, Hash >::insert().

Referenced by domainDecomposition::writeComplete(), and domainDecomposition::writeProcs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ names() [1/2]

Foam::wordList names ( ) const

Return the list of names of the IOobjects.

Definition at line 211 of file IOobjectList.C.

References HashTable< T *, word, string::hash >::toc().

Referenced by vtkPVFoam::addToSelection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sortedNames() [1/2]

Foam::wordList sortedNames ( ) const

Return the sorted list of names of the IOobjects.

Definition at line 217 of file IOobjectList.C.

References HashTable< T *, word, string::hash >::sortedToc().

Here is the call graph for this function:

◆ names() [2/2]

Foam::wordList names ( const word className) const

Return the list of names of the IOobjects of given class.

Definition at line 223 of file IOobjectList.C.

References ClassName, Foam::count(), forAllConstIter, and List< T >::setSize().

Here is the call graph for this function:

◆ sortedNames() [2/2]

Foam::wordList sortedNames ( const word className) const

Return the sorted list of names of the IOobjects of given class.

Definition at line 242 of file IOobjectList.C.

References ClassName, and Foam::sort().

Here is the call graph for this function:

◆ operator=()

void operator= ( const IOobjectList )
delete

Disallow default bitwise assignment.


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