ATLAS Offline Software
SetPrint.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id: SetPrint.h 618129 2014-09-23 11:37:00Z krasznaa $
8 #ifndef TRIGBUNCHCROSSINGTOOL_SETPRINT_H
9 #define TRIGBUNCHCROSSINGTOOL_SETPRINT_H
10 
11 // System include(s):
12 #include <set>
13 #include <iostream>
14 
15 // Gaudi/Athena include(s):
16 #include "AsgMessaging/MsgStream.h"
17 
19 template< typename T >
20 std::ostream& operator<< ( std::ostream& out, const std::set< T >& var ) {
21 
22  out << "[";
23  typename std::set< T >::const_iterator itr = var.begin();
24  typename std::set< T >::const_iterator end = var.end();
25  for( ; itr != end; ++itr ) {
26  out << *itr;
27  if( ++itr != end ) {
28  out << ", ";
29  }
30  --itr;
31  }
32  out << "]";
33 
34  return out;
35 }
36 
38 template< typename T >
39 MsgStream& operator<< ( MsgStream& out, const std::set< T >& var ) {
40 
41  out << "[";
42  typename std::set< T >::const_iterator itr = var.begin();
43  typename std::set< T >::const_iterator end = var.end();
44  for( ; itr != end; ++itr ) {
45  out << *itr;
46  if( ++itr != end ) {
47  out << ", ";
48  }
49  --itr;
50  }
51  out << "]";
52 
53  return out;
54 }
55 
56 #endif // TRIGBUNCHCROSSINGTOOL_SETPRINT_H
beamspotnt.var
var
Definition: bin/beamspotnt.py:1394
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
operator<<
std::ostream & operator<<(std::ostream &out, const std::set< T > &var)
Helper operator for printing std::set variables easily.
Definition: SetPrint.h:20
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
MsgStream.h