"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/remote/eventqueue.hpp" between
icinga2-2.11.5.tar.gz and icinga2-2.12.0.tar.gz

About: Icinga 2 is an enterprise grade monitoring system which keeps watch over networks and any conceivable network resource.

eventqueue.hpp  (icinga2-2.11.5):eventqueue.hpp  (icinga2-2.12.0)
skipping to change at line 39 skipping to change at line 39
EventQueue(String name); EventQueue(String name);
bool CanProcessEvent(const String& type) const; bool CanProcessEvent(const String& type) const;
void ProcessEvent(const Dictionary::Ptr& event); void ProcessEvent(const Dictionary::Ptr& event);
void AddClient(void *client); void AddClient(void *client);
void RemoveClient(void *client); void RemoveClient(void *client);
void SetTypes(const std::set<String>& types); void SetTypes(const std::set<String>& types);
void SetFilter(std::unique_ptr<Expression> filter); void SetFilter(std::unique_ptr<Expression> filter);
Dictionary::Ptr WaitForEvent(void *client, double timeout = 5);
static std::vector<EventQueue::Ptr> GetQueuesForType(const String& type); static std::vector<EventQueue::Ptr> GetQueuesForType(const String& type);
static void UnregisterIfUnused(const String& name, const EventQueue::Ptr& queue); static void UnregisterIfUnused(const String& name, const EventQueue::Ptr& queue);
static EventQueue::Ptr GetByName(const String& name); static EventQueue::Ptr GetByName(const String& name);
static void Register(const String& name, const EventQueue::Ptr& function) ; static void Register(const String& name, const EventQueue::Ptr& function) ;
static void Unregister(const String& name); static void Unregister(const String& name);
private: private:
String m_Name; String m_Name;
skipping to change at line 97 skipping to change at line 99
public: public:
DECLARE_PTR_TYPEDEFS(EventsInbox); DECLARE_PTR_TYPEDEFS(EventsInbox);
EventsInbox(String filter, const String& filterSource); EventsInbox(String filter, const String& filterSource);
EventsInbox(const EventsInbox&) = delete; EventsInbox(const EventsInbox&) = delete;
EventsInbox(EventsInbox&&) = delete; EventsInbox(EventsInbox&&) = delete;
EventsInbox& operator=(const EventsInbox&) = delete; EventsInbox& operator=(const EventsInbox&) = delete;
EventsInbox& operator=(EventsInbox&&) = delete; EventsInbox& operator=(EventsInbox&&) = delete;
~EventsInbox(); ~EventsInbox();
const std::shared_ptr<Expression>& GetFilter(); const Expression::Ptr& GetFilter();
void Push(Dictionary::Ptr event); void Push(Dictionary::Ptr event);
Dictionary::Ptr Shift(boost::asio::yield_context yc, double timeout = 5); Dictionary::Ptr Shift(boost::asio::yield_context yc, double timeout = 5);
private: private:
struct Filter struct Filter
{ {
std::size_t Refs; std::size_t Refs;
std::shared_ptr<Expression> Expr; Expression::Ptr Expr;
}; };
static std::mutex m_FiltersMutex; static std::mutex m_FiltersMutex;
static std::map<String, Filter> m_Filters; static std::map<String, Filter> m_Filters;
std::mutex m_Mutex; std::mutex m_Mutex;
decltype(m_Filters.begin()) m_Filter; decltype(m_Filters.begin()) m_Filter;
std::queue<Dictionary::Ptr> m_Queue; std::queue<Dictionary::Ptr> m_Queue;
boost::asio::deadline_timer m_Timer; boost::asio::deadline_timer m_Timer;
}; };
skipping to change at line 138 skipping to change at line 140
const EventsInbox::Ptr& GetInbox(); const EventsInbox::Ptr& GetInbox();
private: private:
std::set<EventType> m_Types; std::set<EventType> m_Types;
EventsInbox::Ptr m_Inbox; EventsInbox::Ptr m_Inbox;
}; };
class EventsFilter class EventsFilter
{ {
public: public:
EventsFilter(std::map<std::shared_ptr<Expression>, std::set<EventsInbox:: Ptr>> inboxes); EventsFilter(std::map<Expression::Ptr, std::set<EventsInbox::Ptr>> inboxe s);
operator bool(); operator bool();
void Push(Dictionary::Ptr event); void Push(Dictionary::Ptr event);
private: private:
std::map<std::shared_ptr<Expression>, std::set<EventsInbox::Ptr>> m_Inbox es; std::map<Expression::Ptr, std::set<EventsInbox::Ptr>> m_Inboxes;
}; };
class EventsRouter class EventsRouter
{ {
public: public:
static EventsRouter& GetInstance(); static EventsRouter& GetInstance();
void Subscribe(const std::set<EventType>& types, const EventsInbox::Ptr& inbox); void Subscribe(const std::set<EventType>& types, const EventsInbox::Ptr& inbox);
void Unsubscribe(const std::set<EventType>& types, const EventsInbox::Ptr & inbox); void Unsubscribe(const std::set<EventType>& types, const EventsInbox::Ptr & inbox);
EventsFilter GetInboxes(EventType type); EventsFilter GetInboxes(EventType type);
skipping to change at line 168 skipping to change at line 170
static EventsRouter m_Instance; static EventsRouter m_Instance;
EventsRouter() = default; EventsRouter() = default;
EventsRouter(const EventsRouter&) = delete; EventsRouter(const EventsRouter&) = delete;
EventsRouter(EventsRouter&&) = delete; EventsRouter(EventsRouter&&) = delete;
EventsRouter& operator=(const EventsRouter&) = delete; EventsRouter& operator=(const EventsRouter&) = delete;
EventsRouter& operator=(EventsRouter&&) = delete; EventsRouter& operator=(EventsRouter&&) = delete;
~EventsRouter() = default; ~EventsRouter() = default;
std::mutex m_Mutex; std::mutex m_Mutex;
std::map<EventType, std::map<std::shared_ptr<Expression>, std::set<Events Inbox::Ptr>>> m_Subscribers; std::map<EventType, std::map<Expression::Ptr, std::set<EventsInbox::Ptr>> > m_Subscribers;
}; };
} }
#endif /* EVENTQUEUE_H */ #endif /* EVENTQUEUE_H */
 End of changes. 6 change blocks. 
5 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)