Quantum Fog  0.9.3
C_ACTION_FLAGS.h
1 #pragma once
2 #include "QFog_constants.h"
3 //act = action
4 
5 //This class should be used as a mixin with any class X that
6 //hosts an LUndoer attachment. This class provides
7 //a Boolean flag is_modified for each possible LAction of X.
8 //In QFog_constants.h, define an index for each action of X.
9 //The indices must be consecutive integers starting at 0.
10 
11 
12 //******************************************
14 {
15 protected:
16  BOOLEAN its_is_modified[max_num_of_act_types];
17  USHORT its_num_of_act_types;
18 public:
19  C_ACTION_FLAGS(USHORT num_of_actions);
20  BOOLEAN is_modified(USHORT act_type) const;
21  VOID set_is_modified(BOOLEAN is_mod, USHORT act_type);
22  VOID set_is_modified(BOOLEAN is_mod);
23 };
24 #pragma mark -
25 
26 
27 //******************************************
28 inline
29 BOOLEAN C_ACTION_FLAGS::is_modified(
30 USHORT act_type) //in
31 const
32 {
33  SignalIf_(act_type >= its_num_of_act_types);
34  return its_is_modified[act_type];
35 }
36 //******************************************
37 inline
38 VOID C_ACTION_FLAGS::set_is_modified(
39 BOOLEAN is_mod, //in
40 USHORT act_type) //in
41 {
42  SignalIf_(act_type >= its_num_of_act_types);
43  its_is_modified[act_type] = is_mod;
44  //For is_mod==true, could say PostAction(0) here.
45 }
46 
Definition: C_ACTION_FLAGS.h:13