Socket: fixed bug in readfrom where socklen was not set
[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         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 #endif
82
83 }}
84
85 ///////////////////////////////hh.e////////////////////////////////////////
86 //#include "STLSupport.cci"
87 #include "STLSupport.ct"
88 //#include "STLSupport.cti"
89 #endif
90
91 \f
92 // Local Variables:
93 // mode: c++
94 // fill-column: 100
95 // comment-column: 40
96 // c-file-style: "senf"
97 // indent-tabs-mode: nil
98 // ispell-local-dictionary: "american"
99 // compile-command: "scons -u test"
100 // End: