ROSE 0.11.145.192
|
Ordered set of values.
This container holds an ordered set of values. This container differs from std::set in the following ways:
#include <Sawyer/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. | |
Set (const Value &value) | |
Singleton constructor. | |
Set (const Set &other) | |
Copy constructor. | |
Set & | operator= (const Set &other) |
Assignment operator. | |
boost::iterator_range< ConstIterator > | values () const |
Value iterator range. | |
bool | isEmpty () const |
Whether the set is empty. | |
bool | exists (const Value &value) const |
Whether a value exists. | |
bool | existsAny (const Set &other) const |
Whether any value exists. | |
bool | existsAll (const Set &other) const |
Whether all values exist. | |
size_t | size () const |
Size of the set. | |
Value | least () const |
Smallest member. | |
Value | greatest () const |
Largest member. | |
Interval< Value > | hull () const |
Range of members. | |
bool | operator== (const Set &other) const |
Whether two sets contain the same members. | |
bool | operator!= (const Set &other) const |
Whether two sets do not contain the same members. | |
operator bool () const | |
Whether the set is non-empty. | |
bool | operator! () const |
Whether the set is empty. | |
bool | insert (const Value &value) |
Insert a value. | |
bool | insert (const Set &values) |
Insert multiple values. | |
bool | erase (const Value &value) |
Erase a value. | |
bool | erase (const Set &values) |
Erase multiple values. | |
void | clear () |
Erase all values. | |
Set & | operator&= (const Set &other) |
Intersects this set with another. | |
Set & | operator-= (const Set &other) |
Differences two sets. | |
Set | operator& (const Set &other) const |
Compute the intersection of this set with another. | |
Set | operator- (const Set &other) const |
Compute the difference of this set with another. | |
template<class InputIterator > | |
Set (InputIterator begin, InputIterator end, const Comparator &comparator=Comparator(), const Allocator &allocator=Allocator()) | |
Iterative constructor. | |
template<class InputIterator > | |
Set (const boost::iterator_range< InputIterator > &range, const Comparator &=Comparator(), const Allocator &=Allocator()) | |
Iterative constructor. | |
Set & | operator|= (const Set &other) |
Unions this set with another. | |
Set & | operator+= (const Set &other) |
Unions this set with another. | |
Set | operator| (const Set &other) const |
Compute the union of this set with another. | |
Set | operator+ (const Set &other) const |
Compute the union of this set with another. | |
typedef T Sawyer::Container::Set< T, C, A >::Value |
typedef C Sawyer::Container::Set< T, C, A >::Comparator |
typedef A Sawyer::Container::Set< T, C, A >::Allocator |
typedef InternalSet::const_iterator Sawyer::Container::Set< T, C, A >::ConstIterator |
|
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 |
|
inline |
|
inline |
Value iterator range.
Returns an iterator range that covers all values in the set.
Definition at line 143 of file Set.h.
Referenced by Sawyer::Container::Set< T, C, A >::erase(), Sawyer::Container::Set< T, C, A >::existsAll(), Sawyer::Container::Set< T, C, A >::existsAny(), Sawyer::Container::Set< T, C, A >::insert(), Sawyer::Container::Set< T, C, A >::operator+=(), and Sawyer::Container::Set< T, C, A >::operator|=().
|
inline |
Whether the set is empty.
Returns true if the set is empty, false if not empty.
Definition at line 154 of file Set.h.
Referenced by Sawyer::Container::Set< T, C, A >::greatest(), Sawyer::Container::Set< T, C, A >::hull(), Sawyer::Container::Set< T, C, A >::least(), Sawyer::Container::Set< T, C, A >::operator bool(), and Sawyer::Container::Set< T, C, A >::operator!().
|
inline |
Whether a value exists.
Returns true if value
is a member of the set, false if not a member.
Definition at line 161 of file Set.h.
Referenced by Sawyer::Container::Set< T, C, A >::existsAll(), Sawyer::Container::Set< T, C, A >::existsAny(), Sawyer::Container::Set< T, C, A >::operator&=(), and Sawyer::Container::Set< T, C, A >::operator-=().
|
inline |
Whether any value exists.
Returns true if any of the specified values exist in this set.
Definition at line 168 of file Set.h.
References Sawyer::Container::Set< T, C, A >::exists(), and Sawyer::Container::Set< T, C, A >::values().
|
inline |
Whether all values exist.
Returns true if all specified values exist in this set.
Definition at line 179 of file Set.h.
References Sawyer::Container::Set< T, C, A >::exists(), and Sawyer::Container::Set< T, C, A >::values().
|
inline |
|
inline |
Smallest member.
Returns the smallest member of the set. The set must not be empty.
Definition at line 197 of file Set.h.
References Sawyer::Container::Set< T, C, A >::isEmpty().
Referenced by Sawyer::Container::Set< T, C, A >::hull().
|
inline |
Largest member.
Returns the largest member of the set. The set must not be empty.
Definition at line 205 of file Set.h.
References Sawyer::Container::Set< T, C, A >::isEmpty().
Referenced by Sawyer::Container::Set< T, C, A >::hull().
|
inline |
Range of members.
Returns a range having the minimum and maximum members of the set.
Definition at line 215 of file Set.h.
References Sawyer::Container::Set< T, C, A >::greatest(), Sawyer::Container::Interval< T >::hull(), Sawyer::Container::Set< T, C, A >::isEmpty(), and Sawyer::Container::Set< T, C, A >::least().
|
inline |
|
inline |
|
inlineexplicit |
Whether the set is non-empty.
Returns true if the set is not empty, false if empty.
Definition at line 240 of file Set.h.
References Sawyer::Container::Set< T, C, A >::isEmpty().
|
inline |
Whether the set is empty.
Returns true if the set is empty, false if not empty.
Definition at line 247 of file Set.h.
References Sawyer::Container::Set< T, C, A >::isEmpty().
|
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 258 of file Set.h.
Referenced by Rose::BinaryAnalysis::BestMapAddress::insertEntryAddress(), Rose::BinaryAnalysis::BestMapAddress::insertTargetAddress(), Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::MemoryCell::insertWriter(), Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::MemoryCell::insertWriters(), Sawyer::Container::Trace< T, IndexTag >::labels(), Sawyer::Container::Set< T, C, A >::operator+=(), Sawyer::Container::Set< T, C, A >::operator|=(), and Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::MemoryCell::setWriters().
|
inline |
Insert multiple values.
Inserts all specified values into this set. Returns true if any value was inserted, false if all the values were already members of this set.
Definition at line 266 of file Set.h.
References Sawyer::Container::Set< T, C, A >::values().
|
inline |
Erase a value.
Erases value
from the set. Returns true if the value was erased, false if the value was not a member.
Definition at line 278 of file Set.h.
Referenced by Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::MemoryCell::eraseWriter(), Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::MemoryCell::eraseWriters(), Sawyer::Container::Set< T, C, A >::operator&=(), and Sawyer::Container::Set< T, C, A >::operator-=().
|
inline |
Erase multiple values.
Erases all specified values from this set. Returns true if any value was erased, false if none of the specified values were members of this set.
Definition at line 286 of file Set.h.
References Sawyer::Container::Set< T, C, A >::values().
|
inline |
Erase all values.
Erases all values from the set so that the set becomes empty.
Definition at line 298 of file Set.h.
Referenced by Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::MemoryCell::eraseWriters(), and Rose::BinaryAnalysis::BestMapAddress::reset().
|
inline |
Intersects this set with another.
Removes those members of this set that are not in the other
set.
Definition at line 305 of file Set.h.
References Sawyer::Container::Set< T, C, A >::erase(), and Sawyer::Container::Set< T, C, A >::exists().
|
inline |
Unions this set with another.
Adds those members of other
that are not already members of this set.
Definition at line 322 of file Set.h.
References Sawyer::Container::Set< T, C, A >::insert(), and Sawyer::Container::Set< T, C, A >::values().
|
inline |
Unions this set with another.
Adds those members of other
that are not already members of this set.
Definition at line 328 of file Set.h.
References Sawyer::Container::Set< T, C, A >::insert(), and Sawyer::Container::Set< T, C, A >::values().
|
inline |
Differences two sets.
Removes those members of this set that are in the other
set. This is like the intersection of the complement but does not require computing a potentially large complement.
Definition at line 339 of file Set.h.
References Sawyer::Container::Set< T, C, A >::erase(), and Sawyer::Container::Set< T, C, A >::exists().
|
inline |
|
inline |
|
inline |
|
inline |