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