12a18e699SShuo Chen// excerpts from http://code.google.com/p/muduo/ 22a18e699SShuo Chen// 32a18e699SShuo Chen// Use of this source code is governed by a BSD-style license 42a18e699SShuo Chen// that can be found in the License file. 52a18e699SShuo Chen// 62a18e699SShuo Chen// Author: Shuo Chen (chenshuo at chenshuo dot com) 72a18e699SShuo Chen 82a18e699SShuo Chen#ifndef MUDUO_NET_TIMERID_H 92a18e699SShuo Chen#define MUDUO_NET_TIMERID_H 102a18e699SShuo Chen 112a18e699SShuo Chen#include "datetime/copyable.h" 122a18e699SShuo Chen 132a18e699SShuo Chennamespace muduo 142a18e699SShuo Chen{ 152a18e699SShuo Chen 162a18e699SShuo Chenclass Timer; 172a18e699SShuo Chen 182a18e699SShuo Chen/// 192a18e699SShuo Chen/// An opaque identifier, for canceling Timer. 202a18e699SShuo Chen/// 212a18e699SShuo Chenclass TimerId : public muduo::copyable 222a18e699SShuo Chen{ 232a18e699SShuo Chen public: 242a18e699SShuo Chen explicit TimerId(Timer* timer) 252a18e699SShuo Chen : value_(timer) 262a18e699SShuo Chen { 272a18e699SShuo Chen } 282a18e699SShuo Chen 292a18e699SShuo Chen // default copy-ctor, dtor and assignment are okay 302a18e699SShuo Chen 312a18e699SShuo Chen private: 322a18e699SShuo Chen Timer* value_; 332a18e699SShuo Chen}; 342a18e699SShuo Chen 352a18e699SShuo Chen} 362a18e699SShuo Chen 372a18e699SShuo Chen#endif // MUDUO_NET_TIMERID_H 38