30 #ifndef OFUnorderedSet_h
31 #define OFUnorderedSet_h
33 #include "dcmtk/config/osconfig.h"
34 #include "dcmtk/ofstd/oftypes.h"
35 #include "dcmtk/ofstd/ofset.h"
108 OFBool result = OFTrue;
114 for(
unsigned int i=0 ; i<other.
num && result == OFTrue ; i++ )
139 return( !( *
this == other ) );
153 T *newItem =
new T( item );
169 for(
unsigned int i=0 ; i<other.
num ; i++ )
180 OFBool itemDeleted = OFFalse;
183 for(
unsigned int i=0 ; i<OFSet<T>::num && !itemDeleted ; i++ )
206 itemDeleted = OFTrue;
246 virtual T *
Find(
const T &item )
const
249 OFBool itemFound = OFFalse;
251 for( i=0 ; i<OFSet<T>::num && !itemFound ; i++ )
270 OFBool itemFound = OFFalse;
272 for(
unsigned int i=0 ; i<OFSet<T>::num && !itemFound ; i++ )
295 OFBool result = OFTrue;
301 for(
unsigned int i=0 ; i<other.
num && result == OFTrue ; i++ )
344 resultSet.
Insert( other );
366 for(
unsigned int i=0 ; i< OFSet<T>::num ; i++ )
400 for(
unsigned int i=0 ; i< OFSet<T>::num ; i++ )
virtual void Insert(const T &item)
Inserts a new item into the set.
const OFSet< T > & operator=(const OFSet< T > &src)
operator=.
virtual OFBool Contains(const T &item) const
Determines if a certain item is contained in the set.
virtual OFBool operator==(const OFUnorderedSet< T > &other) const
Determines if two sets are identical.
unsigned int num
number of entries in the set
const OFUnorderedSet< T > & operator=(const OFUnorderedSet< T > &src)
operator=.
OFUnorderedSet< T > SymmetricDifference(const OFUnorderedSet< T > &other) const
Determines the symmetric difference of this and other, i.e.
virtual ~OFUnorderedSet()
Destructor.
virtual void RemoveByIndex(unsigned int index)
Removes one item from the set.
OFUnorderedSet< T > Union(const OFUnorderedSet< T > &other) const
Determines the union of the two sets this and other, i.e.
virtual OFBool IsSupersetOf(const OFUnorderedSet< T > &other) const
Determines if this is an actual superset of other, i.e.
virtual OFBool IsSubsetOf(const OFUnorderedSet< T > &other) const
Determines if this is an actual subset of other, i.e.
OFUnorderedSet< T > Difference(const OFUnorderedSet< T > &other) const
Determines the difference this - other, i.e.
virtual OFBool operator!=(const OFUnorderedSet< T > &other) const
Determines if two sets are not identical.
This template class provides a data structure and operations for administrating an unordered set of e...
OFUnorderedSet()
Default constructor.
virtual void Remove(const T &item)
Removes one item from the set.
OFUnorderedSet< T > Intersection(const OFUnorderedSet< T > &other) const
Determines the intersection of the two sets this and other, i.e.
virtual void Insert(const OFUnorderedSet< T > &other)
Inserts all items of another set into this set.
virtual void Resize(unsigned int newSize)
Resizes the set.
virtual T * Find(const T &item) const
Tries to find a given object in the set.
T ** items
array containing the entries
This abstract template class provides a data structure and operations for administrating a set of ele...
OFUnorderedSet(const OFUnorderedSet< T > &src)
Copy constructor.