12 #ifndef GAUDIKERNEL_SERIALIZESTL_H_
13 #define GAUDIKERNEL_SERIALIZESTL_H_
20 #include "GaudiKernel/Map.h"
21 #include "GaudiKernel/HashMap.h"
23 #include "GaudiKernel/SerializeSTLFwd.h"
29 template <
class T,
class ALLOC>
30 inline std::ostream& operator<< ( std::ostream& s, const std::vector<T,ALLOC>& v )
34 for(
typename std::vector<T,ALLOC>::const_iterator
i=v.begin();
i!=v.end(); ++
i) {
35 if (
i != v.begin())
s <<
", ";
44 template <
class T,
class ALLOC>
45 inline std::ostream& operator<< ( std::ostream& s, const std::list<T,ALLOC>&
l )
49 for(
typename std::list<T,ALLOC>::const_iterator
i=
l.begin();
i!=
l.end(); ++
i) {
50 if (
i !=
l.begin())
s <<
", ";
59 template <
class T1,
class T2>
60 inline std::ostream& operator<< ( std::ostream& s, const std::pair<T1,T2>& p )
62 return s <<
"(" << p.first <<
", " << p.second <<
")";
66 template <
class T1,
class T2,
class COMP,
class ALLOC>
68 const std::map<T1,T2,COMP,ALLOC>&
m )
71 for (
typename std::map<T1,T2,COMP,ALLOC>::const_iterator
i = m.begin();
73 if (
i != m.begin() ) s <<
", ";
74 s <<
i->first <<
": " <<
i->second;
81 template <
class K,
class T,
class M>
92 template <
class K,
class T,
class H,
class M>
97 return s << GaudiUtils::Map<K,T>(m.
begin(),m.
end());
Extension of the STL map.
Forward declarations for the functions in SerializeSTL.h.
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]".