The Gaudi Framework  master (da3d77e1)
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<typename... Args>
std::ostreamoperator<< (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::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 T , class ALLOC >
std::ostreamoperator<< (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::ostreamoperator<< (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::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/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 164 of file SerializeSTL.h.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

120  {
121  return details::ostream_joiner( s << '[', v, ", " ) << ']';
122  }
std::pair
gaudirun.s
string s
Definition: gaudirun.py:346
Gaudi::Units::m
constexpr double m
Definition: SystemOfUnits.h:108
std::ostream
STL class.
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:95
gaudirun.l
dictionary l
Definition: gaudirun.py:583
Properties.v
v
Definition: Properties.py:122
std::set
STL class.