Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

strmod::lcore::enum_set< enum_t, first, last > Class Template Reference

This class is to easily manipulate a set of flags corresponding to members of an enum. More...

#include <LCore/enum_set.h>

Inheritance diagram for strmod::lcore::enum_set< enum_t, first, last >:

Inheritance graph
[legend]
List of all members.

Public Methods

 enum_set ()
 Construct an enum_set with no bits set.

 enum_set (enum_t val)
 Construct an enum_set with at most one bit set.

 enum_set (enum_t val1, enum_t val2)
 Construct an enum_set with at most two bits set.

 enum_set (enum_t val1, enum_t val2, enum_t val3)
 Construct an enum_set with at most three bits set.

 enum_set (enum_t val1, enum_t val2, enum_t val3, enum_t val4)
 Construct an enum_set with at most four bits set.

 enum_set (enum_t val1, enum_t val2, enum_t val3, enum_t val4, enum_t val5)
 Construct an enum_set with at most five bits set.

 enum_set (enum_t val1, enum_t val2, enum_t val3, enum_t val4, enum_t val5, enum_t val6)
 Construct an enum_set with at most six bits set.

 enum_set (const self_t &other)
 Copy an enum_set.

self_t & operator &= (const self_t &__rhs)
 Compute bit1 & bit2 for all corresponding bits in both bitsets.

self_t & operator|= (const self_t &__rhs)
 Compute bit1 | bit2 for all corresponding bits in both bitsets.

self_t & operator^= (const self_t &__rhs)
 Compute bit1 ^ bit2 for all corresponding bits in both bitsets.

self_t & set (enum_t __pos)
 Set a bit.

self_t & set (enum_t __pos, bool __val)
 Set a bit to a particular boolean value.

self_t & reset ()
 Clear all bits.

self_t & reset (enum_t __pos)
 Clear a bit.

self_t & flip (enum_t __pos)
 Flip a bit from 0 to 1 or 1 to 0.

bool operator[] (enum_t __pos) const
 Allow bitset[enum_val] syntax.

size_t count () const
 How many bits are set?

size_t size () const
 How many total bits?

const self_t & operator= (const self_t &b)
 Copy one bitset into another.

bool operator== (const self_t &__rhs) const
 Do all corresponding bits match in both bitsets?

bool operator!= (const self_t &__rhs) const
 Do any corresponding bits differ in both bitsets?

bool test (enum_t __pos) const
 Is the bit on?

bool any () const
 Are any bits set (1, true)?

bool none () const
 Are all bits clear (0, false)?

std::string to_string () const
 Return an ASCII representation of the bitset.

 operator bool () const
 Are any bits set (1, true)?


Detailed Description

template<class enum_t, enum_t first, enum_t last>
class strmod::lcore::enum_set< enum_t, first, last >

This class is to easily manipulate a set of flags corresponding to members of an enum.

Parameters:
enum_t The enum type of the flags.
first The lowest valued enum flag.
last The highest valued enum flag.

Definition at line 48 of file enum_set.h.


The documentation for this class was generated from the following file:
Generated on Wed Jan 29 00:32:47 2003 for libNet by doxygen1.3-rc1