The Gaudi Framework  v33r2 (a6f0ec87)
GaudiUtils Namespace Reference

Namespaces

 details
 

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

Function Documentation

◆ operator<<() [1/7]

template<class T1 , class T2 >
std::ostream & GaudiUtils::operator<< ( std::ostream s,
const std::pair< T1, T2 > &  p 
)

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

Definition at line 88 of file SerializeSTL.h.

88  {
89  return s << '(' << p.first << ", " << p.second << ')';
90  }
string s
Definition: gaudirun.py:328

◆ operator<<() [2/7]

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

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

Definition at line 93 of file SerializeSTL.h.

93  {
94  return details::ostream_joiner( s << '[', v, ", " ) << ']';
95  }
Stream & ostream_joiner(Stream &os, const Container &c, Separator sep, OutputElement output=OutputElement{})
Definition: SerializeSTL.h:81
string s
Definition: gaudirun.py:328

◆ operator<<() [3/7]

template<class T , std::size_t N>
std::ostream & GaudiUtils::operator<< ( std::ostream s,
const std::array< T, N > &  v 
)

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

Definition at line 98 of file SerializeSTL.h.

98  {
99  return details::ostream_joiner( s << '[', v, ", " ) << ']';
100  }
Stream & ostream_joiner(Stream &os, const Container &c, Separator sep, OutputElement output=OutputElement{})
Definition: SerializeSTL.h:81
string s
Definition: gaudirun.py:328

◆ operator<<() [4/7]

template<class T , class ALLOC >
std::ostream & GaudiUtils::operator<< ( std::ostream s,
const std::list< T, ALLOC > &  l 
)

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

Definition at line 103 of file SerializeSTL.h.

103  {
104  return details::ostream_joiner( s << '[', l, ", " ) << ']';
105  }
dictionary l
Definition: gaudirun.py:543
Stream & ostream_joiner(Stream &os, const Container &c, Separator sep, OutputElement output=OutputElement{})
Definition: SerializeSTL.h:81
string s
Definition: gaudirun.py:328

◆ operator<<() [5/7]

template<class T1 , class T2 , class COMP , class ALLOC >
std::ostream & GaudiUtils::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}".

Definition at line 108 of file SerializeSTL.h.

108  {
109  return details::ostream_joiner( s << "{", m, ", ",
110  []( std::ostream& os, const std::pair<const T1, T2>& p ) -> std::ostream& {
111  return os << p.first << ": " << p.second;
112  } )
113  << "}";
114  }
constexpr double m
Stream & ostream_joiner(Stream &os, const Container &c, Separator sep, OutputElement output=OutputElement{})
Definition: SerializeSTL.h:81
string s
Definition: gaudirun.py:328
STL class.

◆ operator<<() [6/7]

template<class K , class T , class M >
std::ostream & GaudiUtils::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}".

Definition at line 117 of file SerializeSTL.h.

117  {
118  // Serialize the internal map.
119  return s << static_cast<const M&>( m );
120  }
constexpr double m

◆ operator<<() [7/7]

template<class K , class T , class H , class M >
std::ostream & GaudiUtils::operator<< ( std::ostream s,
const GaudiUtils::HashMap< K, T, H, M > &  m 
)

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 125 of file SerializeSTL.h.

125  {
126  // Copy the hash map into a map to have it ordered by key.
127  return s << GaudiUtils::Map<K, T>( m.begin(), m.end() );
128  }
constexpr double m