Regina Calculation Engine
Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
regina::BoolSet Class Reference

A set of booleans. More...

#include <utilities/boolset.h>

Public Member Functions

 BoolSet ()
 Creates a new empty set. More...
 
 BoolSet (bool member)
 Creates a set containing a single member as given. More...
 
 BoolSet (const BoolSet &cloneMe)=default
 Creates a set equal to the given set. More...
 
 BoolSet (bool insertTrue, bool insertFalse)
 Creates a set specifying whether true and/or false should be a member. More...
 
bool hasTrue () const
 Determines if true is a member of this set. More...
 
bool hasFalse () const
 Determines if false is a member of this set. More...
 
bool contains (bool value) const
 Determines if the given boolean is a member of this set. More...
 
void insertTrue ()
 Inserts true into this set if it is not already present. More...
 
void insertFalse ()
 Inserts false into this set if it is not already present. More...
 
void removeTrue ()
 Removes true from this set if it is present. More...
 
void removeFalse ()
 Removes false from this set if it is present. More...
 
void empty ()
 Removes all elements from this set. More...
 
void fill ()
 Places both true and false into this set if they are not already present. More...
 
bool operator== (const BoolSet &other) const
 Determines if this set is equal to the given set. More...
 
bool operator!= (const BoolSet &other) const
 Determines if this set is not equal to the given set. More...
 
bool operator< (const BoolSet &other) const
 Determines if this set is a proper subset of the given set. More...
 
bool operator> (const BoolSet &other) const
 Determines if this set is a proper superset of the given set. More...
 
bool operator<= (const BoolSet &other) const
 Determines if this set is a subset of (possibly equal to) the given set. More...
 
bool operator>= (const BoolSet &other) const
 Determines if this set is a superset of (possibly equal to) the given set. More...
 
BoolSetoperator= (const BoolSet &cloneMe)=default
 Sets this set to be identical to the given set. More...
 
BoolSetoperator= (bool member)
 Sets this set to the single member set containing the given element. More...
 
BoolSetoperator|= (const BoolSet &other)
 Sets this set to be the union of this and the given set. More...
 
BoolSetoperator&= (const BoolSet &other)
 Sets this set to be the intersection of this and the given set. More...
 
BoolSetoperator^= (const BoolSet &other)
 Sets this set to be the symmetric difference of this and the given set. More...
 
BoolSet operator| (const BoolSet &other) const
 Returns the union of this set with the given set. More...
 
BoolSet operator& (const BoolSet &other) const
 Returns the intersection of this set with the given set. More...
 
BoolSet operator^ (const BoolSet &other) const
 Returns the symmetric difference of this set and the given set. More...
 
BoolSet operator~ () const
 Returns the complement of this set. More...
 
unsigned char byteCode () const
 Returns the byte code representing this boolean set. More...
 
void setByteCode (unsigned char code)
 Sets this boolean set to that represented by the given byte code. More...
 

Static Public Member Functions

static BoolSet fromByteCode (unsigned char code)
 Creates a boolean set from the given byte code. More...
 

Static Public Attributes

static const BoolSet sNone
 The empty set. More...
 
static const BoolSet sTrue
 The set containing only true. More...
 
static const BoolSet sFalse
 The set containing only false. More...
 
static const BoolSet sBoth
 The set containing both true and false. More...
 

Friends

std::ostream & operator<< (std::ostream &out, const BoolSet &set)
 Writes the given boolean set to the given output stream. More...
 

Detailed Description

A set of booleans.

Note that there are only four possible such sets. BoolSet objects are small enough to pass about by value instead of by reference.


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

Copyright © 1999-2021, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@maths.uq.edu.au).