13 #ifndef GAUDIKERNEL_SERIALIZESTL_H_
14 #define GAUDIKERNEL_SERIALIZESTL_H_
26 namespace GaudiUtils {
30 template <
class T,
class ALLOC>
31 inline std::ostream& operator<< ( std::ostream& s, const std::vector<T,ALLOC>& v )
35 for(
typename std::vector<T,ALLOC>::const_iterator
i=v.begin();
i!=v.end(); ++
i) {
36 if (
i != v.begin())
s <<
", ";
45 template <
class T,
class ALLOC>
46 inline std::ostream& operator<< ( std::ostream& s, const std::list<T,ALLOC>&
l )
50 for(
typename std::list<T,ALLOC>::const_iterator
i=
l.begin();
i!=
l.end(); ++
i) {
51 if (
i !=
l.begin())
s <<
", ";
60 template <
class T1,
class T2>
61 inline std::ostream& operator<< ( std::ostream& s, const std::pair<T1,T2>& p )
63 return s <<
"(" << p.first <<
", " << p.second <<
")";
67 template <
class T1,
class T2,
class COMP,
class ALLOC>
69 const std::map<T1,T2,COMP,ALLOC>& m )
72 for (
typename std::map<T1,T2,COMP,ALLOC>::const_iterator
i = m.begin();
74 if (
i != m.begin() ) s <<
", ";
75 s <<
i->first <<
": " <<
i->second;
82 template <
class K,
class T,
class M>
93 template <
class K,
class T,
class H,
class M>
98 return s << GaudiUtils::Map<K,T>(m.
begin(),m.
end());
Extension of the STL map.
Common class providing an architecture-independent hash map.
std::ostream & operator<<(std::ostream &s, const std::vector< T, ALLOC > &v)
Serialize an std::vector in a python like format. E.g. "[1, 2, 3]".