Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
85f11fa7
Commit
85f11fa7
authored
Aug 06, 2009
by
Andrew Heather
Browse files
added sortedToc()
parent
df37b6b4
Changes
3
Hide whitespace changes
Inline
Side-by-side
applications/test/HashTable/hashTableTest.C
View file @
85f11fa7
...
...
@@ -56,6 +56,7 @@ int main()
table1
.
erase
(
"abs"
);
Info
<<
"
\n
table1 toc: "
<<
table1
.
toc
()
<<
endl
;
Info
<<
"
\n
table1 sortedToc: "
<<
table1
.
sortedToc
()
<<
endl
;
table1
.
printInfo
(
Info
)
<<
"table1 ["
<<
table1
.
size
()
<<
"] "
<<
endl
;
forAllIter
(
HASHTABLE_CLASS
<
double
>
,
table1
,
iter
)
...
...
src/OpenFOAM/containers/HashTables/HashTable/HashTable.C
View file @
85f11fa7
...
...
@@ -231,7 +231,6 @@ Foam::HashTable<T, Key, Hash>::find
}
// Return the table of contents
template
<
class
T
,
class
Key
,
class
Hash
>
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
>
bool
Foam
::
HashTable
<
T
,
Key
,
Hash
>::
set
(
...
...
src/OpenFOAM/containers/HashTables/HashTable/HashTable.H
View file @
85f11fa7
...
...
@@ -198,6 +198,9 @@ public:
//- Return the table of contents
List
<
Key
>
toc
()
const
;
//- Return the table of contents as a sorted list
List
<
Key
>
sortedToc
()
const
;
//- Print information
Ostream
&
printInfo
(
Ostream
&
)
const
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment