165c497a3SShuo Chen// excerpts from http://code.google.com/p/muduo/ 265c497a3SShuo Chen// 365c497a3SShuo Chen// Use of this source code is governed by a BSD-style license 465c497a3SShuo Chen// that can be found in the License file. 565c497a3SShuo Chen// 665c497a3SShuo Chen// Author: Shuo Chen (chenshuo at chenshuo dot com) 765c497a3SShuo Chen 865c497a3SShuo Chen#ifndef MUDUO_NET_TIMERID_H 965c497a3SShuo Chen#define MUDUO_NET_TIMERID_H 1065c497a3SShuo Chen 1165c497a3SShuo Chen#include "datetime/copyable.h" 1265c497a3SShuo Chen 1365c497a3SShuo Chennamespace muduo 1465c497a3SShuo Chen{ 1565c497a3SShuo Chen 1665c497a3SShuo Chenclass Timer; 1765c497a3SShuo Chen 1865c497a3SShuo Chen/// 1965c497a3SShuo Chen/// An opaque identifier, for canceling Timer. 2065c497a3SShuo Chen/// 2165c497a3SShuo Chenclass TimerId : public muduo::copyable 2265c497a3SShuo Chen{ 2365c497a3SShuo Chen public: 2465c497a3SShuo Chen explicit TimerId(Timer* timer) 2565c497a3SShuo Chen : value_(timer) 2665c497a3SShuo Chen { 2765c497a3SShuo Chen } 2865c497a3SShuo Chen 2965c497a3SShuo Chen // default copy-ctor, dtor and assignment are okay 3065c497a3SShuo Chen 3165c497a3SShuo Chen private: 3265c497a3SShuo Chen Timer* value_; 3365c497a3SShuo Chen}; 3465c497a3SShuo Chen 3565c497a3SShuo Chen} 3665c497a3SShuo Chen 3765c497a3SShuo Chen#endif // MUDUO_NET_TIMERID_H 38