ROSE
0.11.96.11
|
Ordered set of values.
This container holds an ordered set of values. This container differs from std::set in the following ways:
#include <Set.h>
Public Types | |
typedef T | Value |
Type of values stored in this set. | |
typedef C | Comparator |
How to compare values with each other. | |
typedef A | Allocator |
How to allocate storge for new values. | |
typedef InternalSet::const_iterator | ConstIterator |
Iterator for traversing values stored in the set. | |
Public Member Functions | |
Set (const Comparator &comparator=Comparator(), const Allocator &allocator=Allocator()) | |
Default constructor. More... | |
Set (const Value &value) | |
Singleton constructor. More... | |
Set (const Set &other) | |
Copy constructor. | |
Set & | operator= (const Set &other) |
Assignment operator. | |
boost::iterator_range< ConstIterator > | values () const |
Value iterator range. More... | |
bool | isEmpty () const |
Whether the set is empty. More... | |
bool | exists (const Value &value) const |
Whether a value exists. More... | |
bool | existsAny (const Set &other) const |
Whether any value exists. More... | |
bool | existsAll (const Set &other) const |
Whether all values exist. More... | |
size_t | size () const |
Size of the set. More... | |
Value | least () const |
Smallest member. More... | |
Value | greatest () const |
Largest member. More... | |
Interval< Value > | hull () const |
Range of members. More... | |
bool | operator== (const Set &other) const |
Whether two sets contain the same members. More... | |
bool | operator!= (const Set &other) const |
Whether two sets do not contain the same members. More... | |
bool | insert (const Value &value) |
Insert a value. More... | |
bool | insert (const Set &values) |
Insert multiple values. More... | |
bool | erase (const Value &value) |
Erase a value. More... | |
bool | erase (const Set &values) |
Erase multiple values. More... | |
void | clear () |
Erase all values. More... | |
Set & | operator&= (const Set &other) |
Intersects this set with another. More... | |
Set & | operator|= (const Set &other) |
Unions this set with another. More... | |
Set & | operator-= (const Set &other) |
Differences two sets. More... | |
Set | operator& (const Set &other) const |
Compute the intersection of this set with another. More... | |
Set | operator| (const Set &other) const |
Compute the union of this set with another. More... | |
Set | operator- (const Set &other) const |
Compute the difference of this set with another. More... | |
template<class InputIterator > | |
Set (InputIterator begin, InputIterator end, const Comparator &comparator=Comparator(), const Allocator &allocator=Allocator()) | |
Iterative constructor. More... | |
template<class InputIterator > | |
Set (const boost::iterator_range< InputIterator > &range, const Comparator &=Comparator(), const Allocator &=Allocator()) | |
Iterative constructor. More... | |
|
inlineexplicit |
|
inline |
|
inline |
Iterative constructor.
Constructs a new set and copies values into the set. For instance, this can be used to initialize a set from a vector:
|
inlineexplicit |
Iterative constructor.
Constructs a new set and copies values into the set. For instance, this can be used to initialize a set from a vector:
|
inline |
Value iterator range.
Returns an iterator range that covers all values in the set.
Definition at line 127 of file Set.h.
Referenced by Sawyer::Container::Set< Key >::erase(), Sawyer::Container::Set< Key >::existsAll(), Sawyer::Container::Set< Key >::existsAny(), Sawyer::Container::Set< Key >::insert(), and Sawyer::Container::Set< Key >::operator|=().
|
inline |
Whether the set is empty.
Returns true if the set is empty, false if not empty.
Definition at line 138 of file Set.h.
Referenced by Sawyer::Container::Set< Key >::greatest(), Sawyer::Container::Set< Key >::hull(), and Sawyer::Container::Set< Key >::least().
|
inline |
Whether a value exists.
Returns true if value
is a member of the set, false if not a member.
Definition at line 145 of file Set.h.
Referenced by Sawyer::Container::Set< Key >::existsAll(), Sawyer::Container::Set< Key >::existsAny(), Sawyer::Container::Set< Key >::operator&=(), and Sawyer::Container::Set< Key >::operator-=().
|
inline |
|
inline |
|
inline |
|
inline |
Smallest member.
Returns the smallest member of the set. The set must not be empty.
Definition at line 181 of file Set.h.
Referenced by Sawyer::Container::Set< Key >::hull().
|
inline |
Largest member.
Returns the largest member of the set. The set must not be empty.
Definition at line 189 of file Set.h.
Referenced by Sawyer::Container::Set< Key >::hull().
|
inline |
|
inline |
|
inline |
|
inline |
Insert a value.
Inserts value
into the set. Returns true if the value was inserted, false if the value was already a member.
Definition at line 228 of file Set.h.
Referenced by Sawyer::Container::Trace< T, IndexTag >::labels(), and Sawyer::Container::Set< Key >::operator|=().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |