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

STLSupport.hh

Go to the documentation of this file.
00001 // $Id: STLSupport.hh 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 HH_SENF_Utils_Console_STLSupport_
00027 #define HH_SENF_Utils_Console_STLSupport_ 1
00028 
00029 // Custom includes
00030 #include <vector>
00031 #include <list>
00032 #include "Traits.hh"
00033 
00034 //#include "STLSupport.mpp"
00035 #include "STLSupport.ih"
00036 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00037 
00038 namespace senf {
00039 namespace console {
00040 
00041 #ifndef DOXYGEN
00042 
00043     template <class T, class Alloc>
00044     struct ArgumentTraits< std::vector<T,Alloc> >
00045         : public detail::CollectionArgumentTraits< std::vector<T,Alloc>,
00046                                                    detail::PushBackFunctor >
00047     {};
00048 
00049     template <class T, class Alloc>
00050     struct ReturnValueTraits< std::vector<T,Alloc> >
00051         : public detail::CollectionReturnValueTraits< std::vector<T,Alloc> >
00052     {};
00053 
00054     template <class T, class Alloc>
00055     struct ArgumentTraits< std::list<T,Alloc> >
00056         : public detail::CollectionArgumentTraits< std::list<T,Alloc>,
00057                                                    detail::PushBackFunctor >
00058     {};
00059 
00060     template <class T, class Alloc>
00061     struct ReturnValueTraits< std::list<T,Alloc> >
00062         : public detail::CollectionReturnValueTraits< std::list<T,Alloc> >
00063     {};
00064 
00065     template <class Key, class Compare, class Alloc>
00066     struct ArgumentTraits< std::set<Key,Compare,Alloc> >
00067         : public detail::CollectionArgumentTraits< std::set<Key,Compare,Alloc>,
00068                                                    detail::InsertFunctor >
00069     {};
00070 
00071     template <class Key, class Compare, class Alloc>
00072     struct ReturnValueTraits< std::set<Key,Compare,Alloc> >
00073         : public detail::CollectionReturnValueTraits< std::set<Key,Compare,Alloc> >
00074     {};
00075 
00076     template <class Key, class Compare, class Alloc>
00077     struct ArgumentTraits< std::multiset<Key,Compare,Alloc> >
00078         : public detail::CollectionArgumentTraits< std::multiset<Key,Compare,Alloc>,
00079                                                    detail::InsertFunctor >
00080     {};
00081 
00082     template <class Key, class Compare, class Alloc>
00083     struct ReturnValueTraits< std::multiset<Key,Compare,Alloc> >
00084         : public detail::CollectionReturnValueTraits< std::multiset<Key,Compare,Alloc> >
00085     {};
00086 
00087     template <class Key, class Data, class Compare, class Alloc>
00088     struct ArgumentTraits< std::map<Key,Data,Compare,Alloc> >
00089         : public detail::MapArgumentTraits< std::map<Key,Data,Compare,Alloc> >
00090     {};
00091 
00092     template <class Key, class Data, class Compare, class Alloc>
00093     struct ReturnValueTraits< std::map<Key,Data,Compare,Alloc> >
00094         : public detail::MapReturnValueTraits< std::map<Key,Data,Compare,Alloc> >
00095     {};
00096 
00097     template <class Key, class Data, class Compare, class Alloc>
00098     struct ArgumentTraits< std::multimap<Key,Data,Compare,Alloc> >
00099         : public detail::MapArgumentTraits< std::multimap<Key,Data,Compare,Alloc> >
00100     {};
00101 
00102     template <class Key, class Data, class Compare, class Alloc>
00103     struct ReturnValueTraits< std::multimap<Key,Data,Compare,Alloc> >
00104         : public detail::MapReturnValueTraits< std::multimap<Key,Data,Compare,Alloc> >
00105     {};
00106 
00107     template <class T1, class T2>
00108     struct ArgumentTraits< std::pair<T1,T2> >
00109     {
00110         typedef std::pair<T1,T2> type;
00111         static bool const singleToken = false;
00112 
00113         static void parse(ParseCommandInfo::TokensRange const & tokens, type & out);
00114         static std::string description();
00115         static std::string str(type const & value);
00116     };
00117 
00118     template <class T1, class T2>
00119     struct ReturnValueTraits< std::pair<T1,T2> >
00120     {
00121         typedef std::pair<T1,T2> type;
00122 
00123         static void format(type const & value, std::ostream & os);
00124     };
00125 
00126 #endif
00127 
00128 }}
00129 
00130 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00131 //#include "STLSupport.cci"
00132 #include "STLSupport.ct"
00133 #include "STLSupport.cti"
00134 #endif
00135 
00136 
00137 // Local Variables:
00138 // mode: c++
00139 // fill-column: 100
00140 // comment-column: 40
00141 // c-file-style: "senf"
00142 // indent-tabs-mode: nil
00143 // ispell-local-dictionary: "american"
00144 // compile-command: "scons -u test"
00145 // End:

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