| # Gaudi Framework, version v21r10p1 |

Home |  | Generated: 29 Jul 2010

# GaudiUtils Namespace Reference

## 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< T * >
| the partial specialization for pointers More...
struct | Hash< T(&)[N]>
| generic specialization for arrays More...
struct | Hash< const T(&)[N]>
| generic specialization for arrays More...
struct | Hash< const T >
| remove extra qualifiers: More...
struct | Hash< const T * >
| remove extra qualifiers: More...
struct | Hash< T & >
| remove extra qualifiers: More...
struct | Hash< const T & >
| remove extra qualifiers: 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 'LokiAssocVector' associative vector from Loki library by Andrei Alexandrescu. More...
## Functions
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, 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 T1, class T2>
std::ostream & | operator<< (std::ostream &s, const std::pair< T1, T2 > &p)
| Serialize an std::list in a python like format. E.g. "(1, 2)".
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}".
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}".
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.

## Function Documentation

template<class K, class T, class H, class M>

std::ostream& GaudiUtils::operator<< | ( | std::ostream & | s,
|  | const GaudiUtils::HashMap< K, T, H, M > & | m |
| ) |  |  | `[inline]`

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

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

template<class K, class T, class M>

std::ostream& GaudiUtils::operator<< | ( | std::ostream & | s,
|  | const GaudiUtils::Map< K, T, M > & | m |
| ) |  |  | `[inline]`

Serialize a GaudiUtils::Map in a python like format. E.g. "{a: 1, b: 2}".

Definition at line 81 of file SerializeSTL.h.

    00083   {
    00084     // Serialize the internal map.
    00085     return s << (M)m;
    00086   }

template<class T1, class T2, class COMP, class ALLOC>

std::ostream& GaudiUtils::operator<< | ( | std::ostream & | s,
|  | const std::map< T1, T2, COMP, ALLOC > & | m |
| ) |  |  | `[inline]`

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

Definition at line 66 of file SerializeSTL.h.

    00068   {
    00069     s << "{";
    00070     for ( typename std::map<T1,T2,COMP,ALLOC>::const_iterator i = m.begin();
    00071     i != m.end(); ++i ) {
    00072       if ( i != m.begin() ) s << ", ";
    00073       s << i->first << ": " << i->second;
    00074     }
    00075     s << "}";
    00076     return s;
    00077   }

template<class T1, class T2>

std::ostream& GaudiUtils::operator<< | ( | std::ostream & | s,
|  | const std::pair< T1, T2 > & | p |
| ) |  |  | `[inline]`

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

Definition at line 59 of file SerializeSTL.h.

    00060   {
    00061     return s << "(" << p.first << ", " << p.second << ")";
    00062   }

template<class T, class ALLOC>

std::ostream& GaudiUtils::operator<< | ( | std::ostream & | s,
|  | const std::list< T, ALLOC > & | l |
| ) |  |  | `[inline]`

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

Definition at line 44 of file SerializeSTL.h.

    00045   {
    00046     s << "[";
    00047     //int cnt = 0;
    00048     for(typename std::list<T,ALLOC>::const_iterator i=l.begin(); i!=l.end(); ++i) {
    00049       if ( i != l.begin()) s << ", ";
    00050       s << (*i);
    00051       //if ((++cnt)%NUMBERS_PER_LINE == 0) s << std::endl;
    00052     }
    00053     s << "]";
    00054     return s;
    00055   }

template<class T, class ALLOC>

std::ostream& GaudiUtils::operator<< | ( | std::ostream & | s,
|  | const std::vector< T, ALLOC > & | v |
| ) |  |  | `[inline]`

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

Definition at line 29 of file SerializeSTL.h.

    00030   {
    00031     s << "[";
    00032     //int cnt = 0;
    00033     for(typename std::vector<T,ALLOC>::const_iterator i=v.begin(); i!=v.end(); ++i) {
    00034       if ( i != v.begin()) s << ", ";
    00035       s << (*i);
    00036       //if ((++cnt)%NUMBERS_PER_LINE == 0) s << std::endl;
    00037     }
    00038     s << "]";
    00039     return s;
    00040   }