29 #ifndef INCLUDE_OLA_RDM_UIDSET_H_
30 #define INCLUDE_OLA_RDM_UIDSET_H_
53 typedef std::set<UID>::const_iterator
Iterator;
65 m_uids(other.m_uids) {
73 m_uids = other.m_uids;
89 unsigned int Size()
const {
98 return m_uids.empty();
123 return m_uids.find(uid) != m_uids.end();
132 std::set<UID> result;
133 set_union(m_uids.begin(),
137 inserter(result, result.begin()));
145 return m_uids.begin();
161 std::set<UID> difference;
162 std::set_difference(m_uids.begin(),
164 other.m_uids.begin(),
166 std::inserter(difference, difference.begin()));
167 return UIDSet(difference);
175 return m_uids == other.m_uids;
183 return !(*
this == other);
191 std::ostringstream str;
192 std::set<UID>::const_iterator iter;
193 for (iter = m_uids.begin(); iter != m_uids.end(); ++iter) {
194 if (iter != m_uids.begin())
211 std::set<UID> m_uids;
213 explicit UIDSet(
const std::set<UID> uids) {
219 #endif // INCLUDE_OLA_RDM_UIDSET_H_
Represents a set of RDM UIDs.
Definition: UIDSet.h:48
std::string ToString() const
Convert a UIDSet to a human readable string.
Definition: UIDSet.h:190
bool operator==(const UIDSet &other) const
Equality operator.
Definition: UIDSet.h:174
UIDSet SetDifference(const UIDSet &other)
Return the UIDs in this set that don't exist in other.
Definition: UIDSet.h:160
bool Contains(const UID &uid) const
Check if the set contains a UID.
Definition: UIDSet.h:122
bool Empty() const
Return whether the UID set is empty.
Definition: UIDSet.h:97
A RDM unique identifier (UID).
friend std::ostream & operator<<(std::ostream &out, const UIDSet &uid_set)
A helper function to write a UIDSet to an ostream.
Definition: UIDSet.h:206
std::set< UID >::const_iterator Iterator
the Iterator for a UIDSets
Definition: UIDSet.h:53
unsigned int Size() const
Return the number of UIDs in the set.
Definition: UIDSet.h:89
void Clear()
Remove all members from the set.
Definition: UIDSet.h:81
Iterator End() const
Return an Iterator to one-pass-the-last member of the set.
Definition: UIDSet.h:151
UIDSet Union(const UIDSet &other)
Return the union of this set and another UIDSet.
Definition: UIDSet.h:131
void RemoveUID(const UID &uid)
Remove a UID from the set.
Definition: UIDSet.h:113
UIDSet(const UIDSet &other)
Copy constructor.
Definition: UIDSet.h:64
UIDSet()
Construct an empty set.
Definition: UIDSet.h:58
Represents a RDM UID.
Definition: UID.h:57
void AddUID(const UID &uid)
Add a UID to the set.
Definition: UIDSet.h:105
Iterator Begin() const
Return an Iterator to the first member of the set.
Definition: UIDSet.h:144
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
UIDSet & operator=(const UIDSet &other)
Assignment operator.
Definition: UIDSet.h:71
bool operator!=(const UIDSet &other) const
Inequality operator.
Definition: UIDSet.h:182