mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[12632] Revert previous commit (see Notes)
This commit is contained in:
parent
1cd806c02e
commit
ef445ea523
1462 changed files with 9689 additions and 7080 deletions
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
/*
|
||||
@file Set.h
|
||||
|
||||
Hash set
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
namespace G3D {
|
||||
|
||||
/**
|
||||
/*
|
||||
An unordered data structure that has at most one of each element.
|
||||
Provides O(1) time insert, remove, and member test (contains).
|
||||
|
||||
|
|
@ -33,7 +33,7 @@ namespace G3D {
|
|||
template<class T, class HashFunc = HashTrait<T>, class EqualsFunc = EqualsTrait<T> >
|
||||
class Set {
|
||||
|
||||
/**
|
||||
/*
|
||||
If an object is a member, it is contained in
|
||||
this table.
|
||||
*/
|
||||
|
|
@ -55,14 +55,17 @@ public:
|
|||
return memberTable.containsKey(member);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
Inserts into the table if not already present.
|
||||
Returns true if this is the first time the element was added.
|
||||
*/
|
||||
void insert(const T& member) {
|
||||
memberTable.set(member, true);
|
||||
bool insert(const T& member) {
|
||||
bool isNew = false;
|
||||
memberTable.getCreate(member, isNew) = true;
|
||||
return isNew;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
Returns true if the element was present and removed. Returns false
|
||||
if the element was not present.
|
||||
*/
|
||||
|
|
@ -104,7 +107,7 @@ public:
|
|||
clear();
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
C++ STL style iterator variable. See begin().
|
||||
*/
|
||||
class Iterator {
|
||||
|
|
@ -130,7 +133,7 @@ public:
|
|||
return it == other.it;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
Pre increment.
|
||||
*/
|
||||
Iterator& operator++() {
|
||||
|
|
@ -138,7 +141,7 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
Post increment (slower than preincrement).
|
||||
*/
|
||||
Iterator operator++(int) {
|
||||
|
|
@ -161,7 +164,7 @@ public:
|
|||
};
|
||||
|
||||
|
||||
/**
|
||||
/*
|
||||
C++ STL style iterator method. Returns the first member.
|
||||
Use preincrement (++entry) to get to the next element.
|
||||
Do not modify the set while iterating.
|
||||
|
|
@ -171,7 +174,7 @@ public:
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
/*
|
||||
C++ STL style iterator method. Returns one after the last iterator
|
||||
element.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue