Open Lighting Architecture  0.9.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Friends | List of all members
ola::rdm::UIDSet Class Reference

Detailed Description

Represents a set of RDM UIDs.

Public Types

typedef std::set< UID >
::const_iterator 
Iterator
 the Iterator for a UIDSets

Public Member Functions

 UIDSet ()
 Construct an empty set.
 UIDSet (const UIDSet &other)
 Copy constructor.
UIDSetoperator= (const UIDSet &other)
 Assignment operator.
void Clear ()
 Remove all members from the set.
unsigned int Size () const
 Return the number of UIDs in the set.
void AddUID (const UID &uid)
 Add a UID to the set.
void RemoveUID (const UID &uid)
 Remove a UID from the set.
bool Contains (const UID &uid) const
 Check if the set contains a UID.
UIDSet Union (const UIDSet &other)
 Return the union of this set and another UIDSet.
Iterator Begin () const
 Return an Iterator to the first member of the set.
Iterator End () const
 Return an Iterator to one-pass-the-last member of the set.
UIDSet SetDifference (const UIDSet &other)
 Return the UIDs in this set that don't exist in other.
bool operator== (const UIDSet &other) const
 Equality operator.
bool operator!= (const UIDSet &other) const
 Inequality operator.
std::string ToString () const
 Convert a UIDSet to a human readable string.

Friends

std::ostream & operator<< (std::ostream &out, const UIDSet &uid_set)
 A helper function to write a UIDSet to an ostream.

Constructor & Destructor Documentation

ola::rdm::UIDSet::UIDSet ( const UIDSet other)
inline

Copy constructor.

Parameters
otherthe UIDSet to copy.

Member Function Documentation

void ola::rdm::UIDSet::AddUID ( const UID uid)
inline

Add a UID to the set.

Parameters
uidthe UID to add.
bool ola::rdm::UIDSet::Contains ( const UID uid) const
inline

Check if the set contains a UID.

Parameters
uidthe UID to check for.
Returns
true if the set contains this UID.
bool ola::rdm::UIDSet::operator!= ( const UIDSet other) const
inline

Inequality operator.

Parameters
otherthe UIDSet to compare to.
bool ola::rdm::UIDSet::operator== ( const UIDSet other) const
inline

Equality operator.

Parameters
otherthe UIDSet to compare to.
void ola::rdm::UIDSet::RemoveUID ( const UID uid)
inline

Remove a UID from the set.

Parameters
uidthe UID to remove.
UIDSet ola::rdm::UIDSet::SetDifference ( const UIDSet other)
inline

Return the UIDs in this set that don't exist in other.

Parameters
otherthe UIDSet to subtract from this set.
Returns
the difference between this UIDSet and other.
unsigned int ola::rdm::UIDSet::Size ( ) const
inline

Return the number of UIDs in the set.

Returns
the number of UIDs in the set.
std::string ola::rdm::UIDSet::ToString ( ) const
inline

Convert a UIDSet to a human readable string.

Returns
a comma separated string with the UIDs from the set.
UIDSet ola::rdm::UIDSet::Union ( const UIDSet other)
inline

Return the union of this set and another UIDSet.

Parameters
otherthe UIDSet to perform the union with.
Returns
the union of the two UIDSets.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const UIDSet uid_set 
)
friend

A helper function to write a UIDSet to an ostream.

Parameters
outthe ostream
uid_setthe UIDSet to write.

The documentation for this class was generated from the following file: