142bf2220SShuo Chen// excerpts from http://code.google.com/p/muduo/ 242bf2220SShuo Chen// 342bf2220SShuo Chen// Use of this source code is governed by a BSD-style license 442bf2220SShuo Chen// that can be found in the License file. 542bf2220SShuo Chen// 642bf2220SShuo Chen// Author: Shuo Chen (chenshuo at chenshuo dot com) 742bf2220SShuo Chen 842bf2220SShuo Chen#ifndef MUDUO_NET_TIMERID_H 942bf2220SShuo Chen#define MUDUO_NET_TIMERID_H 1042bf2220SShuo Chen 1142bf2220SShuo Chen#include "datetime/copyable.h" 1242bf2220SShuo Chen 1342bf2220SShuo Chennamespace muduo 1442bf2220SShuo Chen{ 1542bf2220SShuo Chen 1642bf2220SShuo Chenclass Timer; 1742bf2220SShuo Chen 1842bf2220SShuo Chen/// 1942bf2220SShuo Chen/// An opaque identifier, for canceling Timer. 2042bf2220SShuo Chen/// 2142bf2220SShuo Chenclass TimerId : public muduo::copyable 2242bf2220SShuo Chen{ 2342bf2220SShuo Chen public: 2442bf2220SShuo Chen explicit TimerId(Timer* timer) 2542bf2220SShuo Chen : value_(timer) 2642bf2220SShuo Chen { 2742bf2220SShuo Chen } 2842bf2220SShuo Chen 2942bf2220SShuo Chen // default copy-ctor, dtor and assignment are okay 3042bf2220SShuo Chen 3142bf2220SShuo Chen private: 3242bf2220SShuo Chen Timer* value_; 3342bf2220SShuo Chen}; 3442bf2220SShuo Chen 3542bf2220SShuo Chen} 3642bf2220SShuo Chen 3742bf2220SShuo Chen#endif // MUDUO_NET_TIMERID_H 38