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 TcpConnection; 22typedef boost::shared_ptr<TcpConnection> TcpConnectionPtr; 23 24typedef boost::function<void()> TimerCallback; 25typedef boost::function<void (const TcpConnectionPtr&)> ConnectionCallback; 26typedef boost::function<void (const TcpConnectionPtr&, 27 const char* data, 28 ssize_t len)> MessageCallback; 29 30} 31 32#endif // MUDUO_NET_CALLBACKS_H 33