InterruptCB
typedef struct InterruptCB {
int (*callback)(void*);
void *opaque;
} InterruptCB;
class Parse{
public:
static int InterruptCallBack(void* ctx) {
Parse* parse = reinterpret_cast<Parse*>(ctx);
if (parse) {
// do something
return 1;
}
return 0;
}
int Open() {
intrpt_callback = {InterruptCallBack, this};
}
private:
InterruptCB intrpt_callback;
}; // class Parse