mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
add web socket ui
This commit is contained in:
parent
3d4e2a275c
commit
b4e9ed7d18
15 changed files with 322 additions and 9 deletions
37
Event.h
Normal file
37
Event.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
#ifndef EVENT_H__
|
||||
#define EVENT_H__
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
#include <boost/asio.hpp>
|
||||
|
||||
typedef std::map<std::string, std::string> EventType;
|
||||
|
||||
namespace i2p
|
||||
{
|
||||
namespace event
|
||||
{
|
||||
class EventListener {
|
||||
public:
|
||||
virtual ~EventListener() {};
|
||||
virtual void HandleEvent(const EventType & ev) = 0;
|
||||
};
|
||||
|
||||
class EventCore
|
||||
{
|
||||
public:
|
||||
void QueueEvent(const EventType & ev);
|
||||
void SetListener(EventListener * l);
|
||||
|
||||
private:
|
||||
EventListener * m_listener = nullptr;
|
||||
};
|
||||
|
||||
extern EventCore core;
|
||||
}
|
||||
}
|
||||
|
||||
void EmitEvent(const EventType & ev);
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue