Bitcoin Core 28.99.0
P2P Digital Currency
|
Event class. More...
#include <httpserver.h>
Public Member Functions | |
HTTPEvent (struct event_base *base, bool deleteWhenTriggered, const std::function< void()> &handler) | |
Create a new event. More... | |
~HTTPEvent () | |
void | trigger (struct timeval *tv) |
Trigger the event. More... | |
Public Attributes | |
bool | deleteWhenTriggered |
std::function< void()> | handler |
Private Attributes | |
struct event * | ev |
Event class.
This can be used either as a cross-thread trigger or as a timer.
Definition at line 164 of file httpserver.h.
HTTPEvent::HTTPEvent | ( | struct event_base * | base, |
bool | deleteWhenTriggered, | ||
const std::function< void()> & | handler | ||
) |
Create a new event.
deleteWhenTriggered deletes this event object after the event is triggered (and the handler called) handler is the handler to call when the event is triggered.
Definition at line 573 of file httpserver.cpp.
HTTPEvent::~HTTPEvent | ( | ) |
Definition at line 579 of file httpserver.cpp.
void HTTPEvent::trigger | ( | struct timeval * | tv | ) |
Trigger the event.
If tv is 0, trigger it immediately. Otherwise trigger it after the given time has elapsed.
Definition at line 583 of file httpserver.cpp.
bool HTTPEvent::deleteWhenTriggered |
Definition at line 179 of file httpserver.h.
|
private |
Definition at line 182 of file httpserver.h.
std::function<void()> HTTPEvent::handler |
Definition at line 180 of file httpserver.h.