From: tho Date: Tue, 10 Nov 2009 11:08:43 +0000 (+0000) Subject: Socket/Protocols/Raw: added static EUI64::None member X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=b996ce2588e9c6f8ecc54e6e917f4783a2e53018;p=senf.git Socket/Protocols/Raw: added static EUI64::None member git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1517 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/Socket/Protocols/Raw/EUI64.cc b/senf/Socket/Protocols/Raw/EUI64.cc index b69191b..3c80413 100644 --- a/senf/Socket/Protocols/Raw/EUI64.cc +++ b/senf/Socket/Protocols/Raw/EUI64.cc @@ -35,6 +35,8 @@ #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// +senf::EUI64 const senf::EUI64::None; + prefix_ senf::EUI64 senf::EUI64::from_string(std::string const & s) { EUI64 eui (senf::noinit); diff --git a/senf/Socket/Protocols/Raw/EUI64.hh b/senf/Socket/Protocols/Raw/EUI64.hh index 0149506..35c47fc 100644 --- a/senf/Socket/Protocols/Raw/EUI64.hh +++ b/senf/Socket/Protocols/Raw/EUI64.hh @@ -82,6 +82,8 @@ namespace senf { ///\name Structors and default members ///@{ + static EUI64 const None; ///< The empty (0) address + // default copy constructor // default copy assignment // default destructor diff --git a/senf/Socket/Protocols/Raw/EUI64.test.cc b/senf/Socket/Protocols/Raw/EUI64.test.cc index 028b318..962804e 100644 --- a/senf/Socket/Protocols/Raw/EUI64.test.cc +++ b/senf/Socket/Protocols/Raw/EUI64.test.cc @@ -62,6 +62,9 @@ BOOST_AUTO_UNIT_TEST(eui64) BOOST_CHECK_THROW( senf::EUI64::from_string("12:20:30:40:50:60:70:80:90"), senf::AddressSyntaxException ); + BOOST_CHECK_EQUAL( senf::EUI64::None, senf::EUI64(0) ); + BOOST_CHECK(! senf::EUI64::None ); + { std::stringstream ss; ss << std::uppercase << eui; @@ -79,7 +82,6 @@ BOOST_AUTO_UNIT_TEST(eui64) ss << "01:02:03:04-05:06:07:108"; BOOST_CHECK( (ss >> eui).fail() ); } - } ///////////////////////////////cc.e////////////////////////////////////////