State
// These macros define a state mechanism in any class that receives OnBgnUpd() and/or OnEndUpd() updates.
// This enables a class to use SetBgnUpdState()/SetEndUpdState() to redirect the update callbacks to any class member
// functions as needed to alter logic (state) of the object.
/**/
// Put this last in the OnBgnUpd() callback.
#define RVBGNUPDSTATE if (bgnUpdState) (*this.*bgnUpdState)();
// Put this last in the OnEndUpd() callback.
#define RVENDUPDSTATE if (endUpdState) (*this.*endUpdState)();
// Put this in the private section of the class and set [_CLASS_] to the class name. This defines SetBgnUpdState()
// /SetEndUpdState() functions that can set a member function to begin receiving updates. The syntax for passing
// a member function to the call is: SetBgnUpdState(&MyClass::MyFunction).
#define RVSTATEFUNCS(_CLASS_) \
typedef void (_CLASS_:: *FState)();\
FState bgnUpdState = 0, endUpdState = 0;\
void SetBgnUpdState(FState func) { bgnUpdState = func; }\
void SetEndUpdState(FState func) { endUpdState = func; }