11 #include <util/containers/PArrayIterator.h> 12 #include <util/containers/ConstPArrayIterator.h> 42 template <
typename Data,
int Capacity>
93 void remove(
const Data& data);
129 int index(
const Data& data)
const;
176 template <
typename Data,
int Capacity>
184 template<
typename Data,
int Capacity>
190 for (i = 0; i < other.
size_; ++i) {
196 if (Capacity >
size_) {
197 for (i =
size_; i < Capacity; ++i) {
207 template <
typename Data,
int Capacity>
213 if (
this == &other)
return *
this;
216 if (Capacity < other.
size_) {
221 for (
int i = 0; i < other.
size_; ++i) {
227 if (Capacity >
size_) {
228 for (
int i =
size_; i < Capacity; ++i) {
239 template <
typename Data,
int Capacity>
246 template <
typename Data,
int Capacity>
253 template <
typename Data,
int Capacity>
262 template <
typename Data,
int Capacity>
272 template <
typename Data,
int Capacity>
282 template <
typename Data,
int Capacity>
293 template <
typename Data,
int Capacity>
306 template <
typename Data,
int Capacity>
309 if (
size_ == Capacity) {
319 template <
typename Data,
int Capacity>
323 for (
int i=0; i < Capacity; ++i) {
331 template <
typename Data,
int Capacity>
334 const Data*
const ptr = &data;
340 for (i = 0; i <
size_; ++i) {
341 if (ptr ==
ptrs_[i]) {
352 if (i != size_ - 1) {
355 ptrs_[size_ - 1] = 0;
363 template <
typename Data,
int Capacity>
366 const Data*
const ptr = &data;
371 for (
int i = 0; i <
size_; ++i) {
372 if (ptr ==
ptrs_[i]) {
384 template <
typename Data,
int Capacity>
387 const Data*
const ptr = &data;
393 for (i = 0; i <
size_; ++i) {
394 if (ptr ==
ptrs_[i]) {
SSet< Data, Capacity > & operator=(const SSet< Data, Capacity > &other)
Assignment, element by element.
void clear()
Set logical size to zero and nullify all elements.
int size() const
Return logical size of this array.
Forward iterator for a PArray.
File containing preprocessor macros for error handling.
void setCurrent(Data **ptr)
Set the current pointer value.
Data * ptrs_[Capacity]
Array of pointers to Data objects.
Data & operator[](int i)
Mimic C array subscripting.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
int index(const Data &data) const
Return the current index of an object within the set, if any.
void append(Data &data)
Add an object to the set.
void setEnd(Data **ptr)
Set the value of the end pointer.
Utility classes for scientific computation.
void begin(PArrayIterator< Data > &iterator)
Set a PArrayIterator to the beginning of this Array.
void remove(const Data &data)
Remove an object from the set.
Forward iterator for a PArray.
SSet()
Default constructor.
int capacity() const
Return physical capacity of array.
void setEnd(Data **ptr)
Set the value of the end pointer.
Statically allocated array of pointers to an unordered set.
bool isElement(const Data &data) const
Is an object an element of the set?
int size_
Logical size of array (number of elements in array).
void setCurrent(Data **ptr)
Set the current pointer value.