DCMTK
Version 3.6.1 20170228
OFFIS DICOM Toolkit
|
This template class provides a data structure and operations for administrating an unordered set of elements of an arbitrary type. More...
Public Member Functions | |
OFUnorderedSet () | |
Default constructor. | |
OFUnorderedSet (const OFUnorderedSet< T > &src) | |
Copy constructor. More... | |
virtual | ~OFUnorderedSet () |
Destructor. | |
const OFUnorderedSet< T > & | operator= (const OFUnorderedSet< T > &src) |
operator=. More... | |
virtual OFBool | operator== (const OFUnorderedSet< T > &other) const |
Determines if two sets are identical. More... | |
virtual OFBool | operator!= (const OFUnorderedSet< T > &other) const |
Determines if two sets are not identical. More... | |
virtual void | Insert (const T &item) |
Inserts a new item into the set. More... | |
virtual void | Insert (const OFUnorderedSet< T > &other) |
Inserts all items of another set into this set. More... | |
virtual void | Remove (const T &item) |
Removes one item from the set. More... | |
virtual void | RemoveByIndex (unsigned int index) |
Removes one item from the set. More... | |
virtual T * | Find (const T &item) const |
Tries to find a given object in the set. More... | |
virtual OFBool | Contains (const T &item) const |
Determines if a certain item is contained in the set. More... | |
virtual OFBool | IsSupersetOf (const OFUnorderedSet< T > &other) const |
Determines if this is an actual superset of other, i.e. More... | |
virtual OFBool | IsSubsetOf (const OFUnorderedSet< T > &other) const |
Determines if this is an actual subset of other, i.e. More... | |
OFUnorderedSet< T > | Union (const OFUnorderedSet< T > &other) const |
Determines the union of the two sets this and other, i.e. More... | |
OFUnorderedSet< T > | Intersection (const OFUnorderedSet< T > &other) const |
Determines the intersection of the two sets this and other, i.e. More... | |
OFUnorderedSet< T > | Difference (const OFUnorderedSet< T > &other) const |
Determines the difference this - other, i.e. More... | |
OFUnorderedSet< T > | SymmetricDifference (const OFUnorderedSet< T > &other) const |
Determines the symmetric difference of this and other, i.e. More... | |
![]() | |
OFSet () | |
Default constructor. | |
void | init () |
This function is a workaround for avoiding a compiler warning on Solaris 2.5.1 using compiler SC 2.0.1. | |
OFSet (const OFSet< T > &src) | |
Copy constructor. More... | |
void | init (const OFSet< T > &src) |
This function is a workaround for avoiding a compiler warning on Solaris 2.5.1 using compiler SC 2.0.1. | |
virtual | ~OFSet () |
Destructor. | |
const OFSet< T > & | operator= (const OFSet< T > &src) |
operator=. More... | |
virtual T & | operator[] (unsigned int i) const |
Returns a certain element which is contained in the set. More... | |
virtual void | Resize (unsigned int newSize) |
Resizes the set. More... | |
virtual void | Clear () |
Removes all items from the set. | |
virtual OFBool | IsEmpty () const |
Determines if the set is an empty set. More... | |
virtual unsigned int | NumberOfElements () const |
Returns the number of elements in the set. More... | |
Additional Inherited Members | |
![]() | |
T ** | items |
array containing the entries | |
unsigned int | num |
number of entries in the set | |
unsigned int | size |
current size of the set (always >= num) | |
This template class provides a data structure and operations for administrating an unordered set of elements of an arbitrary type.
Note the following properties of this class:
|
inline |
Copy constructor.
src | Source object of which this will be a copy. |
|
inlinevirtual |
Determines if a certain item is contained in the set.
item | - Item which shall be looked for. |
Implements OFSet< T >.
Referenced by OFUnorderedSet< T >::Difference(), OFUnorderedSet< T >::Intersection(), OFUnorderedSet< T >::IsSupersetOf(), and OFUnorderedSet< T >::operator==().
|
inline |
Determines the difference this - other, i.e.
the set containing all the items found in this but not in other, and returns the resulting new set.
other | Second parameter for difference. |
References OFUnorderedSet< T >::Contains(), OFUnorderedSet< T >::Insert(), and OFUnorderedSet< T >::Remove().
Referenced by OFUnorderedSet< T >::SymmetricDifference().
|
inlinevirtual |
Tries to find a given object in the set.
In case the specified object could be found, a pointer to the corresponding element within the set is returned; in case the specified object could not be found, NULL will be returned.
item | Search pattern. |
Implements OFSet< T >.
|
inlinevirtual |
Inserts a new item into the set.
item | Item which shall be inserted into the set. |
Implements OFSet< T >.
References OFSet< T >::Resize().
Referenced by OFUnorderedSet< T >::Difference(), OFUnorderedSet< T >::Insert(), OFUnorderedSet< T >::Intersection(), and OFUnorderedSet< T >::Union().
|
inlinevirtual |
Inserts all items of another set into this set.
other | set whose items shall be inserted into the set. |
References OFUnorderedSet< T >::Insert(), OFSet< T >::items, and OFSet< T >::num.
|
inline |
Determines the intersection of the two sets this and other, i.e.
the set containing all items which can be found in both this and other, and returns the resulting new set.
other | Second parameter for intersection. |
References OFUnorderedSet< T >::Contains(), OFUnorderedSet< T >::Insert(), and OFUnorderedSet< T >::Remove().
|
inlinevirtual |
Determines if this is an actual subset of other, i.e.
if this is completely contained in other and other furthermore has additional elements.
other | - Set which shall be compared with this. |
References OFUnorderedSet< T >::IsSupersetOf().
|
inlinevirtual |
Determines if this is an actual superset of other, i.e.
if this completely contains other and furthermore has additional elements.
other | - Set which shall be compared with this. |
References OFUnorderedSet< T >::Contains(), OFSet< T >::items, OFSet< T >::num, and OFUnorderedSet< T >::Remove().
Referenced by OFUnorderedSet< T >::IsSubsetOf().
|
inlinevirtual |
Determines if two sets are not identical.
other | Set which shall be compared with this. |
|
inline |
operator=.
src | Source object whose values will be assigned to this. |
References OFSet< T >::operator=().
|
inlinevirtual |
Determines if two sets are identical.
other | Set which shall be compared with this. |
References OFUnorderedSet< T >::Contains(), OFSet< T >::items, OFSet< T >::num, and OFUnorderedSet< T >::Remove().
|
inlinevirtual |
Removes one item from the set.
item | Item which shall be removed from the set. |
Implements OFSet< T >.
Referenced by OFUnorderedSet< T >::Difference(), OFUnorderedSet< T >::Intersection(), OFUnorderedSet< T >::IsSupersetOf(), and OFUnorderedSet< T >::operator==().
|
inlinevirtual |
Removes one item from the set.
index | Index of the item which shall be removed from the set. |
Implements OFSet< T >.
|
inline |
Determines the symmetric difference of this and other, i.e.
the set containing all the items which can be found either in this or in other but not in the intersection of this and other, and returns the resulting new set.
other | Second parameter for symmetric difference. |
References OFUnorderedSet< T >::Difference(), and OFUnorderedSet< T >::Union().
|
inline |
Determines the union of the two sets this and other, i.e.
the set containing all items which can be found either in this or in other, and returns the resulting new set.
other | Second parameter for union. |
References OFUnorderedSet< T >::Insert().
Referenced by OFUnorderedSet< T >::SymmetricDifference().