The Gaudi Framework  master (37c0b60a)
GaudiUtils Namespace Reference

Namespaces

 details
 

Classes

class  Allocator
 
class  AllocatorPool
 
struct  GenericHash
 Generic hash implementation (for easy migration to the new Hash class). More...
 
class  Hash
 
struct  Hash< const Gaudi::ParticleID & >
 
struct  Hash< const Gaudi::ParticleID >
 
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< Gaudi::ParticleID & >
 
struct  Hash< Gaudi::ParticleID >
 
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
 
class  Map
 
class  VectorMap
 

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...
 
template<class T , class ALLOC >
std::ostreamoperator<< (std::ostream &s, const std::set< T, ALLOC > &l)
 
template<class T , class ALLOC >
std::ostreamoperator<< (std::ostream &s, const std::unordered_set< T, ALLOC > &l)
 

Function Documentation

◆ operator<<() [1/9]

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

139  {
140  // Copy the hash map into a map to have it ordered by key.
141  return s << GaudiUtils::Map<K, T>( m.begin(), m.end() );
142  }

◆ operator<<() [2/9]

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

131  {
132  // Serialize the internal map.
133  return s << static_cast<const M&>( m );
134  }

◆ operator<<() [3/9]

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

100  {
101  return details::ostream_joiner( s << '[', v, ", " ) << ']';
102  }

◆ operator<<() [4/9]

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

105  {
106  return details::ostream_joiner( s << '[', l, ", " ) << ']';
107  }

◆ operator<<() [5/9]

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

122  {
123  return details::ostream_joiner( s << "{", m, ", ",
124  []( std::ostream& os, const std::pair<const T1, T2>& p ) -> std::ostream& {
125  return os << p.first << ": " << p.second;
126  } )
127  << "}";
128  }

◆ operator<<() [6/9]

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

90  {
91  return s << '(' << p.first << ", " << p.second << ')';
92  }

◆ operator<<() [7/9]

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

Definition at line 110 of file SerializeSTL.h.

110  {
111  return details::ostream_joiner( s << '[', l, ", " ) << ']';
112  }

◆ operator<<() [8/9]

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

Definition at line 115 of file SerializeSTL.h.

115  {
116  auto ordered = std::set( l.begin(), l.end() ); // ensure reproducible printout
117  s << ordered;
118  return s;
119  }

◆ operator<<() [9/9]

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

95  {
96  return details::ostream_joiner( s << '[', v, ", " ) << ']';
97  }
std::pair
gaudirun.s
string s
Definition: gaudirun.py:346
Gaudi::Units::m
constexpr double m
Definition: SystemOfUnits.h:108
std::ostream
STL class.
GaudiUtils::details::ostream_joiner
Stream & ostream_joiner(Stream &os, const Container &c, Separator sep, OutputElement output=OutputElement{})
Definition: SerializeSTL.h:83
gaudirun.l
dictionary l
Definition: gaudirun.py:583
Properties.v
v
Definition: Properties.py:122
std::set
STL class.