mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
added sortedToc()
This commit is contained in:
@ -56,6 +56,7 @@ int main()
|
|||||||
table1.erase("abs");
|
table1.erase("abs");
|
||||||
|
|
||||||
Info<< "\ntable1 toc: " << table1.toc() << endl;
|
Info<< "\ntable1 toc: " << table1.toc() << endl;
|
||||||
|
Info<< "\ntable1 sortedToc: " << table1.sortedToc() << endl;
|
||||||
table1.printInfo(Info)
|
table1.printInfo(Info)
|
||||||
<< "table1 [" << table1.size() << "] " << endl;
|
<< "table1 [" << table1.size() << "] " << endl;
|
||||||
forAllIter(HASHTABLE_CLASS<double>, table1, iter)
|
forAllIter(HASHTABLE_CLASS<double>, table1, iter)
|
||||||
|
|||||||
@ -231,7 +231,6 @@ Foam::HashTable<T, Key, Hash>::find
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Return the table of contents
|
|
||||||
template<class T, class Key, class Hash>
|
template<class T, class Key, class Hash>
|
||||||
Foam::List<Key> Foam::HashTable<T, Key, Hash>::toc() const
|
Foam::List<Key> Foam::HashTable<T, Key, Hash>::toc() const
|
||||||
{
|
{
|
||||||
@ -247,6 +246,16 @@ Foam::List<Key> Foam::HashTable<T, Key, Hash>::toc() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T, class Key, class Hash>
|
||||||
|
Foam::List<Key> Foam::HashTable<T, Key, Hash>::sortedToc() const
|
||||||
|
{
|
||||||
|
List<Key> sortedList = this->toc();
|
||||||
|
sort(sortedList);
|
||||||
|
|
||||||
|
return sortedList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class T, class Key, class Hash>
|
template<class T, class Key, class Hash>
|
||||||
bool Foam::HashTable<T, Key, Hash>::set
|
bool Foam::HashTable<T, Key, Hash>::set
|
||||||
(
|
(
|
||||||
|
|||||||
@ -198,6 +198,9 @@ public:
|
|||||||
//- Return the table of contents
|
//- Return the table of contents
|
||||||
List<Key> toc() const;
|
List<Key> toc() const;
|
||||||
|
|
||||||
|
//- Return the table of contents as a sorted list
|
||||||
|
List<Key> sortedToc() const;
|
||||||
|
|
||||||
//- Print information
|
//- Print information
|
||||||
Ostream& printInfo(Ostream&) const;
|
Ostream& printInfo(Ostream&) const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user