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