pgFlag< D, T > Class Template Reference
[pgGen -- General purpose module]

A set of bits as a data structure. More...

#include <pg_flag.h>

List of all members.

Public Member Functions

 pgFlag ()
 Constructs and initializes a pgFlag whose all bits are off.
bool operator== (pgFlag< D, T > flag) const
 Returns whether this pgFlag is equal to the right hand side pgFlag.
bool operator!= (pgFlag< D, T > flag) const
 Returns whether this pgFlag is unequal to the right hand side pgFlag.
getValue () const
 Returns the bits of this pgFlag as the data type.
bool isOn (T flag) const
 Returns whether the specified flag is on.
bool isOff (T flag) const
 Returns whether the specified flag is off.
void setOn (T flag)
 Sets the specified flag on.
void setOff (T flag)
 Sets the specified flag off.
void set (T flag, bool is_on)
 Sets the specified flag to the specified value.
void clear ()
 Sets all bits of this pgFlag off.


Detailed Description

template<class D, class T>
class pgFlag< D, T >

A set of bits as a data structure.

Template Parameters:
D The data type to store flag bits.
T The enum type whose constant values mean bit number. The each value of the enum constants must be less than the number of bits of the data type.

Member Function Documentation

template<class D, class T>
D pgFlag< D, T >::getValue (  )  const [inline]

Returns the bits of this pgFlag as the data type.

Returns:
The bits of this pgFlag as the data type.

template<class D, class T>
bool pgFlag< D, T >::isOff ( flag  )  const [inline]

Returns whether the specified flag is off.

Parameters:
[in] flag A flag which is a value of the enum constants.
Returns:
Whether the specified flag is off.

template<class D, class T>
bool pgFlag< D, T >::isOn ( flag  )  const [inline]

Returns whether the specified flag is on.

Parameters:
[in] flag A flag which is a value of the enum constants.
Returns:
Whether the specified flag is on.

template<class D, class T>
bool pgFlag< D, T >::operator!= ( pgFlag< D, T >  flag  )  const [inline]

Returns whether this pgFlag is unequal to the right hand side pgFlag.

Parameters:
[in] flag The right hand side pgFlag.
Returns:
Whether this pgFlag is unequal to the right hand side pgFlag.

template<class D, class T>
bool pgFlag< D, T >::operator== ( pgFlag< D, T >  flag  )  const [inline]

Returns whether this pgFlag is equal to the right hand side pgFlag.

Parameters:
[in] flag The right hand side pgFlag.
Returns:
Whether this pgFlag is equal to the right hand side pgFlag.

template<class D, class T>
void pgFlag< D, T >::set ( flag,
bool  is_on 
) [inline]

Sets the specified flag to the specified value.

Parameters:
[in] flag A flag which is a value of the enum constants.
[in] is_on If true, the flag is set on. Otherwise, the flag is set off.

template<class D, class T>
void pgFlag< D, T >::setOff ( flag  )  [inline]

Sets the specified flag off.

Parameters:
[in] flag A flag which is a value of the enum constants.

template<class D, class T>
void pgFlag< D, T >::setOn ( flag  )  [inline]

Sets the specified flag on.

Parameters:
[in] flag A flag which is a value of the enum constants.


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

Generated on Sat Aug 15 11:24:38 2009 for Pogolyn by  doxygen 1.5.8