19a1e991dSShuo Chen// excerpts from http://code.google.com/p/muduo/ 29a1e991dSShuo Chen// 39a1e991dSShuo Chen// Use of this source code is governed by a BSD-style license 49a1e991dSShuo Chen// that can be found in the License file. 59a1e991dSShuo Chen// 69a1e991dSShuo Chen// Author: Shuo Chen (chenshuo at chenshuo dot com) 79a1e991dSShuo Chen 89a1e991dSShuo Chen#ifndef MUDUO_NET_TIMERID_H 99a1e991dSShuo Chen#define MUDUO_NET_TIMERID_H 109a1e991dSShuo Chen 119a1e991dSShuo Chen#include "datetime/copyable.h" 129a1e991dSShuo Chen 139a1e991dSShuo Chennamespace muduo 149a1e991dSShuo Chen{ 159a1e991dSShuo Chen 169a1e991dSShuo Chenclass Timer; 179a1e991dSShuo Chen 189a1e991dSShuo Chen/// 199a1e991dSShuo Chen/// An opaque identifier, for canceling Timer. 209a1e991dSShuo Chen/// 219a1e991dSShuo Chenclass TimerId : public muduo::copyable 229a1e991dSShuo Chen{ 239a1e991dSShuo Chen public: 249a1e991dSShuo Chen explicit TimerId(Timer* timer) 259a1e991dSShuo Chen : value_(timer) 269a1e991dSShuo Chen { 279a1e991dSShuo Chen } 289a1e991dSShuo Chen 299a1e991dSShuo Chen // default copy-ctor, dtor and assignment are okay 309a1e991dSShuo Chen 319a1e991dSShuo Chen private: 329a1e991dSShuo Chen Timer* value_; 339a1e991dSShuo Chen}; 349a1e991dSShuo Chen 359a1e991dSShuo Chen} 369a1e991dSShuo Chen 379a1e991dSShuo Chen#endif // MUDUO_NET_TIMERID_H 38