2
0

DelayRuner.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. ============================================================================
  3. Name : CDelayRuner.h
  4. Author : R. Drutsky
  5. Version : 1.0
  6. Copyright : Copyright (c) 2010 Soft Industry
  7. Description : CDelayRuner declaration
  8. ============================================================================
  9. */
  10. #ifndef DELAYRUNER_H
  11. #define DELAYRUNER_H
  12. #include <e32base.h> // For CActive, link against: euser.lib
  13. #include <e32std.h> // For RTimer, link against: euser.lib
  14. #include <zrtp.h>
  15. class CDelayRuner : public CActive
  16. {
  17. public:
  18. // Cancel and destroy
  19. ~CDelayRuner();
  20. // Two-phased constructor.
  21. static CDelayRuner* NewL();
  22. // Two-phased constructor.
  23. static CDelayRuner* NewLC();
  24. public:
  25. // New functions
  26. // Function for making the initial request
  27. void StartL(zrtp_stream_t *ctx, zrtp_retry_task_t* ztask);
  28. private:
  29. // C++ constructor
  30. CDelayRuner();
  31. // Second-phase constructor
  32. void ConstructL();
  33. private:
  34. // From CActive
  35. // Handle completion
  36. void RunL();
  37. // How to cancel me
  38. void DoCancel();
  39. // Override to handle leaves from RunL(). Default implementation causes
  40. // the active scheduler to panic.
  41. TInt RunError(TInt aError);
  42. private:
  43. enum TCDelayRunerState
  44. {
  45. EUninitialized, // Uninitialized
  46. EInitialized, // Initalized
  47. EError
  48. // Error condition
  49. };
  50. private:
  51. TInt iState; // State of the active object
  52. RTimer iTimer; // Provides async timing service
  53. zrtp_stream_t *iCtx;
  54. zrtp_retry_task_t * iZTask;
  55. };
  56. #endif // CDELAYRUNER_H