conexus logo

ipv6_udpposet.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2001 by Rick L. Vinyard, Jr.                            *
00003  *   rvinyard@cs.nmsu.edu                                                  *
00004  *                                                                         *
00005  *   This file is part of the conexus library.                             *
00006  *                                                                         *
00007  *   The conexus library is free software; you can redistribute it and/or  *
00008  *   modify it under the terms of the GNU General Public License           *
00009  *   version 3 as published by the Free Software Foundation.               *
00010  *                                                                         *
00011  *   The conexus library is distributed in the hope that it will be        *
00012  *   useful, but WITHOUT ANY WARRANTY; without even the implied warranty   *
00013  *   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU   *
00014  *   General Public License for more details.                              *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU General Public License     *
00017  *   along with this software. If not see <http://www.gnu.org/licenses/>.  *
00018  ***************************************************************************/
00019 #ifndef CONEXUS_IPV6UDPPOSET_H
00020 #define CONEXUS_IPV6UDPPOSET_H
00021 
00022 #include <conexus/ipv6_udp.h>
00023 
00024 #include <map>
00025 #include <set>
00026 
00037 namespace Conexus
00038 {
00039 
00040   namespace IPv6
00041   {
00042 
00064     class UDPPoset : public UDP
00065     {
00066       protected:
00067 
00069         UDPPoset( const struct in6_addr& local_if, uint16_t localport = 0 );
00070 
00072         UDPPoset( const std::string& local_if, uint16_t localport = 0 );
00073 
00074       public:
00079         typedef std::multimap<int,Address> Destinations;
00080 
00082         typedef ConexusPointer<UDPPoset> pointer;
00083 
00084         CONEXUS_ENDPOINT_GENERIC_CREATE();
00085 
00087         static UDPPoset::pointer create( uint16_t localport = 0 );
00088 
00090         static UDPPoset::pointer create( const struct in6_addr& local_if, uint16_t localport = 0 );
00091 
00093         static UDPPoset::pointer create( const std::string& local_if, uint16_t localport = 0 );
00094 
00096         virtual ~UDPPoset() throw();
00097 
00099         virtual void bind() throw ( bind_exception );
00100 
00102         virtual void bind( const Conexus::Address& a ) throw ( bind_exception );
00103 
00105         virtual void close() throw ( close_exception );
00106 
00113         virtual void connect() throw ( connect_exception );
00114 
00121         virtual void connect( const Address& a ) throw ( connect_exception );
00122 
00124         virtual void set_write_without_connect( bool value = true );
00125 
00183         bool add_destination( const Address& destination, int priority=0, bool singleton=true );
00184 
00185         bool add_destination( uint32_t host, uint16_t port, int priority = 0, bool singleton = true );
00186 
00187         bool add_destination( const struct in6_addr& host, uint16_t port, int priority = 0, bool singleton = true );
00188 
00189         bool add_destination( const std::string& host, uint16_t port, int priority = 0, bool singleton = true );
00190 
00192         void remove_destination(const Address& destination, int priority );
00193 
00195         void remove_destination(const Address& destination );
00196 
00198         bool is_destination( const Address& destination );
00199 
00201         bool is_destination( const Address& destination, int priority );
00202 
00207         std::set<int> priorities( const Address& destination );
00208 
00210         const Destinations& destinations();
00211 
00213         sigc::signal<void,Address,int> signal_destination_added();
00214 
00216         sigc::signal<void,Address,int> signal_destination_removed();
00217 
00218       protected:
00220         Destinations m_addresses;
00221 
00223         sigc::signal<void,Address,int> m_signal_destination_added;
00224 
00226         sigc::signal<void,Address,int> m_signal_destination_removed;
00227 
00229         virtual void on_local_address_changed( );
00230 
00232         virtual void on_remote_address_changed( );
00233 
00238       virtual size_t write_data(const Data data, Timeout timeout) throw (write_exception);
00239 
00240     };
00241 
00242   }
00243 
00244 }
00245 
00246 #endif

Generated on Wed Jul 8 15:50:07 2009 for conexus by doxygen 1.5.8