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