ana/src/asio_sender.hpp

Go to the documentation of this file.
00001 /* $Id: asio_sender.hpp 52533 2012-01-07 02:35:17Z shadowmaster $ */
00002 
00003 /**
00004  * @file
00005  * @brief Header file providing send capability to ana.
00006  *
00007  * ana: Asynchronous Network API.
00008  * Copyright (C) 2010 - 2012 Guillermo Biset.
00009  *
00010  * This file is part of the ana project.
00011  *
00012  * System:         ana
00013  * Language:       C++
00014  *
00015  * Author:         Guillermo Biset
00016  * E-Mail:         billybiset AT gmail DOT com
00017  *
00018  * ana is free software: you can redistribute it and/or modify
00019  * it under the terms of the GNU General Public License as published by
00020  * the Free Software Foundation, either version 2 of the License, or
00021  * (at your option) any later version.
00022  *
00023  * ana is distributed in the hope that it will be useful,
00024  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00025  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00026  * GNU General Public License for more details.
00027  *
00028  * You should have received a copy of the GNU General Public License
00029  * along with ana.  If not, see <http://www.gnu.org/licenses/>.
00030  *
00031  */
00032 
00033 #ifndef ASIO_SENDER_HPP
00034 #define ASIO_SENDER_HPP
00035 
00036 #include <boost/asio.hpp>
00037 
00038 #include "../api/ana.hpp"
00039 
00040 using boost::asio::ip::tcp;
00041 
00042 class asio_sender : private ana::detail::sender
00043 {
00044 
00045     public:
00046         void send( ana::detail::shared_buffer,
00047                    tcp::socket&,
00048                    ana::send_handler*,
00049                    ana::detail::sender*,
00050                    ana::operation_id);
00051 
00052     private:
00053         void handle_sent_header(const boost::system::error_code& ec,
00054                                 ana::serializer::bostream*,
00055                                 tcp::socket*,
00056                                 ana::detail::shared_buffer,
00057                                 ana::send_handler*,
00058                                 ana::timer*,
00059                                 size_t,
00060                                 ana::operation_id);
00061 
00062         void handle_partial_send( ana::detail::shared_buffer,
00063                                   const boost::system::error_code&,
00064                                   tcp::socket*,
00065                                   ana::send_handler*,
00066                                   ana::timer*,
00067                                   size_t,
00068                                   size_t,
00069                                   ana::operation_id);
00070 
00071         void handle_send(const boost::system::error_code&,
00072                          ana::send_handler*,
00073                          ana::timer*,
00074                          ana::operation_id,
00075                          bool from_timeout = false);
00076 };
00077 
00078 #endif
00079 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Wed May 23 2012 01:02:33 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs