000
16.03.2004, 14:27 Uhr
~Jose
Gast
|
Hi all, I hope some of you can help me.
I have defined an enum with different possible events
| C++: |
typedef enum _TEvent { event1 = (1uL<<1), event2 = (1uL<<2), event3 = (1uL<<4)
} TEvent;
|
And now I want to define an Array in which each element is a mask of the elements of the enumeration, for example:
| C++: |
TMask[0] = event1 | event3; Tmask[1] = event2 | event3; Tmask[2] = event1;
|
Etc?
Now I will receive an event and I have to see if it is part of the mask
| C++: |
For (int i=0; i<Tmasksize; i++) { if (event & Tmask[i]) {
} }
|
How can I define this array? Thanks in advance for you answers, I really appreciate it!
Jose.
| Bearbeitung von Pablo: |
CPP Tags added by me
|
Dieser Post wurde am 16.03.2004 um 14:30 Uhr von Pablo editiert. |