Search:

SENF Extensible Network Framework

  • Home
  • Download
  • Wiki
  • BerliOS
  • ChangeLog
  • Browse SVN
  • Bug Tracker
  • Overview
  • Examples
  • HowTos
  • Glossary
  • PPI
  • Packets
  • Scheduler
  • Socket
  • Utils
  • Console
  • Daemon
  • Logger
  • Termlib
  • Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

auto_unit_test.ih

Go to the documentation of this file.
00001 // $Id: auto_unit_test.ih 1742 2010-11-04 14:51:56Z g0dil $
00002 //
00003 // Copyright (C) 2009
00004 // Fraunhofer (FOKUS)
00005 // Competence Center NETwork research (NET), St. Augustin, GERMANY
00006 //     Stefan Bund <g0dil@berlios.de>
00007 //
00008 // This program is free software; you can redistribute it and/or modify
00009 // it under the terms of the GNU General Public License as published by
00010 // the Free Software Foundation; either version 2 of the License, or
00011 // (at your option) any later version.
00012 //
00013 // This program is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 //
00018 // You should have received a copy of the GNU General Public License
00019 // along with this program; if not, write to the
00020 // Free Software Foundation, Inc.,
00021 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 
00026 #ifndef IH_SENF_senf_Utils_auto_unit_test_
00027 #define IH_SENF_senf_Utils_auto_unit_test_ 1
00028 
00029 // Custom includes
00030 #include <iterator>
00031 #include <boost/iterator/iterator_adaptor.hpp>
00032 
00033 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00034 
00035 namespace senf {
00036 namespace test {
00037 namespace detail {
00038 
00039     template <class Type, class Iterator>
00040     struct ConvertingIterator
00041         : public boost::iterator_adaptor<
00042             ConvertingIterator<Type, Iterator>, Iterator, Type, boost::use_default, Type>
00043     {
00044         typedef boost::iterator_adaptor<
00045             ConvertingIterator<Type, Iterator>, Iterator, Type, boost::use_default, Type> Base;
00046         ConvertingIterator(Iterator i) : Base (i) {}
00047     };
00048 
00049     template <class Iterator, class vt = typename std::iterator_traits<Iterator>::value_type>
00050     struct NoCharIterator
00051     { typedef Iterator type; };
00052 
00053     template <class Iterator>
00054     struct NoCharIterator<Iterator, char>
00055     { typedef ConvertingIterator<int,Iterator> type; };
00056 
00057     template <class Iterator>
00058     struct NoCharIterator<Iterator, signed char>
00059     { typedef ConvertingIterator<int,Iterator> type; };
00060 
00061     template <class Iterator>
00062     struct NoCharIterator<Iterator, unsigned char>
00063     { typedef ConvertingIterator<unsigned,Iterator> type; };
00064 
00065 }}}
00066 
00067 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00068 #endif
00069 
00070 
00071 // Local Variables:
00072 // mode: c++
00073 // fill-column: 100
00074 // comment-column: 40
00075 // c-file-style: "senf"
00076 // indent-tabs-mode: nil
00077 // ispell-local-dictionary: "american"
00078 // compile-command: "scons -u test"
00079 // End:

Contact: senf-dev@lists.berlios.de | © 2006-2010 Fraunhofer Institute for Open Communication Systems, Network Research