IBitFlag

The IBitFlag class is the abstract base class for the bitwise styles and attributes used by window and control classes in the Open Class Library. Because this class in an abstract base class, you cannot create objects of this class.

Deriving Classes from IBitFlag

Typically, you can declare classes derived from IBitFlag by using the macros that accompany this class. Optionally, these macros let you do the following:

Macro Descriptions

You can use the following macros to declare classes derived from IBitFlag:

INESTEDBITFLAGCLASSDEF0 macro
Declares a logical base bitwise flag class scoped to another class. A logical base bitwise class is a class of bitwise flag objects that cannot be constructed from a bitwise flag object of another class.
INESTEDBITFLAGCLASSDEF1 macro
Declares a bitwise flag class whose objects can be constructed from an object of another bitwise flag class. The library assumes both bitwise flag classes have the same name and are scoped to another class.
INESTEDBITFLAGCLASSDEF2 macro
Declares a bitwise flag class whose objects can be constructed from an object of two other bitwise flag classes. The library assumes all the bitwise flag classes have the same name and are scoped to another class.
INESTEDBITFLAGCLASSDEF3 macro
Declares a bitwise flag class whose objects can be constructed from an object of three other bitwise flag classes. The library assumes all the bitwise flag classes have the same name and are scoped to another class.
INESTEDBITFLAGCLASSDEF4 macro
Declares a bitwise flag class whose objects can be constructed from an object of four other bitwise flag classes. The library assumes all the bitwise flag classes have the same name and are scoped to another class.
INESTEDBITFLAGCLASSFUNCS macro
Declares global functions that operate on a class of bitwise flag objects scoped to another class. The functions are global, rather than member functions, to allow for commutative operations between objects of different bitwise flag classes.
Note: Do not use this macro to define global functions for a logical base style class (one declared with the INESTEDBITFLAGCLASSDEF0 macro).


IBitFlag - Member Functions and Data by Group

Constructors & Destructor

These constructors are protected because objects derived from this class should not be arbitrarily constructed. To provide type safety for window and control constructors, you can only specify the following:


[view class]
IBitFlag


Overload 1
protected:
IBitFlag(const IBitFlag& bitFlag)

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
protected:
IBitFlag()

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 3
protected:
IBitFlag( unsigned long count, const unsigned long bitIndex [ ] )

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Assignment

Use this member to set the value of the object.


[view class]
setValue
protected:
IBitFlag& setValue(const IBitFlag& bitFlag)

Assigns the bits of the passed in IBitFlag object to this object.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Comparisons

Use these members to compare bitflag values.


[view class]
operator !=
public:
bool operator !=(const IBitFlag& rhs) const

Returns true if the object and the IBitFlag object passed in are not equal.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
operator ==
public:
bool operator ==(const IBitFlag& rhs) const

Returns true if the object and the IBitFlag object passed in are equal.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
comparisonAnd
protected:
bool comparisonAnd(const IBitFlag& rhs) const

Returns true if the object and the IBitFlag object passed in have any bits set in common.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Diagnostics

Use these members to provide diagnostic information.


[view class]
asDebugInfo
public:
IString asDebugInfo() const

Returns the bits set in the IBitFlag object as a series of bits.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
asString
public:
IString asString() const

Returns the bits set in the IBitFlag object as a series of unsigned long integers.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Queries

Use these members to return the value of the object.


[view class]
maxNumberOfBits
public:
static unsigned long maxNumberOfBits()

Returns the maximum number of bits that can be stored in an IBitFlag object.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
bitwiseAnd
protected:
IBitFlag bitwiseAnd(const IBitFlag& rhs) const

Returns an IBitFlag object that is the bitwise And of the object and the rhs argument.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
bitwiseOr
protected:
IBitFlag bitwiseOr(const IBitFlag& rhs) const

Returns an IBitFlag object that is the bitwise Or of the object and the rhs argument.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
negate
protected:
IBitFlag negate() const

Returns an IBitFlag object that is the ones complement of the object.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IBitFlag - Inherited Member Functions and Data

Inherited Public Functions

Inherited Public Data

Inherited Protected Functions

Inherited Protected Data