addresscontainer.h

00001 /***************************************************************************
00002 *   Copyright (C) 2001 by Rick L. Vinyard, Jr.                            *
00003 *   rvinyard@cs.nmsu.edu                                                  *
00004 *                                                                         *
00005 *   This program is free software; you can redistribute it and/or modify  *
00006 *   it under the terms of the GNU Lesser General Public License as        *
00007 *   published by the Free Software Foundation version 2.1.                *
00008 *                                                                         *
00009 *   This program is distributed in the hope that it will be useful,       *
00010 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00011 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00012 *   GNU General Public License for more details.                          *
00013 *                                                                         *
00014 *   You should have received a copy of the GNU Lesser General Public      *
00015 *   License along with this library; if not, write to the                 *
00016 *   Free Software Foundation, Inc.,                                       *
00017 *   51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA              *
00018 ***************************************************************************/
00019 #ifndef CONEXUSMMADDRESSENTRY_H
00020 #define CONEXUSMMADDRESSENTRY_H
00021 
00022 #include <set>
00023 #include <conexus/conexus.h>
00024 
00025 
00026 namespace ConexusGtk {
00027 
00031 class AddressContainer{
00032 public:
00033 
00034   typedef std::set<Conexus::IPv4::Address*> IPv4Addresses;
00035   typedef std::set<Conexus::IPv4::Address*>::iterator IPv4Iterator;
00036   typedef std::set<Conexus::IPv6::Address*> IPv6Addresses;
00037   typedef std::set<Conexus::IPv6::Address*>::iterator IPv6Iterator;
00038   typedef enum ValidateType { IPV4=1, IPV6=2 } ValidateType;
00039 
00040     AddressContainer(unsigned validate=IPV4|IPV6);
00041 
00042     virtual ~AddressContainer();
00043 
00044     void connect(Conexus::IPv4::Address& address);
00045     void disconnect(Conexus::IPv4::Address& address);
00046     void connect(Conexus::IPv6::Address& address);
00047     void disconnect(Conexus::IPv6::Address& address);
00048 
00049     unsigned validate_type();
00050     void set_validate_type(unsigned validate);
00051 
00052   protected:
00053     unsigned m_validate_type;
00054     IPv4Addresses m_ipv4_address;
00055     IPv6Addresses m_ipv6_address;
00056 
00057     virtual void on_connect(Conexus::IPv4::Address& address);
00058     virtual void on_disconnect(Conexus::IPv4::Address& address);
00059     virtual void on_connect(Conexus::IPv6::Address& address);
00060     virtual void on_disconnect(Conexus::IPv6::Address& address);
00061     virtual void on_validate_type_changed();
00062 
00063 };
00064 
00065 }
00066 
00067 #endif

Generated on Sat Aug 26 17:35:29 2006 by  doxygen 1.4.6