renamed 'empty' class to 'nil', added missing empty() member to some containers

This commit is contained in:
Mark Olesen
2009-01-09 13:10:10 +01:00
parent 036a1cd504
commit f0341171ff
24 changed files with 120 additions and 57 deletions

View File

@ -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());
}