00001
00002
00003
00004
00005
00006
00007 #pragma once
00008
00009 #include <deque>
00010
00011 #include <Swiften/Base/API.h>
00012 #include <Swiften/EventLoop/EventLoop.h>
00013
00014 namespace Swift {
00015 class SWIFTEN_API DummyEventLoop : public EventLoop {
00016 public:
00017 DummyEventLoop();
00018 ~DummyEventLoop();
00019
00020 void processEvents() {
00021 while (!events_.empty()) {
00022 handleEvent(events_[0]);
00023 events_.pop_front();
00024 }
00025 }
00026
00027 bool hasEvents() {
00028 return !events_.empty();
00029 }
00030
00031 virtual void post(const Event& event) {
00032 events_.push_back(event);
00033 }
00034
00035 private:
00036 std::deque<Event> events_;
00037 };
00038 }