Hi.
I would like to create a generic class that wraps around, say, an API function. I need a way to pass into a function parameters such as FEATURE1 | FEATURE3. I believe that requires the use of bitwise AND, OR, and NOT similar to MFC programming style.
For example:
-----
// call function to initialize variables
SetVariableA(FEATURE1 | FEATURE 3) // I want feature1 and feature3
-----
Here is what SetVariableA(...) might look like
-----
enum STYLE {FEATURE1 = 0, FEATURE2, FEATURE3}
SetVariableA(...)
{
}
-----
Basically, I am not familiar with the use of enum with bitwise AND, OR, and NOT. Here is a what I would like to accomplish.
- user calls function to setup a feature: function(FEATURE1)
- function determines what feature the user wants
How would you implement some like the above using enum, bitwise AND, OR, and NOT?
Thanks,
Kuphryn
P.S. MFC programmers seem
I would like to create a generic class that wraps around, say, an API function. I need a way to pass into a function parameters such as FEATURE1 | FEATURE3. I believe that requires the use of bitwise AND, OR, and NOT similar to MFC programming style.
For example:
-----
// call function to initialize variables
SetVariableA(FEATURE1 | FEATURE 3) // I want feature1 and feature3
-----
Here is what SetVariableA(...) might look like
-----
enum STYLE {FEATURE1 = 0, FEATURE2, FEATURE3}
SetVariableA(...)
{
}
-----
Basically, I am not familiar with the use of enum with bitwise AND, OR, and NOT. Here is a what I would like to accomplish.
- user calls function to setup a feature: function(FEATURE1)
- function determines what feature the user wants
How would you implement some like the above using enum, bitwise AND, OR, and NOT?
Thanks,
Kuphryn
P.S. MFC programmers seem