diff --git a/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.H b/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.H index de85df3bd6..611a7d1476 100644 --- a/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.H +++ b/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.H @@ -51,10 +51,10 @@ class Ostream; template class HashPtrTable; template -Istream& operator>>(Istream&, HashPtrTable&); +Istream& operator>>(Istream& is, HashPtrTable& L); template -Ostream& operator<<(Ostream&, const HashPtrTable&); +Ostream& operator<<(Ostream& os, const HashPtrTable& L); /*---------------------------------------------------------------------------*\ @@ -96,8 +96,7 @@ public: //- Construct from Istream using default Istream constructor class HashPtrTable(Istream& is); - //- Construct from dictionary using default dictionary constructor - // class + //- Construct from dictionary with default dictionary constructor class HashPtrTable(const dictionary& dict); //- Construct as copy @@ -135,14 +134,14 @@ public: friend Istream& operator>> ( - Istream&, - HashPtrTable& + Istream& is, + HashPtrTable& L ); friend Ostream& operator<< ( - Ostream&, - const HashPtrTable& + Ostream& os, + const HashPtrTable& L ); }; diff --git a/src/OpenFOAM/containers/HashTables/HashSet/HashSet.H b/src/OpenFOAM/containers/HashTables/HashSet/HashSet.H index 3328ac65b2..437ca74eb6 100644 --- a/src/OpenFOAM/containers/HashTables/HashSet/HashSet.H +++ b/src/OpenFOAM/containers/HashTables/HashSet/HashSet.H @@ -83,7 +83,7 @@ public: {} //- Construct from UList of Key - HashSet(const UList&); + HashSet(const UList& lst); //- Construct from an initializer list of Key HashSet(std::initializer_list); @@ -109,7 +109,7 @@ public: //- Construct from the keys of another HashTable, // the type of values held is arbitrary. template - HashSet(const HashTable&); + HashSet(const HashTable& h); // Member Functions @@ -158,24 +158,24 @@ public: // Member Operators //- Return true if the entry exists, same as found() - inline bool operator[](const Key&) const; + inline bool operator[](const Key& key) const; - //- Equality. Two hashtables are equal when their contents are equal. + //- Equality. Two hashset are equal when they have the same keys. // Independent of table size or order. - bool operator==(const HashSet&) const; + bool operator==(const HashSet& rhs) const; //- The opposite of the equality operation. - bool operator!=(const HashSet&) const; + bool operator!=(const HashSet& rhs) const; //- Combine entries from HashSets - void operator|=(const HashSet&); + void operator|=(const HashSet& rhs); //- Only retain entries found in both HashSets - void operator&=(const HashSet&); + void operator&=(const HashSet& rhs); //- Only retain unique entries (xor) - void operator^=(const HashSet&); + void operator^=(const HashSet& rhs); //- Add entries listed in the given HashSet to this HashSet inline void operator+=(const HashSet& rhs) @@ -184,7 +184,7 @@ public: } //- Remove entries listed in the given HashSet from this HashSet - void operator-=(const HashSet&); + void operator-=(const HashSet& rhs); }; diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C index 0c5df4c034..eebdde2519 100644 --- a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C +++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C @@ -397,7 +397,7 @@ Foam::label Foam::HashTable::erase(const UList& keys) { if (erase(keys[keyI])) { - count++; + ++count; } } @@ -420,7 +420,7 @@ Foam::label Foam::HashTable::erase { if (rhs.found(iter.key()) && erase(iter)) { - count++; + ++count; } } diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H index cc32bf9fd0..d12c8929c1 100644 --- a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H +++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H @@ -67,10 +67,10 @@ template class Tuple2; template -Istream& operator>>(Istream&, HashTable&); +Istream& operator>>(Istream& is, HashTable& L); template -Ostream& operator<<(Ostream&, const HashTable&); +Ostream& operator<<(Ostream& os, const HashTable& L); /*---------------------------------------------------------------------------*\ @@ -81,7 +81,7 @@ Ostream& operator<<(Ostream&, const HashTable&); struct HashTableCore { //- Return a canonical (power-of-two) size - static label canonicalSize(const label); + static label canonicalSize(const label size); //- Maximum allowable table size static const label maxTableSize; @@ -165,15 +165,12 @@ class HashTable // Private Member Functions - //- Return a canonical (power-of-two) size - static label canonicalSize(const label); - //- Return the hash index of the Key within the current table size. // No checks for zero-sized tables. - inline label hashKeyIndex(const Key&) const; + inline label hashKeyIndex(const Key& key) const; //- Assign a new hashedEntry to a possibly already existing key - bool set(const Key&, const T& newElmt, bool protect); + bool set(const Key& key, const T& newEntry, const bool protect); public: @@ -207,13 +204,13 @@ public: HashTable(Istream&, const label size = 128); //- Construct as copy - HashTable(const HashTable&); + HashTable(const HashTable& ht); //- Construct by transferring the parameter contents - HashTable(const Xfer>&); + HashTable(const Xfer>& ht); //- Construct from an initializer list - HashTable(std::initializer_list>); + HashTable(std::initializer_list> lst); //- Destructor @@ -234,15 +231,15 @@ public: inline bool empty() const; //- Return true if hashedEntry is found in table - bool found(const Key&) const; + bool found(const Key& key) const; //- Find and return an iterator set at the hashedEntry // If not found iterator = end() - iterator find(const Key&); + iterator find(const Key& key); //- Find and return an const_iterator set at the hashedEntry // If not found iterator = end() - const_iterator find(const Key&) const; + const_iterator find(const Key& key) const; //- Return the table of contents List toc() const; @@ -251,37 +248,37 @@ public: List sortedToc() const; //- Print information - Ostream& printInfo(Ostream&) const; + Ostream& printInfo(Ostream& os) const; // Edit //- Insert a new hashedEntry - inline bool insert(const Key&, const T& newElmt); + inline bool insert(const Key& key, const T& newEntry); //- Assign a new hashedEntry, overwriting existing entries - inline bool set(const Key&, const T& newElmt); + inline bool set(const Key& key, const T& newEntry); //- Erase a hashedEntry specified by given iterator // This invalidates the iterator until the next operator++ - bool erase(const iterator&); + bool erase(const iterator& iter); //- Erase a hashedEntry specified by the given key - bool erase(const Key&); + bool erase(const Key& key); //- Remove entries given by the listed keys from this HashTable // Return the number of elements removed - label erase(const UList&); + label erase(const UList& keys); //- Remove entries given by the given keys from this HashTable // Return the number of elements removed. // The parameter HashTable needs the same type of key, but the // type of values held and the hashing function are arbitrary. template - label erase(const HashTable&); + label erase(const HashTable& rhs); //- Resize the hash table for efficiency - void resize(const label newSize); + void resize(const label sz); //- Clear all entries from table void clear(); @@ -295,7 +292,7 @@ public: //- Transfer the contents of the argument table into this table // and annul the argument table. - void transfer(HashTable&); + void transfer(HashTable& ht); //- Transfer contents to the Xfer container inline Xfer> xfer(); @@ -304,26 +301,26 @@ public: // Member Operators //- Find and return a hashedEntry - inline T& operator[](const Key&); + inline T& operator[](const Key& key); //- Find and return a hashedEntry - inline const T& operator[](const Key&) const; + inline const T& operator[](const Key& key) const; //- Find and return a hashedEntry, create it null if not present - inline T& operator()(const Key&); + inline T& operator()(const Key& key); //- Assignment - void operator=(const HashTable&); + void operator=(const HashTable& rhs); //- Assignment to an initializer list - void operator=(std::initializer_list>); + void operator=(std::initializer_list> lst); //- Equality. Hash tables are equal if the keys and values are equal. // Independent of table storage size and table order. - bool operator==(const HashTable&) const; + bool operator==(const HashTable& rhs) const; //- The opposite of the equality operation. Takes linear time. - bool operator!=(const HashTable&) const; + bool operator!=(const HashTable& rhs) const; @@ -357,7 +354,7 @@ public: // Private Data //- Pointer to the HashTable for which this is an iterator - // This also lets us use the default bitwise copy/assignment + // This allows use of the default bitwise copy/assignment HashTable* hashTable_; //- Current element @@ -377,13 +374,13 @@ public: //- Construct from hash table, moving to its 'begin' position inline explicit iteratorBase ( - const HashTable* curHashTable + const HashTable* hashTbl ); //- Construct from hash table, element and hash index inline iteratorBase ( - const HashTable* curHashTable, + const HashTable* hashTbl, const hashedEntry* elmt, const label hashIndex ); @@ -404,7 +401,7 @@ public: // Member operators - // Access + // Access //- Return the Key corresponding to the iterator inline const Key& key() const; @@ -413,8 +410,8 @@ public: inline const T& cobject() const; //- Compare hashedEntry element pointers - inline bool operator==(const iteratorBase&) const; - inline bool operator!=(const iteratorBase&) const; + inline bool operator==(const iteratorBase& iter) const; + inline bool operator!=(const iteratorBase& iter) const; //- Compare hashedEntry to iteratorEnd pointers inline bool operator==(const iteratorEnd& unused) const; @@ -434,13 +431,13 @@ public: //- Construct from hash table, moving to its 'begin' position inline explicit iterator ( - HashTable* curHashTable + HashTable* hashTbl ); //- Construct from hash table, element and hash index inline iterator ( - HashTable* curHashTable, + HashTable* hashTbl, hashedEntry* elmt, const label hashIndex ); @@ -492,13 +489,13 @@ public: //- Construct from hash table, moving to its 'begin' position inline explicit const_iterator ( - const HashTable* curHashTable + const HashTable* hashTbl ); //- Construct from hash table, element and hash index inline const_iterator ( - const HashTable* curHashTable, + const HashTable* hashTbl, const hashedEntry* elmt, const label hashIndex ); @@ -512,7 +509,7 @@ public: inline const_iterator(); //- Construct from iterator - inline const_iterator(const iterator&); + inline const_iterator(const iterator& iter); //- Construct end iterator inline const_iterator(const iteratorEnd& unused); @@ -540,14 +537,14 @@ public: friend Istream& operator>> ( - Istream&, - HashTable& + Istream& is, + HashTable& L ); friend Ostream& operator<< ( - Ostream&, - const HashTable& + Ostream& os, + const HashTable& L ); };