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.ih

Go to the documentation of this file.
00001 // $Id: STLSupport.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_Console_STLSupport_
00027 #define IH_SENF_senf_Utils_Console_STLSupport_ 1
00028 
00029 // Custom includes
00030 
00031 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00032 
00033 namespace senf {
00034 namespace console {
00035 namespace detail {
00036 
00037     template <class Collection>
00038     struct CollectionArgumentTraitsBase
00039     {
00040         typedef Collection type;
00041         static bool const singleToken = false;
00042 
00043         static std::string description();
00044         static std::string str(Collection const & value);
00045     };
00046 
00047     template <class Collection, class Adder>
00048     struct CollectionArgumentTraits
00049         : detail::CollectionArgumentTraitsBase<Collection>
00050     {
00051         static void parse(ParseCommandInfo::TokensRange const & tokens, Collection  & out);
00052     };
00053 
00054     template <class Collection>
00055     struct CollectionReturnValueTraits
00056     {
00057         typedef Collection type;
00058 
00059         static void format(Collection const & value, std::ostream & os);
00060     };
00061 
00062     struct PushBackFunctor
00063     {
00064         template <class Sequence, class ValueType>
00065         static void add(Sequence & seq, ValueType const & value);
00066     };
00067 
00068     struct InsertFunctor
00069     {
00070         template <class Collection, class ValueType>
00071         static void add(Collection & seq, ValueType const & value);
00072     };
00073 
00074     template <class Collection>
00075     struct MapArgumentTraits
00076     {
00077         typedef Collection type;
00078         static bool const singleToken = false;
00079 
00080         static void parse(ParseCommandInfo::TokensRange const & tokens, Collection & out);
00081         static std::string description();
00082         static std::string str(Collection const & value);
00083     };
00084 
00085     template <class Collection>
00086     struct MapReturnValueTraits
00087     {
00088         typedef Collection type;
00089 
00090         static void format(Collection const & value, std::ostream & os);
00091     };
00092 
00093 }}}
00094 
00095 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00096 #endif
00097 
00098 
00099 // Local Variables:
00100 // mode: c++
00101 // fill-column: 100
00102 // comment-column: 40
00103 // c-file-style: "senf"
00104 // indent-tabs-mode: nil
00105 // ispell-local-dictionary: "american"
00106 // compile-command: "scons -u test"
00107 // End:

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