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
f0341171
Commit
f0341171
authored
Jan 09, 2009
by
Mark Olesen
Browse files
renamed 'empty' class to 'nil', added missing empty() member to some containers
parent
036a1cd5
Changes
24
Hide whitespace changes
Inline
Side-by-side
applications/test/HashSet/hashSetTest.C
View file @
f0341171
...
...
@@ -39,7 +39,7 @@ int main(int argc, char *argv[])
wordHashSet
setA
(
0
);
HashTable
<
label
,
word
>
tableA
;
HashTable
<
empty
>
tableB
;
HashTable
<
nil
>
tableB
;
Map
<
label
>
mapA
;
setA
.
insert
(
"kjhk"
);
...
...
@@ -49,9 +49,9 @@ int main(int argc, char *argv[])
tableA
.
insert
(
"value2"
,
2
);
tableA
.
insert
(
"value3"
,
3
);
tableB
.
insert
(
"value4"
,
empty
());
tableB
.
insert
(
"value5"
,
empty
());
tableB
.
insert
(
"value6"
,
empty
());
tableB
.
insert
(
"value4"
,
nil
());
tableB
.
insert
(
"value5"
,
nil
());
tableB
.
insert
(
"value6"
,
nil
());
mapA
.
set
(
1
,
1
);
mapA
.
set
(
2
,
2
);
...
...
@@ -66,7 +66,7 @@ int main(int argc, char *argv[])
Info
<<
wordHashSet
(
setA
)
<<
endl
;
Info
<<
"create from HashTable<T>: "
;
Info
<<
wordHashSet
(
tableA
)
<<
endl
;
Info
<<
"create from HashTable<
empty
>: "
;
Info
<<
"create from HashTable<
nil
>: "
;
Info
<<
wordHashSet
(
tableB
)
<<
endl
;
Info
<<
"create from Map<label>: "
;
...
...
src/OpenFOAM/containers/HashTables/HashSet/HashSet.C
View file @
f0341171
...
...
@@ -35,7 +35,7 @@ template<class Key, class Hash>
template
<
class
T
>
Foam
::
HashSet
<
Key
,
Hash
>::
HashSet
(
const
HashTable
<
T
,
Key
,
Hash
>&
ht
)
:
HashTable
<
empty
,
Key
,
Hash
>
(
ht
.
size
())
HashTable
<
nil
,
Key
,
Hash
>
(
ht
.
size
())
{
for
(
...
...
src/OpenFOAM/containers/HashTables/HashSet/HashSet.H
View file @
f0341171
...
...
@@ -46,7 +46,7 @@ Description
#define HashSet_H
#include
"HashTable.H"
#include
"
empty
.H"
#include
"
nil
.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -60,13 +60,13 @@ namespace Foam
template
<
class
Key
=
word
,
class
Hash
=
string
::
hash
>
class
HashSet
:
public
HashTable
<
empty
,
Key
,
Hash
>
public
HashTable
<
nil
,
Key
,
Hash
>
{
public:
typedef
typename
HashTable
<
empty
,
Key
,
Hash
>::
iterator
iterator
;
typedef
typename
HashTable
<
empty
,
Key
,
Hash
>::
const_iterator
const_iterator
;
typedef
typename
HashTable
<
nil
,
Key
,
Hash
>::
iterator
iterator
;
typedef
typename
HashTable
<
nil
,
Key
,
Hash
>::
const_iterator
const_iterator
;
// Constructors
...
...
@@ -74,19 +74,19 @@ public:
//- Construct given initial size
HashSet
(
label
size
=
100
)
:
HashTable
<
empty
,
Key
,
Hash
>
(
size
)
HashTable
<
nil
,
Key
,
Hash
>
(
size
)
{}
//- Construct from Istream
HashSet
(
Istream
&
is
)
:
HashTable
<
empty
,
Key
,
Hash
>
(
is
)
HashTable
<
nil
,
Key
,
Hash
>
(
is
)
{}
//- Construct from UList of Key
HashSet
(
const
UList
<
Key
>&
lst
)
:
HashTable
<
empty
,
Key
,
Hash
>
(
2
*
lst
.
size
())
HashTable
<
nil
,
Key
,
Hash
>
(
2
*
lst
.
size
())
{
forAll
(
lst
,
i
)
{
...
...
@@ -97,19 +97,19 @@ public:
//- Construct as copy
HashSet
(
const
HashSet
<
Key
,
Hash
>&
hs
)
:
HashTable
<
empty
,
Key
,
Hash
>
(
hs
)
HashTable
<
nil
,
Key
,
Hash
>
(
hs
)
{}
//- Construct by transferring the parameter contents
HashSet
(
const
Xfer
<
HashSet
<
Key
,
Hash
>
>&
hs
)
:
HashTable
<
empty
,
Key
,
Hash
>
(
hs
)
HashTable
<
nil
,
Key
,
Hash
>
(
hs
)
{}
//- Construct by transferring the parameter contents
HashSet
(
const
Xfer
<
HashTable
<
empty
,
Key
,
Hash
>
>&
hs
)
HashSet
(
const
Xfer
<
HashTable
<
nil
,
Key
,
Hash
>
>&
hs
)
:
HashTable
<
empty
,
Key
,
Hash
>
(
hs
)
HashTable
<
nil
,
Key
,
Hash
>
(
hs
)
{}
//- Construct from table of contents of the HashTable
...
...
@@ -123,13 +123,13 @@ public:
//- Insert a new entry
bool
insert
(
const
Key
&
key
)
{
return
HashTable
<
empty
,
Key
,
Hash
>::
insert
(
key
,
empty
());
return
HashTable
<
nil
,
Key
,
Hash
>::
insert
(
key
,
nil
());
}
//- Same as insert (cannot overwrite
empty
content)
//- Same as insert (cannot overwrite
nil
content)
bool
set
(
const
Key
&
key
)
{
return
HashTable
<
empty
,
Key
,
Hash
>::
insert
(
key
,
empty
());
return
HashTable
<
nil
,
Key
,
Hash
>::
insert
(
key
,
nil
());
}
...
...
src/OpenFOAM/containers/HashTables/HashTable/HashTable.H
View file @
f0341171
...
...
@@ -171,6 +171,9 @@ public:
//- Return number of elements in table.
inline
label
size
()
const
;
//- Return true if the hash table is empty
inline
bool
empty
()
const
;
//- Return true if hashedEntry is found in table
bool
found
(
const
Key
&
)
const
;
...
...
src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H
View file @
f0341171
...
...
@@ -51,6 +51,13 @@ inline Foam::label Foam::HashTable<T, Key, Hash>::size() const
}
template
<
class
T
,
class
Key
,
class
Hash
>
inline
bool
Foam
::
HashTable
<
T
,
Key
,
Hash
>::
empty
()
const
{
return
(
nElmts_
==
0
);
}
template
<
class
T
,
class
Key
,
class
Hash
>
inline
bool
Foam
::
HashTable
<
T
,
Key
,
Hash
>::
insert
(
...
...
src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTable.H
View file @
f0341171
...
...
@@ -164,6 +164,9 @@ public:
//- Return number of elements in table.
inline
label
size
()
const
;
//- Return true if the hash table is empty
inline
bool
empty
()
const
;
//- Return true if hashed entry is found in table
bool
found
(
const
Key
&
key
)
const
;
...
...
src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTableI.H
View file @
f0341171
...
...
@@ -38,6 +38,13 @@ inline Foam::label Foam::StaticHashTable<T, Key, Hash>::size() const
}
template
<
class
T
,
class
Key
,
class
Hash
>
inline
bool
Foam
::
StaticHashTable
<
T
,
Key
,
Hash
>::
empty
()
const
{
return
(
nElmts_
==
0
);
}
template
<
class
T
,
class
Key
,
class
Hash
>
inline
bool
Foam
::
StaticHashTable
<
T
,
Key
,
Hash
>::
insert
(
...
...
src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H
View file @
f0341171
...
...
@@ -122,6 +122,9 @@ public:
//- Return number of elements in list
inline
label
size
()
const
;
//- Return true if the list is empty
inline
bool
empty
()
const
;
//- Return first entry
inline
link
*
first
();
...
...
src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBaseI.H
View file @
f0341171
...
...
@@ -81,6 +81,12 @@ inline Foam::label Foam::DLListBase::size() const
}
inline
bool
Foam
::
DLListBase
::
empty
()
const
{
return
(
nElmts_
==
0
);
}
inline
Foam
::
DLListBase
::
link
*
Foam
::
DLListBase
::
first
()
{
...
...
src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H
View file @
f0341171
...
...
@@ -119,6 +119,9 @@ public:
//- Return number of elements in list
inline
label
size
()
const
;
//- Return true if the list is empty
inline
bool
empty
()
const
;
//- Return first entry
inline
link
*
first
();
...
...
src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBaseI.H
View file @
f0341171
...
...
@@ -71,6 +71,12 @@ inline Foam::label Foam::SLListBase::size() const
}
inline
bool
Foam
::
SLListBase
::
empty
()
const
{
return
(
nElmts_
==
0
);
}
inline
Foam
::
SLListBase
::
link
*
Foam
::
SLListBase
::
first
()
{
...
...
src/OpenFOAM/containers/LinkedLists/user/FIFOStack.H
View file @
f0341171
...
...
@@ -92,15 +92,6 @@ public:
}
// Check
//- Is the stack empty
bool
empty
()
const
{
return
this
->
size
()
==
0
;
}
// Edit
//- Push an element onto the stack
...
...
src/OpenFOAM/containers/LinkedLists/user/LIFOStack.H
View file @
f0341171
...
...
@@ -92,15 +92,6 @@ public:
}
// Check
//- Is the stack empty
bool
empty
()
const
{
return
this
->
size
()
==
0
;
}
// Edit
//- Push an element onto the stack
...
...
src/OpenFOAM/containers/Lists/BiIndirectList/BiIndirectList.H
View file @
f0341171
...
...
@@ -75,6 +75,8 @@ public:
// Access
inline
label
size
()
const
;
inline
bool
empty
()
const
;
inline
const
UList
<
T
>&
posList
()
const
;
inline
const
UList
<
T
>&
negList
()
const
;
inline
const
List
<
label
>&
addressing
()
const
;
...
...
src/OpenFOAM/containers/Lists/BiIndirectList/BiIndirectListI.H
View file @
f0341171
...
...
@@ -49,6 +49,13 @@ inline Foam::label Foam::BiIndirectList<T>::size() const
}
template
<
class
T
>
inline
bool
Foam
::
BiIndirectList
<
T
>::
empty
()
const
{
return
addressing_
.
empty
();
}
template
<
class
T
>
inline
const
Foam
::
UList
<
T
>&
Foam
::
BiIndirectList
<
T
>::
posList
()
const
{
...
...
src/OpenFOAM/containers/Lists/CompactListList/CompactListList.H
View file @
f0341171
...
...
@@ -126,6 +126,9 @@ public:
//- Return the primary size, i.e. the number of rows
inline
label
size
()
const
;
//- Return true if the number of rows is zero
inline
bool
empty
()
const
;
//- Return the offset table
inline
const
List
<
label
>&
offsets
()
const
;
...
...
src/OpenFOAM/containers/Lists/CompactListList/CompactListListI.H
View file @
f0341171
...
...
@@ -74,6 +74,13 @@ inline Foam::label Foam::CompactListList<T>::size() const
}
template
<
class
T
>
inline
bool
Foam
::
CompactListList
<
T
>::
empty
()
const
{
return
offsets_
.
empty
();
}
template
<
class
T
>
inline
const
Foam
::
List
<
Foam
::
label
>&
Foam
::
CompactListList
<
T
>::
offsets
()
const
{
...
...
src/OpenFOAM/containers/Lists/IndirectList/IndirectList.H
View file @
f0341171
...
...
@@ -69,6 +69,8 @@ public:
// Access
inline
label
size
()
const
;
inline
bool
empty
()
const
;
inline
const
UList
<
T
>&
completeList
()
const
;
inline
const
List
<
label
>&
addressing
()
const
;
...
...
src/OpenFOAM/containers/Lists/IndirectList/IndirectListI.H
View file @
f0341171
...
...
@@ -47,6 +47,13 @@ inline Foam::label Foam::IndirectList<T>::size() const
}
template
<
class
T
>
inline
bool
Foam
::
IndirectList
<
T
>::
empty
()
const
{
return
addressing_
.
empty
();
}
template
<
class
T
>
inline
const
Foam
::
UList
<
T
>&
Foam
::
IndirectList
<
T
>::
completeList
()
const
{
...
...
src/OpenFOAM/containers/Lists/PackedList/PackedList.H
View file @
f0341171
...
...
@@ -166,6 +166,9 @@ public:
//- Number of packed elements
inline
label
size
()
const
;
//- Return true if the list is empty (i.e., if size() == 0).
inline
bool
empty
()
const
;
//- Get value at index I
inline
unsigned
int
get
(
const
label
i
)
const
;
...
...
Prev
1
2
Next
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