| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Namespace List
- Namespace Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Functions
GaudiUtils Namespace Reference

Forward declarations for the functions in SerializeSTL.h. More...

## 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 'Loki::AssocVector' 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.

## Detailed Description

Forward declarations for the functions in SerializeSTL.h.

Author
  Marco Clemencic

See Also
  SerializeSTL.h

## Function Documentation

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

{
s << "[";
//int cnt = 0;
for(typename std::vector<T,ALLOC>::const_iterator i=v.begin(); i!=v.end(); ++i) {
if ( i != v.begin()) s << ", ";
s << (*i);
//if ((++cnt)%NUMBERS_PER_LINE == 0) s << std::endl;
}
s << "]";
return s;
}
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 46 of file SerializeSTL.h.

{
s << "[";
//int cnt = 0;
for(typename std::list<T,ALLOC>::const_iterator i=l.begin(); i!=l.end(); ++i) {
if ( i != l.begin()) s << ", ";
s << (*i);
//if ((++cnt)%NUMBERS_PER_LINE == 0) s << std::endl;
}
s << "]";
return s;
}
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 61 of file SerializeSTL.h.

{
return s << "(" << p.first << ", " << p.second << ")";
}
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 68 of file SerializeSTL.h.

{
s << "{";
for ( typename std::map<T1,T2,COMP,ALLOC>::const_iterator i = m.begin();
i != m.end(); ++i ) {
if ( i != m.begin() ) s << ", ";
s << i->first << ": " << i->second;
}
s << "}";
return s;
}
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 83 of file SerializeSTL.h.

{
// Serialize the internal map.
return s << (M)m;
}
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 94 of file SerializeSTL.h.

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