The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
GaudiUtils Namespace Reference

Namespaces

namespace  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 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
 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::ostream & operator<< (std::ostream &s, const std::pair< T1, T2 > &p)
 Serialize an std::pair in a python like format. E.g. "(1, 2)".
 
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)".
 
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]".
 
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]".
 
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]".
 
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]".
 
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}".
 
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}".
 

Variables

template<typename K, typename T, typename M>
const Map< K, T, M >::result_type Map< K, T, M >::s_null_value = typename Map<K, T, M>::result_type()
 

Function Documentation

◆ operator<<() [1/8]

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

114 {
115 return details::ostream_joiner( s << '[', v, ", " ) << ']';
116 }
Stream & ostream_joiner(Stream &os, Iterator first, Iterator last, Separator sep, OutputElement output=OutputElement{})

◆ operator<<() [2/8]

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

119 {
120 return details::ostream_joiner( s << '[', l, ", " ) << ']';
121 }

◆ operator<<() [3/8]

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

136 {
137 return details::ostream_joiner( s << "{", m, ", ",
138 []( std::ostream& os, const std::pair<const T1, T2>& p ) -> std::ostream& {
139 return os << p.first << ": " << p.second;
140 } )
141 << "}";
142 }

◆ operator<<() [4/8]

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

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

◆ operator<<() [5/8]

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

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

◆ operator<<() [6/8]

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

96 {
97 return std::apply(
98 [&s]( const auto&... a ) -> decltype( auto ) {
99 unsigned n = sizeof...( a );
100 if ( n == 1 ) n = 2; // special case in python...
101 s << " (";
102 ( ( s << " " << a << ( --n == 0 ? "" : "," ) ), ... );
103 return s << " )";
104 },
105 tup );
106 }

◆ operator<<() [7/8]

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

129 {
130 auto ordered = std::set( l.begin(), l.end() ); // ensure reproducible printout
131 s << ordered;
132 return s;
133 }

◆ operator<<() [8/8]

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

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

Variable Documentation

◆ Map< K, T, M >::s_null_value

template<typename K, typename T, typename M>
const Map<K,T,M>::result_type GaudiUtils::Map< K, T, M >::s_null_value = typename Map<K, T, M>::result_type()

Definition at line 288 of file Map.h.