|
How to understand "machine.add_notifier(MACHINE_NOTIFY_PAU SE, machine_notify_delegate(FUNC(output_paus e), &machine));"?
#324589 - 04/12/14 06:16 PM
|
|
|
machine.add_notifier(MACHINE_NOTIFY_PAUSE, machine_notify_delegate(FUNC(output_pause), &machine));
"machine" is a object.
enum machine_notification { MACHINE_NOTIFY_FRAME, MACHINE_NOTIFY_RESET, MACHINE_NOTIFY_PAUSE, MACHINE_NOTIFY_RESUME, MACHINE_NOTIFY_EXIT, MACHINE_NOTIFY_COUNT };
typedef delegate<void ()> machine_notify_delegate;
#define FUNC(x) &x, #x
I know FUNC(output_pause) = &output_pause,"output_pause"
How about machine_notify_delegate(&output_pause,"output_pause",&machine)?
Is it delegate<void ()>(&output_pause,"output_pause",&machine)?
|
|
|
|
Re: How to understand "machine.add_notifier(MACHINE_NOTIFY_PAU SE, machine_notify_delegate(FUNC(output_paus e), &machine));"?
[Re: lxd]
#324748 - 04/15/14 09:19 PM
|
|
|
Yes, I have understood it now.
|
|
|
|