Fix SCons 1.2.0 build failure
[senf.git] / senf / 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         static bool const singleToken = false;
47
48         static void parse(ParseCommandInfo::TokensRange const & tokens, type & out);
49         static std::string description();
50         static std::string str(type const & value);
51     };
52
53     template <class Sequence>
54     struct SequenceReturnValueTraits
55     {
56         typedef Sequence type;
57
58         static void format(type const & value, std::ostream & os);
59     };
60
61     template <class T, class Alloc>
62     struct ArgumentTraits< std::vector<T,Alloc> >
63         : public SequenceArgumentTraits< std::vector<T,Alloc> >
64     {};
65
66     template <class T, class Alloc>
67     struct ReturnValueTraits< std::vector<T,Alloc> >
68         : public SequenceReturnValueTraits< std::vector<T,Alloc> >
69     {};
70
71     template <class T, class Alloc>
72     struct ArgumentTraits< std::list<T,Alloc> >
73         : public SequenceArgumentTraits< std::list<T,Alloc> >
74     {};
75
76     template <class T, class Alloc>
77     struct ReturnValueTraits< std::list<T,Alloc> >
78         : public SequenceReturnValueTraits< std::list<T,Alloc> >
79     {};
80
81     template <class T1, class T2>
82     struct ArgumentTraits< std::pair<T1,T2> >
83     {
84         typedef std::pair<T1,T2> type;
85         static bool const singleToken = false;
86
87         static void parse(ParseCommandInfo::TokensRange const & tokens, type & out);
88         static std::string description();
89         static std::string str(type const & value);
90     };
91
92     template <class T1, class T2>
93     struct ReturnValueTraits< std::pair<T1,T2> >
94     {
95         typedef std::pair<T1,T2> type;
96
97         static void format(type const & value, std::ostream & os);
98     };
99
100 #endif
101
102 }}
103
104 ///////////////////////////////hh.e////////////////////////////////////////
105 //#include "STLSupport.cci"
106 #include "STLSupport.ct"
107 //#include "STLSupport.cti"
108 #endif
109
110 \f
111 // Local Variables:
112 // mode: c++
113 // fill-column: 100
114 // comment-column: 40
115 // c-file-style: "senf"
116 // indent-tabs-mode: nil
117 // ispell-local-dictionary: "american"
118 // compile-command: "scons -u test"
119 // End: