1f4e8e3d3SShuo Chen // excerpts from http://code.google.com/p/muduo/
2f4e8e3d3SShuo Chen //
3f4e8e3d3SShuo Chen // Use of this source code is governed by a BSD-style license
4f4e8e3d3SShuo Chen // that can be found in the License file.
5f4e8e3d3SShuo Chen //
6f4e8e3d3SShuo Chen // Author: Shuo Chen (chenshuo at chenshuo dot com)
7f4e8e3d3SShuo Chen 
8f4e8e3d3SShuo Chen #ifndef MUDUO_NET_TIMERID_H
9f4e8e3d3SShuo Chen #define MUDUO_NET_TIMERID_H
10f4e8e3d3SShuo Chen 
11f4e8e3d3SShuo Chen #include "datetime/copyable.h"
12f4e8e3d3SShuo Chen 
13f4e8e3d3SShuo Chen namespace muduo
14f4e8e3d3SShuo Chen {
15f4e8e3d3SShuo Chen 
16f4e8e3d3SShuo Chen class Timer;
17f4e8e3d3SShuo Chen 
18f4e8e3d3SShuo Chen ///
19f4e8e3d3SShuo Chen /// An opaque identifier, for canceling Timer.
20f4e8e3d3SShuo Chen ///
21f4e8e3d3SShuo Chen class TimerId : public muduo::copyable
22f4e8e3d3SShuo Chen {
23f4e8e3d3SShuo Chen  public:
24db9c5511SShuo Chen!  TimerId(Timer* timer = NULL, int64_t seq = 0)
25db9c5511SShuo Chen     : timer_(timer),
26f4e8e3d3SShuo Chen+      seq_(seq)
27f4e8e3d3SShuo Chen   {
28f4e8e3d3SShuo Chen   }
29f4e8e3d3SShuo Chen 
30f4e8e3d3SShuo Chen   // default copy-ctor, dtor and assignment are okay
31f4e8e3d3SShuo Chen 
32f4e8e3d3SShuo Chen+  friend class TimerQueue;
33f4e8e3d3SShuo Chen+
34f4e8e3d3SShuo Chen  private:
35db9c5511SShuo Chen   Timer* timer_;
36f4e8e3d3SShuo Chen+  int64_t seq_;
37f4e8e3d3SShuo Chen };
38f4e8e3d3SShuo Chen 
39f4e8e3d3SShuo Chen }
40f4e8e3d3SShuo Chen 
41f4e8e3d3SShuo Chen #endif  // MUDUO_NET_TIMERID_H
42