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