e53a59ec730db679bfac198fe4f7a7e0ad6c61fe
[senf.git] / senf / Packets / 80221Bundle / MIHTypes.cci
1 // $Id$
2 //
3 // Copyright (C) 2009
4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 //     Thorsten Horstmann <tho@berlios.de>
7 //
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22
23 /** \file
24     \brief MIHTypes inline non-template implementation */
25
26 //#include "MIHTypes.ih"
27
28 // Custom includes
29
30 #define prefix_ inline
31 //-/////////////////////////////////////////////////////////////////////////////////////////////////
32
33 //-/////////////////////////////////////////////////////////////////////////////////////////////////
34 // MIHFId
35 prefix_ senf::MIHFId::MIHFId()
36     :  boost::variant< boost::blank, senf::MACAddress, senf::INet4Address,
37             senf::INet6Address, std::string, senf::EUI64 > ( boost::blank())
38 { }
39
40 prefix_ senf::MIHFId::MIHFId(senf::MACAddress const & addr)
41     :  boost::variant< boost::blank, senf::MACAddress, senf::INet4Address,
42             senf::INet6Address, std::string, senf::EUI64 > ( addr)
43 { }
44
45 prefix_ senf::MIHFId::MIHFId(senf::INet4Address const & addr)
46     :  boost::variant< boost::blank, senf::MACAddress, senf::INet4Address,
47             senf::INet6Address, std::string, senf::EUI64 > ( addr)
48 { }
49
50 prefix_ senf::MIHFId::MIHFId(senf::INet6Address const & addr)
51     :  boost::variant< boost::blank, senf::MACAddress, senf::INet4Address,
52             senf::INet6Address, std::string, senf::EUI64 > ( addr)
53 { }
54
55 prefix_ senf::MIHFId::MIHFId(std::string const & addr)
56     :  boost::variant< boost::blank, senf::MACAddress, senf::INet4Address,
57             senf::INet6Address, std::string, senf::EUI64 > ( addr)
58 { }
59
60 prefix_ senf::MIHFId::MIHFId(senf::EUI64 const & addr)
61     :  boost::variant< boost::blank, senf::MACAddress, senf::INet4Address,
62             senf::INet6Address, std::string, senf::EUI64 > ( addr)
63 { }
64
65 prefix_ senf::MIHFId::Type senf::MIHFId::type()
66     const
67 {
68     return boost::apply_visitor( GetTypeVisitor(), *this );
69 }
70
71 prefix_ bool senf::MIHFId::operator==(senf::MIHFId const & other)
72     const
73 {
74     return boost::apply_visitor( EqualsVisitor(), *this, other);
75 }
76
77 prefix_ bool senf::MIHFId::operator<(senf::MIHFId const & other)
78     const
79 {
80     if (type() != other.type()) return type() < other.type();
81     return boost::apply_visitor( LessThanVisitor(), *this, other);
82 }
83
84
85 //-/////////////////////////////////////////////////////////////////////////////////////////////////
86 #undef prefix_
87
88 \f
89 // Local Variables:
90 // mode: c++
91 // fill-column: 100
92 // comment-column: 40
93 // c-file-style: "senf"
94 // indent-tabs-mode: nil
95 // ispell-local-dictionary: "american"
96 // compile-command: "scons -u test"
97 // End: