The Gaudi Framework  master (01b473db)
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::ostream & operator<< (std::ostream &s, const std::pair< T1, T2 > &p)
 Serialize an std::pair in a python like format. E.g. "(1, 2)". More...
 
template<typename... Args>
std::ostream & operator<< (std::ostream &s, const std::tuple< Args... > &tuple)
 Serialize an std::tuple in a python like format. E.g. "(1, 2)". More...
 
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 , std::size_t N>
std::ostream & operator<< (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::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 T , class ALLOC >
std::ostream & operator<< (std::ostream &s, const std::set< T, ALLOC > &l)
 Serialize an std::set in a python like format. E.g. "[1, 2, 3]". More...
 
template<class T , class ALLOC >
std::ostream & operator<< (std::ostream &s, const std::unordered_set< T, ALLOC > &l)
 Serialize an std::unordered_set in a python like format. E.g. "{1, 2, 3}". 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. E.g. "{a: 1, b: 2}". More...
 

Function Documentation

◆ operator<<() [1/10]

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

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

◆ operator<<() [2/10]

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

155  {
156  // Serialize the internal map.
157  return s << static_cast<const M&>( m );
158  }

◆ operator<<() [3/10]

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

124  {
125  return details::ostream_joiner( s << '[', v, ", " ) << ']';
126  }

◆ operator<<() [4/10]

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

129  {
130  return details::ostream_joiner( s << '[', l, ", " ) << ']';
131  }

◆ operator<<() [5/10]

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

146  {
147  return details::ostream_joiner( s << "{", m, ", ",
148  []( std::ostream& os, const std::pair<const T1, T2>& p ) -> std::ostream& {
149  return os << p.first << ": " << p.second;
150  } )
151  << "}";
152  }

◆ operator<<() [6/10]

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

101  {
102  return s << '(' << p.first << ", " << p.second << ')';
103  }

◆ operator<<() [7/10]

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

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

Definition at line 134 of file SerializeSTL.h.

134  {
135  return details::ostream_joiner( s << '[', l, ", " ) << ']';
136  }

◆ operator<<() [8/10]

template<typename... Args>
std::ostream & GaudiUtils::operator<< ( std::ostream &  s,
const std::tuple< Args... > &  tuple 
)

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

Definition at line 106 of file SerializeSTL.h.

106  {
107  return std::apply(
108  [&s]( const auto&... a ) -> decltype( auto ) {
109  unsigned n = sizeof...( a );
110  if ( n == 1 ) n = 2; // special case in python...
111  s << " (";
112  ( ( s << " " << a << ( --n == 0 ? "" : "," ) ), ... );
113  return s << " )";
114  },
115  tup );
116  }

◆ operator<<() [9/10]

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

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

Definition at line 139 of file SerializeSTL.h.

139  {
140  auto ordered = std::set( l.begin(), l.end() ); // ensure reproducible printout
141  s << ordered;
142  return s;
143  }

◆ operator<<() [10/10]

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

119  {
120  return details::ostream_joiner( s << '[', v, ", " ) << ']';
121  }
gaudirun.s
string s
Definition: gaudirun.py:346
Gaudi::Units::m
constexpr double m
Definition: SystemOfUnits.h:107
cpluginsvc.n
n
Definition: cpluginsvc.py:234
GaudiUtils::details::ostream_joiner
Stream & ostream_joiner(Stream &os, const Container &c, Separator sep, OutputElement output=OutputElement{})
Definition: SerializeSTL.h:94
gaudirun.l
dictionary l
Definition: gaudirun.py:583
Properties.v
v
Definition: Properties.py:122