summaryrefslogtreecommitdiffstats
path: root/src/events.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/events.h')
-rw-r--r--src/events.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/events.h b/src/events.h
index c13e9c0..460ae95 100644
--- a/src/events.h
+++ b/src/events.h
@@ -58,6 +58,7 @@ enum t_event_type {
EV_ASYNC_RESPONSE, /**< Response on an asynchronous question */
EV_BROKEN_CONNECTION, /**< Persitent connection to SIP proxy broken */
EV_TCP_PING, /**< Send a TCP ping (double CRLF) */
+ EV_FN_CALL, /**< Queued function call */
};
/** Abstract parent class for all events */
@@ -627,6 +628,14 @@ public:
//@}
};
+class t_event_fncall : public t_event {
+public:
+ t_event_fncall(std::function<void()> fn);
+ void invoke();
+ virtual t_event_type get_type(void) const override;
+private:
+ std::function<void()> m_fn;
+};
/**
* Event queue.
@@ -663,6 +672,9 @@ public:
/** Push a quit event into the queue. */
void push_quit(void);
+ /** Push a queued function call */
+ void push_fncall(std::function<void()> fn);
+
/**
* Create a network event and push it into the queue.
* @param m [in] SIP message.