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