Callbacks.h revision 65c497a3
165c497a3SShuo Chen// excerpts from http://code.google.com/p/muduo/
265c497a3SShuo Chen//
365c497a3SShuo Chen// Use of this source code is governed by a BSD-style license
465c497a3SShuo Chen// that can be found in the License file.
565c497a3SShuo Chen//
665c497a3SShuo Chen// Author: Shuo Chen (chenshuo at chenshuo dot com)
765c497a3SShuo Chen
865c497a3SShuo Chen#ifndef MUDUO_NET_CALLBACKS_H
965c497a3SShuo Chen#define MUDUO_NET_CALLBACKS_H
1065c497a3SShuo Chen
1165c497a3SShuo Chen#include <boost/function.hpp>
1265c497a3SShuo Chen#include <boost/shared_ptr.hpp>
1365c497a3SShuo Chen
1465c497a3SShuo Chen#include "datetime/Timestamp.h"
1565c497a3SShuo Chen
1665c497a3SShuo Chennamespace muduo
1765c497a3SShuo Chen{
1865c497a3SShuo Chen
1965c497a3SShuo Chen// All client visible callbacks go here.
2065c497a3SShuo Chen
2165c497a3SShuo Chenclass TcpConnection;
2265c497a3SShuo Chentypedef boost::shared_ptr<TcpConnection> TcpConnectionPtr;
2365c497a3SShuo Chen
2465c497a3SShuo Chentypedef boost::function<void()> TimerCallback;
2565c497a3SShuo Chentypedef boost::function<void (const TcpConnectionPtr&)> ConnectionCallback;
2665c497a3SShuo Chentypedef boost::function<void (const TcpConnectionPtr&,
2765c497a3SShuo Chen                              const char* data,
2865c497a3SShuo Chen                              ssize_t len)> MessageCallback;
2965c497a3SShuo Chentypedef boost::function<void (const TcpConnectionPtr&)> CloseCallback;
3065c497a3SShuo Chen
3165c497a3SShuo Chen
3265c497a3SShuo Chen}
3365c497a3SShuo Chen
3465c497a3SShuo Chen#endif  // MUDUO_NET_CALLBACKS_H
35