Open Lighting Architecture  Latest Git
Public Types | Public Member Functions | Friends | List of all members
ola::rdm::UIDSet Class Reference
RDM » UID

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. More...
 
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. More...
 
bool Empty () const
 Return whether the UID set is empty. More...
 
void AddUID (const UID &uid)
 Add a UID to the set. More...
 
void RemoveUID (const UID &uid)
 Remove a UID from the set. More...
 
bool Contains (const UID &uid) const
 Check if the set contains a UID. More...
 
UIDSet Union (const UIDSet &other)
 Return the union of this set and another UIDSet. More...
 
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. More...
 
bool operator== (const UIDSet &other) const
 Equality operator. More...
 
bool operator!= (const UIDSet &other) const
 Inequality operator. More...
 
std::string ToString () const
 Convert a UIDSet to a human readable string. More...
 

Friends

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

Constructor & Destructor Documentation

◆ UIDSet()

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

Copy constructor.

Parameters
otherthe UIDSet to copy.

Member Function Documentation

◆ AddUID()

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

Add a UID to the set.

Parameters
uidthe UID to add.

◆ Contains()

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.

◆ Empty()

bool ola::rdm::UIDSet::Empty ( ) const
inline

Return whether the UID set is empty.

Returns
true if there are no UIDs in the set.

◆ operator!=()

bool ola::rdm::UIDSet::operator!= ( const UIDSet other) const
inline

Inequality operator.

Parameters
otherthe UIDSet to compare to.

◆ operator==()

bool ola::rdm::UIDSet::operator== ( const UIDSet other) const
inline

Equality operator.

Parameters
otherthe UIDSet to compare to.

◆ RemoveUID()

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

Remove a UID from the set.

Parameters
uidthe UID to remove.

◆ SetDifference()

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.

◆ Size()

unsigned int ola::rdm::UIDSet::Size ( ) const
inline

Return the number of UIDs in the set.

Returns
the number of UIDs in the set.

◆ ToString()

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.

◆ Union()

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

◆ operator<<

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: