BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlt::DayOfWeekSet Class Reference

#include <bdlt_dayofweekset.h>

Public Types

typedef DayOfWeekSet_Iter iterator
 Standard nested alias for set container's iterator.
 
typedef iterator const_iterator
 Standard nested alias for set container's constant iterator.
 
typedef bsl::reverse_iterator< iteratorreverse_iterator
 Standard nested alias for set container's reverse iterator.
 
typedef reverse_iterator const_reverse_iterator
 Standard nested alias for set container's constant reverse iterator.
 

Public Member Functions

 DayOfWeekSet ()
 Create an empty set.
 
 DayOfWeekSet (const DayOfWeekSet &original)
 
 ~DayOfWeekSet ()
 Destroy this object.
 
DayOfWeekSetoperator= (const DayOfWeekSet &rhs)
 
DayOfWeekSetoperator|= (const DayOfWeekSet &rhs)
 
DayOfWeekSetoperator&= (const DayOfWeekSet &rhs)
 
DayOfWeekSetoperator^= (const DayOfWeekSet &rhs)
 
DayOfWeekSetoperator-= (const DayOfWeekSet &rhs)
 
void add (DayOfWeek::Enum value)
 Add the specified value to this set.
 
bool remove (DayOfWeek::Enum value)
 
void removeAll ()
 Remove all members of this set.
 
template<class STREAM >
STREAM & bdexStreamIn (STREAM &stream, int version)
 
bool areMembers (const DayOfWeekSet &set) const
 
iterator begin () const
 Return an iterator referencing the first valid element in this set.
 
iterator end () const
 
bool isEmpty () const
 
bool isMember (DayOfWeek::Enum value) const
 
int length () const
 Return the number of elements in this set.
 
reverse_iterator rbegin () const
 
reverse_iterator rend () const
 
template<class STREAM >
STREAM & bdexStreamOut (STREAM &stream, int version) const
 
bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
 

Static Public Member Functions

static int maxSupportedBdexVersion (int versionSelector)
 
static int maxSupportedBdexVersion ()
 

Friends

bool operator== (const DayOfWeekSet &, const DayOfWeekSet &)
 
bool operator!= (const DayOfWeekSet &, const DayOfWeekSet &)
 
DayOfWeekSet operator~ (const DayOfWeekSet &)
 
template<class HASHALG >
void hashAppend (HASHALG &hashAlg, const DayOfWeekSet &)
 

Detailed Description

This class implements an efficient value-semantic, ordered set of DayOfWeek values. This set requires a fixed capacity, and all operations operate in constant time, and provide the no-throw guarantee.

See bdlt_dayofweekset

Member Typedef Documentation

◆ const_iterator

◆ const_reverse_iterator

◆ iterator

◆ reverse_iterator

typedef bsl::reverse_iterator<iterator> bdlt::DayOfWeekSet::reverse_iterator

Constructor & Destructor Documentation

◆ DayOfWeekSet() [1/2]

bdlt::DayOfWeekSet::DayOfWeekSet ( )
inline

◆ DayOfWeekSet() [2/2]

bdlt::DayOfWeekSet::DayOfWeekSet ( const DayOfWeekSet original)
inline

Create a set initialized to the value of the specified original set.

◆ ~DayOfWeekSet()

bdlt::DayOfWeekSet::~DayOfWeekSet ( )
inline

Member Function Documentation

◆ add()

void bdlt::DayOfWeekSet::add ( DayOfWeek::Enum  value)
inline

◆ areMembers()

bool bdlt::DayOfWeekSet::areMembers ( const DayOfWeekSet set) const
inline

Return true if this set contains all elements of the specified set, and false otherwise.

◆ bdexStreamIn()

template<class STREAM >
STREAM & bdlt::DayOfWeekSet::bdexStreamIn ( STREAM &  stream,
int  version 
)

Assign to this object the value read from the specified input stream using the specified version format, and return a reference to stream. If stream is initially invalid, this operation has no effect. If version is not supported, this object is unaltered and stream is invalidated, but otherwise unmodified. If version is supported but stream becomes invalid during this operation, this object has an undefined, but valid, state. Note that no version is read from stream. See the bslx package-level documentation for more information on BDEX streaming of value-semantic types and containers.

◆ bdexStreamOut()

template<class STREAM >
STREAM & bdlt::DayOfWeekSet::bdexStreamOut ( STREAM &  stream,
int  version 
) const

Write the value of this object, using the specified version format, to the specified output stream, and return a reference to stream. If stream is initially invalid, this operation has no effect. If version is not supported, stream is invalidated, but otherwise unmodified. Note that version is not written to stream. See the bslx package-level documentation for more information on BDEX streaming of value-semantic types and containers.

◆ begin()

DayOfWeekSet::iterator bdlt::DayOfWeekSet::begin ( ) const
inline

◆ end()

DayOfWeekSet::iterator bdlt::DayOfWeekSet::end ( ) const
inline

Return an iterator indicating one position past the last possible element in this set.

◆ isEmpty()

bool bdlt::DayOfWeekSet::isEmpty ( ) const
inline

Return true if there are no elements in this set, and false otherwise.

◆ isMember()

bool bdlt::DayOfWeekSet::isMember ( DayOfWeek::Enum  value) const
inline

Return true if the specified value is an element of this set, and false otherwise.

◆ length()

int bdlt::DayOfWeekSet::length ( ) const
inline

◆ maxSupportedBdexVersion() [1/2]

int bdlt::DayOfWeekSet::maxSupportedBdexVersion ( )
inlinestatic
Deprecated:
Use maxSupportedBdexVersion(int) instead.

Return the most current BDEX streaming version number supported by this class.

◆ maxSupportedBdexVersion() [2/2]

int bdlt::DayOfWeekSet::maxSupportedBdexVersion ( int  versionSelector)
inlinestatic

Return the maximum valid BDEX format version, as indicated by the specified versionSelector, to be passed to the bdexStreamOut method. Note that it is highly recommended that versionSelector be formatted as "YYYYMMDD", a date representation. Also note that versionSelector should be a compile-time-chosen value that selects a format version supported by both externalizer and unexternalizer. See the bslx package-level documentation for more information on BDEX streaming of value-semantic types and containers.

◆ operator&=()

DayOfWeekSet & bdlt::DayOfWeekSet::operator&= ( const DayOfWeekSet rhs)
inline

Assign to this set the intersection of this set with the specified rhs set (i.e., a set containing elements that are in both this set and the rhs set), and return a reference providing modifiable access to this set.

◆ operator-=()

DayOfWeekSet & bdlt::DayOfWeekSet::operator-= ( const DayOfWeekSet rhs)
inline

Assign to this set the subtraction of the specified rhs set from this set (i.e., a set containing elements that are in this set, but not in the rhs set), and return a reference providing modifiable access to this set.

◆ operator=()

DayOfWeekSet & bdlt::DayOfWeekSet::operator= ( const DayOfWeekSet rhs)
inline

Assign to this set the value of the specified rhs set, and return a reference providing modifiable access to this set.

◆ operator^=()

DayOfWeekSet & bdlt::DayOfWeekSet::operator^= ( const DayOfWeekSet rhs)
inline

Assign to this set the exclusive-or of this set with the specified rhs set (i.e., a set containing elements that are either in this set, but not rhs, or in rhs, but not in this set), and return a reference providing modifiable access to this set.

◆ operator|=()

DayOfWeekSet & bdlt::DayOfWeekSet::operator|= ( const DayOfWeekSet rhs)
inline

Assign to this set the union of this set with the specified rhs set (i.e., a set containing elements that are in either this set or the rhs set, or in both sets), and return a reference providing modifiable access to this set.

◆ print()

bsl::ostream & bdlt::DayOfWeekSet::print ( bsl::ostream &  stream,
int  level = 0,
int  spacesPerLevel = 4 
) const

Format this object to the specified output stream at the (absolute value of) the optionally specified indentation level, and return a reference to stream. If level is specified, optionally specify spacesPerLevel, the number of spaces per indentation level for this and all of its nested objects. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level). If stream is not valid on entry, this operation has no effect.

◆ rbegin()

DayOfWeekSet::reverse_iterator bdlt::DayOfWeekSet::rbegin ( ) const
inline

Return a reverse iterator referencing the last valid element in this set.

◆ remove()

bool bdlt::DayOfWeekSet::remove ( DayOfWeek::Enum  value)
inline

Remove the specified value from this set. Return true if value was a member of this set, and false otherwise.

◆ removeAll()

void bdlt::DayOfWeekSet::removeAll ( )
inline

◆ rend()

DayOfWeekSet::reverse_iterator bdlt::DayOfWeekSet::rend ( ) const
inline

Return a reverse iterator indicating one position before the first possible element in this set.

Friends And Related Symbol Documentation

◆ hashAppend

template<class HASHALG >
void hashAppend ( HASHALG &  hashAlg,
const DayOfWeekSet  
)
friend

Pass the specified object to the specified hashAlg. This function integrates with the bslh modular hashing system and effectively provides a bsl::hash specialization for DayOfWeekSet.

◆ operator!=

bool operator!= ( const DayOfWeekSet ,
const DayOfWeekSet  
)
friend

Return true if the specified lhs and rhs sets do not have the same value, and false otherwise. Two sets do not have the same value if they differ in length or there exists an element of one set that is not a member of the other set.

◆ operator==

bool operator== ( const DayOfWeekSet ,
const DayOfWeekSet  
)
friend

Return true if the specified lhs and rhs sets have the same value, and false otherwise. Two sets have the same value if they have the same length and all the elements of one set are members of the other set.

◆ operator~

DayOfWeekSet operator~ ( const DayOfWeekSet )
friend

Return a set containing the complement of the specified set (i.e., those members not contained in set).


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