All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GaudiUtils Namespace Reference

Forward declarations for the functions in SerializeSTL.h. More...

Classes

class  Allocator
 Allocator. More...
 
class  AllocatorPool
 Allocator pool. More...
 
struct  GenericHash
 Generic hash implementation (for easy migration to the new Hash class). More...
 
class  Hash
 Simple hash function. More...
 
struct  Hash< const T & >
 remove extra qualifiers: More...
 
struct  Hash< const T * >
 remove extra qualifiers: More...
 
struct  Hash< const T >
 remove extra qualifiers: More...
 
struct  Hash< const T(&)[N]>
 generic specialization for arrays More...
 
struct  Hash< T & >
 remove extra qualifiers: More...
 
struct  Hash< T * >
 the partial specialization for pointers More...
 
struct  Hash< T(&)[N]>
 generic specialization for arrays More...
 
class  HashMap
 Common class providing an architecture-independent hash map. More...
 
class  Map
 Extension of the STL map. More...
 
class  VectorMap
 A bit modified version of 'Loki::AssocVector' associative vector from Loki library by Andrei Alexandrescu. More...
 

Functions

template<class T , class ALLOC >
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]". More...
 
template<class T , class ALLOC >
std::ostream & operator<< (std::ostream &s, const std::list< T, ALLOC > &l)
 Serialize an std::list in a python like format. E.g. "[1, 2, 3]". More...
 
template<class T1 , class T2 >
std::ostream & operator<< (std::ostream &s, const std::pair< T1, T2 > &p)
 Serialize an std::list in a python like format. E.g. "(1, 2)". More...
 
template<class T1 , class T2 , class COMP , class ALLOC >
std::ostream & operator<< (std::ostream &s, const std::map< T1, T2, COMP, ALLOC > &m)
 Serialize an std::map in a python like format. E.g. "{a: 1, b: 2}". More...
 
template<class K , class T , class M >
std::ostream & operator<< (std::ostream &s, const GaudiUtils::Map< K, T, M > &m)
 Serialize a GaudiUtils::Map in a python like format. E.g. "{a: 1, b: 2}". More...
 
template<class K , class T , class H , class M >
std::ostream & operator<< (std::ostream &s, const GaudiUtils::HashMap< K, T, H, M > &m)
 Serialize a GaudiUtils::HashMap in a python like format. More...
 

Detailed Description

Forward declarations for the functions in SerializeSTL.h.

Author
Marco Clemencic
See also
SerializeSTL.h

Function Documentation

template<class T , class ALLOC >
std::ostream & GaudiUtils::operator<< ( std::ostream &  s,
const std::vector< T, ALLOC > &  v 
)
inline

Serialize an std::vector in a python like format. E.g. "[1, 2, 3]".

Definition at line 31 of file SerializeSTL.h.

32  {
33  s << "[";
34  //int cnt = 0;
35  for(typename std::vector<T,ALLOC>::const_iterator i=v.begin(); i!=v.end(); ++i) {
36  if ( i != v.begin()) s << ", ";
37  s << (*i);
38  //if ((++cnt)%NUMBERS_PER_LINE == 0) s << std::endl;
39  }
40  s << "]";
41  return s;
42  }
string s
Definition: gaudirun.py:210
list i
Definition: ana.py:128
template<class T , class ALLOC >
std::ostream & GaudiUtils::operator<< ( std::ostream &  s,
const std::list< T, ALLOC > &  l 
)
inline

Serialize an std::list in a python like format. E.g. "[1, 2, 3]".

Definition at line 46 of file SerializeSTL.h.

47  {
48  s << "[";
49  //int cnt = 0;
50  for(typename std::list<T,ALLOC>::const_iterator i=l.begin(); i!=l.end(); ++i) {
51  if ( i != l.begin()) s << ", ";
52  s << (*i);
53  //if ((++cnt)%NUMBERS_PER_LINE == 0) s << std::endl;
54  }
55  s << "]";
56  return s;
57  }
string s
Definition: gaudirun.py:210
list i
Definition: ana.py:128
template<class T1 , class T2 >
std::ostream & GaudiUtils::operator<< ( std::ostream &  s,
const std::pair< T1, T2 > &  p 
)
inline

Serialize an std::list in a python like format. E.g. "(1, 2)".

Definition at line 61 of file SerializeSTL.h.

62  {
63  return s << "(" << p.first << ", " << p.second << ")";
64  }
string s
Definition: gaudirun.py:210
template<class T1 , class T2 , class COMP , class ALLOC >
std::ostream & GaudiUtils::operator<< ( std::ostream &  s,
const std::map< T1, T2, COMP, ALLOC > &  m 
)
inline

Serialize an std::map in a python like format. E.g. "{a: 1, b: 2}".

Definition at line 68 of file SerializeSTL.h.

70  {
71  s << "{";
72  for ( typename std::map<T1,T2,COMP,ALLOC>::const_iterator i = m.begin();
73  i != m.end(); ++i ) {
74  if ( i != m.begin() ) s << ", ";
75  s << i->first << ": " << i->second;
76  }
77  s << "}";
78  return s;
79  }
string s
Definition: gaudirun.py:210
list i
Definition: ana.py:128
template<class K , class T , class M >
std::ostream & GaudiUtils::operator<< ( std::ostream &  s,
const GaudiUtils::Map< K, T, M > &  m 
)
inline

Serialize a GaudiUtils::Map in a python like format. E.g. "{a: 1, b: 2}".

Definition at line 83 of file SerializeSTL.h.

85  {
86  // Serialize the internal map.
87  return s << (M)m;
88  }
string s
Definition: gaudirun.py:210
template<class K , class T , class H , class M >
std::ostream & GaudiUtils::operator<< ( std::ostream &  s,
const GaudiUtils::HashMap< K, T, H, M > &  m 
)
inline

Serialize a GaudiUtils::HashMap in a python like format.

E.g. "{a: 1, b: 2}". This implementation is not efficient, but very simple. Anyway a print-out of a hash map is not something that we do every second.

Definition at line 94 of file SerializeSTL.h.

96  {
97  // Copy the hash map into a map to have it ordered by key.
98  return s << GaudiUtils::Map<K,T>(m.begin(),m.end());
99  }
iterator end()
Definition: Map.h:131
iterator begin()
Definition: Map.h:130