1// excerpts from http://code.google.com/p/muduo/ 2// 3// Use of this source code is governed by a BSD-style license 4// that can be found in the License file. 5// 6// Author: Shuo Chen (chenshuo at chenshuo dot com) 7 8#ifndef MUDUO_NET_CALLBACKS_H 9#define MUDUO_NET_CALLBACKS_H 10 11#include <boost/function.hpp> 12#include <boost/shared_ptr.hpp> 13 14#include "datetime/Timestamp.h" 15 16namespace muduo 17{ 18 19// All client visible callbacks go here. 20 21class Buffer; 22class TcpConnection; 23typedef boost::shared_ptr<TcpConnection> TcpConnectionPtr; 24 25typedef boost::function<void()> TimerCallback; 26typedef boost::function<void (const TcpConnectionPtr&)> ConnectionCallback; 27typedef boost::function<void (const TcpConnectionPtr&, 28 Buffer* buf, 29 Timestamp)> MessageCallback; 30typedef boost::function<void (const TcpConnectionPtr&)> CloseCallback; 31 32} 33 34#endif // MUDUO_NET_CALLBACKS_H 35