PcapPlusPlus
20.08
|
#include <SystemUtils.h>
Public Types | |
typedef void(* | EventHandlerCallback) (void *cookie) |
Public Member Functions | |
void | onApplicationInterrupted (EventHandlerCallback handler, void *cookie) |
Static Public Member Functions | |
static ApplicationEventHandler & | getInstance () |
A singleton class that provides callbacks for events that occur during application life-cycle such as ctrl+c pressed, application closed, killed, etc.
pcpp::ApplicationEventHandler::EventHandlerCallback |
The callback to be invoked when the event occurs
[in] | cookie | A pointer the the cookie provided by the user in ApplicationEventHandler c'tor |
|
inlinestatic |
As ApplicationEventHandler is a singleton, this is the static getter to retrieve its instance
void pcpp::ApplicationEventHandler::onApplicationInterrupted | ( | EventHandlerCallback | handler, |
void * | cookie | ||
) |
Register for an application-interrupted event, meaning ctrl+c was pressed
[in] | handler | The callback to be activated when the event occurs |
[in] | cookie | A pointer to a user provided object. This object will be transferred to the EventHandlerCallback callback. This cookie is very useful for transferring objects that give context to the event callback |