1
0

tmultiplex.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef __MAIN_TIMERMULTIPLEXER_H
  2. #define __MAIN_TIMERMULTIPLEXER_H
  3. #include "timermul.h"
  4. #include <bfc/depend.h>
  5. #include <bfc/string/StringW.h>
  6. #include <api/timer/timerclient.h>
  7. class VirtualTimer
  8. {
  9. public:
  10. VirtualTimer(TimerClient *_client, intptr_t _id, api_dependent *depend);
  11. virtual ~VirtualTimer() { }
  12. TimerClient *client, *mclient;
  13. api_dependent *dep;
  14. StringW name;
  15. intptr_t id;
  16. };
  17. class MainTimerMultiplexer : public TimerMultiplexer, public TimerMultiplexerClient, public DependentViewerI {
  18. public:
  19. MainTimerMultiplexer();
  20. virtual ~MainTimerMultiplexer();
  21. virtual void add(TimerClient *client, intptr_t id, int ms);
  22. virtual void remove(TimerClient *client, intptr_t id);
  23. virtual void onMultiplexedTimer(void *data, int skip, int mssincelast);
  24. virtual void onServerTimer();
  25. virtual int viewer_onItemDeleted(api_dependent *item);
  26. private:
  27. int isValidTimerClientPtr(TimerClient *tc, api_dependent *dep);
  28. int haveClient(TimerClient *client);
  29. PtrList<VirtualTimer> timerclients;
  30. PtrListQuickSortedByPtrVal<TimerClient> masters;
  31. };
  32. #endif