Socket/Protocols/Raw: EUI64 documentation
[senf.git] / Utils / Console / STLSupport.hh
1 // $Id$
2 //
3 // Copyright (C) 2009 
4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 //     Stefan Bund <g0dil@berlios.de>
7 //
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22
23 /** \file
24     \brief STLSupport public header */
25
26 #ifndef HH_SENF_Utils_Console_STLSupport_
27 #define HH_SENF_Utils_Console_STLSupport_ 1
28
29 // Custom includes
30 #include <vector>
31 #include <list>
32 #include "Traits.hh"
33
34 //#include "STLSupport.mpp"
35 ///////////////////////////////hh.p////////////////////////////////////////
36
37 namespace senf {
38 namespace console {
39
40 #ifndef DOXYGEN
41
42     template <class Sequence>
43     struct SequenceArgumentTraits
44     {
45         typedef Sequence type;
46
47         static void parse(ParseCommandInfo::TokensRange const & tokens, type & out);
48         static std::string description();
49         static std::string str(type const & value);
50     };
51
52     template <class Sequence>
53     struct SequenceReturnValueTraits
54     {
55         typedef Sequence type;
56
57         static void format(type const & value, std::ostream & os);
58     };
59
60     template <class T, class Alloc>
61     struct ArgumentTraits< std::vector<T,Alloc> >
62         : public SequenceArgumentTraits< std::vector<T,Alloc> >
63     {};
64
65     template <class T, class Alloc>
66     struct ReturnValueTraits< std::vector<T,Alloc> >
67         : public SequenceReturnValueTraits< std::vector<T,Alloc> >
68     {};
69
70     template <class T, class Alloc>
71     struct ArgumentTraits< std::list<T,Alloc> >
72         : public SequenceArgumentTraits< std::list<T,Alloc> >
73     {};
74
75     template <class T, class Alloc>
76     struct ReturnValueTraits< std::list<T,Alloc> >
77         : public SequenceReturnValueTraits< std::list<T,Alloc> >
78     {};
79
80 #endif
81
82 }}
83
84 ///////////////////////////////hh.e////////////////////////////////////////
85 //#include "STLSupport.cci"
86 #include "STLSupport.ct"
87 //#include "STLSupport.cti"
88 #endif
89
90 \f
91 // Local Variables:
92 // mode: c++
93 // fill-column: 100
94 // comment-column: 40
95 // c-file-style: "senf"
96 // indent-tabs-mode: nil
97 // ispell-local-dictionary: "american"
98 // compile-command: "scons -u test"
99 // End: