initial commit
This commit is contained in:
commit
4b60ece582
327 changed files with 28286 additions and 0 deletions
48
lib/wDispatcher/dispatcher.h
Normal file
48
lib/wDispatcher/dispatcher.h
Normal file
|
@ -0,0 +1,48 @@
|
|||
#ifndef DISPATCHER_H
|
||||
#define DISPATCHER_H
|
||||
|
||||
#include <map>
|
||||
#include <list>
|
||||
|
||||
#include <wType/string.h>
|
||||
#include <wType/address.h>
|
||||
#include <wType/event.h>
|
||||
|
||||
#include <QtCore/QObject>
|
||||
|
||||
#include "handler.h"
|
||||
#include "defaulthandler.h"
|
||||
|
||||
#include <wContainer/order.h>
|
||||
|
||||
namespace W
|
||||
{
|
||||
class Dispatcher:
|
||||
public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Dispatcher();
|
||||
~Dispatcher();
|
||||
|
||||
void registerHandler(W::Handler* dp);
|
||||
void unregisterHandler(W::Handler* dp);
|
||||
|
||||
void registerDefaultHandler(W::DefaultHandler* dh);
|
||||
void unregisterDefaultHandler(W::DefaultHandler* dh);
|
||||
|
||||
public slots:
|
||||
void pass(const W::Event& ev) const;
|
||||
|
||||
protected:
|
||||
typedef std::map<W::Address, W::Order<W::Handler*>> n_map;
|
||||
typedef W::Order<W::DefaultHandler*> d_order;
|
||||
|
||||
n_map nodes;
|
||||
d_order defaultHandlers;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif // DISPATCHER_H
|
Loading…
Add table
Add a link
Reference in a new issue