if(widgetStylesPrinted != true) {document.write('');}var widgetStylesPrinted = true;var content = '
Parsek EventLoop Header
cpp-qt
  1. #ifndef PARSEKEVENTLOOP_H
  2. #define PARSEKEVENTLOOP_H
  3.  
  4. #include <QObject>
  5. #include <QTimer>
  6. #include <QHash>
  7. #include <QSocketNotifier>
  8. #include <tpproto/eventloop.h>
  9.  
  10. #define BOOST_NO_EXCEPTIONS
  11.  
  12. class ParsekEventLoop : public QObject, public TPProto::EventLoop
  13. {
  14. Q_OBJECT
  15.  
  16. public:
  17. ParsekEventLoop();
  18. virtual ~ParsekEventLoop();
  19. virtual void listenForSocketRead(TPProto::TPSocket *sock);
  20. virtual void listenForSocketWrite(TPProto::TPSocket *sock);
  21. virtual TPProto::TimerConnection setTimer(uint32_t interval, const TPProto::TimerSignal::slot_type &callback);
  22. public Q_SLOTS:
  23. void activated_read(int fd);
  24. void activated_write(int fd);
  25. void timeout();
  26. private:
  27. //TIMERS AND CALLBACK STUFF
  28. QHash<QTimer*,TPProto::TimerSignal*> timers;
  29.  
  30. //SOCKET STUFF
  31. struct ParsekSocket //covert to dedicated class later??
  32. {
  33. ParsekSocket() : socket(0), notifier(0) {}
  34. ParsekSocket(TPProto::TPSocket *socket, QSocketNotifier *notifier) : socket(socket), notifier(notifier) {}
  35. TPProto::TPSocket *socket;
  36. QSocketNotifier *notifier;
  37. };
  38. QHash<int,ParsekSocket> readset;
  39. QHash<int,ParsekSocket> writeset;
  40.  
  41. };
  42. #endif
  43.  
';document.write(content);