mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 17:48:21 +00:00
Move EventMgr, EventHandler, and EventRegistry code to zeek namespace. Rename mgr to event_mgr.
This commit is contained in:
parent
1c17700c48
commit
45b5a98420
76 changed files with 328 additions and 300 deletions
21
src/Event.h
21
src/Event.h
|
@ -12,7 +12,9 @@
|
|||
#include <tuple>
|
||||
#include <type_traits>
|
||||
|
||||
class EventMgr;
|
||||
ZEEK_FORWARD_DECLARE_NAMESPACED(EventMgr, zeek);
|
||||
|
||||
namespace zeek {
|
||||
|
||||
class Event final : public zeek::Obj {
|
||||
public:
|
||||
|
@ -45,9 +47,6 @@ protected:
|
|||
Event* next_event;
|
||||
};
|
||||
|
||||
extern uint64_t num_events_queued;
|
||||
extern uint64_t num_events_dispatched;
|
||||
|
||||
class EventMgr final : public zeek::Obj, public iosource::IOSource {
|
||||
public:
|
||||
EventMgr();
|
||||
|
@ -136,6 +135,9 @@ public:
|
|||
const char* Tag() override { return "EventManager"; }
|
||||
void InitPostScript();
|
||||
|
||||
uint64_t num_events_queued = 0;
|
||||
uint64_t num_events_dispatched = 0;
|
||||
|
||||
protected:
|
||||
void QueueEvent(Event* event);
|
||||
|
||||
|
@ -148,4 +150,13 @@ protected:
|
|||
zeek::detail::Flare queue_flare;
|
||||
};
|
||||
|
||||
extern EventMgr mgr;
|
||||
extern EventMgr event_mgr;
|
||||
|
||||
} // namespace zeek
|
||||
|
||||
using Event [[deprecated("Remove in v4.1. Use zeek::Event.")]] = zeek::Event;
|
||||
using EventMgr [[deprecated("Remove in v4.1. Use zeek::EventMgr.")]] = zeek::EventMgr;
|
||||
extern zeek::EventMgr& mgr [[deprecated("Remove in v4.1. Use zeek::event_mgr")]];
|
||||
|
||||
extern uint64_t& num_events_queued [[deprecated("Remove in v4.1. Use zeek::event_mgr.num_events_queued")]];
|
||||
extern uint64_t& num_events_dispatched [[deprecated("Remove in v4.1. Use zeek::event_mgr.num_events_dispatched")]];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue