From: tho Date: Thu, 1 Oct 2009 12:37:25 +0000 (+0000) Subject: Utils: moved range.hh .cti into Range.hh .cti X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=b6acba899f44ba9422476022c775cef823fc9337;p=senf.git Utils: moved range.hh .cti into Range.hh .cti some minor #include clean-ups git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1473 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/Packets/DefaultBundle/Mldv2Packet.test.cc b/senf/Packets/DefaultBundle/Mldv2Packet.test.cc index 7702be1..e1451fe 100644 --- a/senf/Packets/DefaultBundle/Mldv2Packet.test.cc +++ b/senf/Packets/DefaultBundle/Mldv2Packet.test.cc @@ -27,7 +27,6 @@ #include "ICMPv6Packet.hh" #include "ICMPv6TypePacket.hh" #include -#include #include #include @@ -36,16 +35,16 @@ BOOST_AUTO_UNIT_TEST(ICMPv6_MLDv2_Packet_packet) { unsigned char data[] = { - 0x00 ,0x00 ,0x00 ,0x01 ,0x04 ,0x00 ,0x00 ,0x00 , - 0xff ,0x15 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , - 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x16 + 0x00, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00, + 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16 }; - senf::MLDv2ListenerReport p ( senf::MLDv2ListenerReport::create(data) ); - BOOST_CHECK_EQUAL(p->reserved(),0x0000 ); - senf::MLDv2ListenerReport::Parser::mcastAddrRecords_t::container mcastAddrRecords (p->mcastAddrRecords()); - senf::MLDv2ListenerReport::Parser::mcastAddrRecords_t::container::iterator mcAddrIt (mcastAddrRecords.begin() ); - BOOST_CHECK_EQUAL(mcAddrIt->recordType(), 0x04); - BOOST_CHECK_EQUAL(senf::str(mcAddrIt->mcAddress() ), "ff15::16"); + BOOST_CHECK_EQUAL(p->reserved(),0x0000 ); + typedef senf::MLDv2ListenerReport::Parser::mcastAddrRecords_t::container recContainer_t; + recContainer_t mcastAddrRecords (p->mcastAddrRecords()); + recContainer_t::iterator mcAddrIt (mcastAddrRecords.begin() ); + BOOST_CHECK_EQUAL( mcAddrIt->recordType(), 0x04); + BOOST_CHECK_EQUAL( mcAddrIt->mcAddress().value(), senf::MACAddress(0xff1516)); } diff --git a/senf/Packets/Packet.hh b/senf/Packets/Packet.hh index 1eca2ea..ffe8d5d 100644 --- a/senf/Packets/Packet.hh +++ b/senf/Packets/Packet.hh @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include "PacketInterpreter.hh" diff --git a/senf/Scheduler/ReadHelper.ct b/senf/Scheduler/ReadHelper.ct index f5a16e1..6547474 100644 --- a/senf/Scheduler/ReadHelper.ct +++ b/senf/Scheduler/ReadHelper.ct @@ -25,7 +25,7 @@ // Custom includes #include -#include +#include #include #include "Scheduler.hh" diff --git a/senf/Socket/FileHandle.cci b/senf/Socket/FileHandle.cci index f5fc5de..09628f8 100644 --- a/senf/Socket/FileHandle.cci +++ b/senf/Socket/FileHandle.cci @@ -29,7 +29,6 @@ // Custom includes #include #include -#include #define prefix_ inline ///////////////////////////////cci.p/////////////////////////////////////// diff --git a/senf/Socket/Protocols/Raw/LLAddressing.cc b/senf/Socket/Protocols/Raw/LLAddressing.cc index a15c2de..1ee6046 100644 --- a/senf/Socket/Protocols/Raw/LLAddressing.cc +++ b/senf/Socket/Protocols/Raw/LLAddressing.cc @@ -34,7 +34,6 @@ #include #include -#include #include //#include "LLAddressing.mpp" diff --git a/senf/Socket/SocketHandle.cci b/senf/Socket/SocketHandle.cci index 17b94b7..984b0a6 100644 --- a/senf/Socket/SocketHandle.cci +++ b/senf/Socket/SocketHandle.cci @@ -28,7 +28,6 @@ // Custom includes #include -#include #include "SocketProtocol.hh" #define prefix_ inline diff --git a/senf/Utils/Console/Config.cci b/senf/Utils/Console/Config.cci index b9f2c75..1327b50 100644 --- a/senf/Utils/Console/Config.cci +++ b/senf/Utils/Console/Config.cci @@ -26,7 +26,6 @@ #include "Config.ih" // Custom includes -#include #define prefix_ inline ///////////////////////////////cci.p/////////////////////////////////////// diff --git a/senf/Utils/Console/Executor.cc b/senf/Utils/Console/Executor.cc index 8d7e59a..d93fab2 100644 --- a/senf/Utils/Console/Executor.cc +++ b/senf/Utils/Console/Executor.cc @@ -34,8 +34,6 @@ #include #include #include -#include -#include #include "Server.hh" //#include "Executor.mpp" diff --git a/senf/Utils/Console/LineEditor.cc b/senf/Utils/Console/LineEditor.cc index 8235f71..07cee7f 100644 --- a/senf/Utils/Console/LineEditor.cc +++ b/senf/Utils/Console/LineEditor.cc @@ -28,7 +28,8 @@ // Custom includes #include -#include +#include +#include //#include "LineEditor.mpp" #define prefix_ diff --git a/senf/Utils/Console/Node.cc b/senf/Utils/Console/Node.cc index 0b143dd..6c4b806 100644 --- a/senf/Utils/Console/Node.cc +++ b/senf/Utils/Console/Node.cc @@ -25,9 +25,9 @@ #include "Node.hh" #include "Node.ih" -#include // Custom includes +#include //#include "Node.mpp" #define prefix_ diff --git a/senf/Utils/Console/ProgramOptions.cc b/senf/Utils/Console/ProgramOptions.cc index e68ce7d..f98eb9b 100644 --- a/senf/Utils/Console/ProgramOptions.cc +++ b/senf/Utils/Console/ProgramOptions.cc @@ -29,7 +29,7 @@ // Custom includes #include #include -#include +#include #include "OverloadedCommand.hh" //#include "ProgramOptions.mpp" diff --git a/senf/Utils/Logger/TimeSource.cc b/senf/Utils/Logger/TimeSource.cc index e5b657c..2c0f5a9 100644 --- a/senf/Utils/Logger/TimeSource.cc +++ b/senf/Utils/Logger/TimeSource.cc @@ -28,7 +28,6 @@ // Custom includes #include -#include #include //#include "TimeSource.mpp" diff --git a/senf/Utils/Range.cti b/senf/Utils/Range.cti index 016b4ad..6559c55 100644 --- a/senf/Utils/Range.cti +++ b/senf/Utils/Range.cti @@ -64,6 +64,12 @@ prefix_ void senf::copy_range(Range & range, Iterator const & i) std::copy(boost::begin(range), boost::end(range), i); } +template +prefix_ bool senf::has_one_elt(Range r) +{ + return ! r.empty() && boost::next(r.begin()) == r.end(); +} + ///////////////////////////////cti.e/////////////////////////////////////// #undef prefix_ diff --git a/senf/Utils/Range.hh b/senf/Utils/Range.hh index 9b8462b..e1e02dc 100644 --- a/senf/Utils/Range.hh +++ b/senf/Utils/Range.hh @@ -58,6 +58,8 @@ namespace senf { template void copy_range(Range & range, Iterator const & i); + template + bool has_one_elt(Range r); } ///////////////////////////////hh.e//////////////////////////////////////// diff --git a/senf/Utils/range.cti b/senf/Utils/range.cti deleted file mode 100644 index 197e10c..0000000 --- a/senf/Utils/range.cti +++ /dev/null @@ -1,52 +0,0 @@ -// $Id$ -// -// Copyright (C) 2008 -// Fraunhofer Institute for Open Communication Systems (FOKUS) -// Competence Center NETwork research (NET), St. Augustin, GERMANY -// Stefan Bund -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the -// Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -/** \file - \brief range inline template implementation */ - -//#include "range.ih" - -// Custom includes -#include - -#define prefix_ inline -///////////////////////////////cti.p/////////////////////////////////////// - -template -prefix_ bool senf::has_one_elt(Range r) -{ - return ! r.empty() && boost::next(r.begin()) == r.end(); -} - -///////////////////////////////cti.e/////////////////////////////////////// -#undef prefix_ - - -// Local Variables: -// mode: c++ -// fill-column: 100 -// comment-column: 40 -// c-file-style: "senf" -// indent-tabs-mode: nil -// ispell-local-dictionary: "american" -// compile-command: "scons -u test" -// End: diff --git a/senf/Utils/range.hh b/senf/Utils/range.hh deleted file mode 100644 index d7accb2..0000000 --- a/senf/Utils/range.hh +++ /dev/null @@ -1,56 +0,0 @@ -// $Id$ -// -// Copyright (C) 2008 -// Fraunhofer Institute for Open Communication Systems (FOKUS) -// Competence Center NETwork research (NET), St. Augustin, GERMANY -// Stefan Bund -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the -// Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -/** \file - \brief range public header */ - -#ifndef HH_SENF_Utils_range_ -#define HH_SENF_Utils_range_ 1 - -// Custom includes - -//#include "range.mpp" -///////////////////////////////hh.p//////////////////////////////////////// - -namespace senf { - - template - bool has_one_elt(Range r); - -} - -///////////////////////////////hh.e//////////////////////////////////////// -//#include "range.cci" -//#include "range.ct" -#include "range.cti" -#endif - - -// Local Variables: -// mode: c++ -// fill-column: 100 -// comment-column: 40 -// c-file-style: "senf" -// indent-tabs-mode: nil -// ispell-local-dictionary: "american" -// compile-command: "scons -u test" -// End: