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