I’m implementing a global debug module ,a single module contains a struct to hold all global variables in C, and our code has both C and C++ modules. Is there a way if an existing variable is set somewhere, would also cause to update debug global variables in structure as well.
I was thinking of setter functions , but this requires modification in every module.Instead is there a way to replicate functionality like valuechangeevent in JSF with C or C++.
I’m implementing a global debug module ,a single module contains a struct to hold
Share
You can make the debug module contains all the pointers to the variables you are monitoring.
Now suppose
var_1is changed somewhere, and you can directly see from__debug__by accessing:Otherwise, you will have to use a setter and change everything in the modules, or use an infinite loop or timer to monitor all the variables. There is no event registration for value change in C.