ChipMaster's trial hacks on C++CMS starting with v1.2.1. Not sure I'll follow on with the v2 since it looks to be breaking and mostly frivolous.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

35 lines
636 B

  1. #ifndef CPPCMS_AIO_TIMER_H
  2. #define CPPCMS_AIO_TIMER_H
  3. #include "defs.h"
  4. #include "noncopyable.h"
  5. #include "callback1.h"
  6. #include "hold_ptr.h"
  7. namespace cppcms {
  8. class service;
  9. namespace aio {
  10. class CPPCMS_API timer : public util::noncopyable {
  11. public:
  12. timer(service &srv);
  13. ~timer();
  14. typedef util::callback1<bool> handler;
  15. // true if was error or cancelation
  16. void async_wait(handler const &h);
  17. void cancel();
  18. void expires_from_now(int seconds);
  19. void expires_from_now(int seconds,int milliseconds);
  20. void expires_at(time_t at);
  21. private:
  22. struct data;
  23. util::hold_ptr<data> d;
  24. };
  25. }
  26. }
  27. #endif