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 16 namespace muduo 17 { 18 19 // All client visible callbacks go here. 20 21+class Buffer; 22 class TcpConnection; 23 typedef boost::shared_ptr<TcpConnection> TcpConnectionPtr; 24 25 typedef boost::function<void()> TimerCallback; 26 typedef boost::function<void (const TcpConnectionPtr&)> ConnectionCallback; 27 typedef boost::function<void (const TcpConnectionPtr&, 28! Buffer* buf, 29! Timestamp)> MessageCallback; 30 typedef boost::function<void (const TcpConnectionPtr&)> CloseCallback; 31 32 } 33 34 #endif // MUDUO_NET_CALLBACKS_H 35