PandaRoot
PndFTSArrayIO.h
Go to the documentation of this file.
1 /**************************************************************************
2  * This file is property of and copyright by the ALICE HLT Project *
3  * All rights reserved. *
4  * *
5  * Primary Authors: *
6  * Copyright 2009 Matthias Kretz <kretz@kde.org> *
7  * *
8  * Permission to use, copy, modify and distribute this software and its *
9  * documentation strictly for non-commercial purposes is hereby granted *
10  * without fee, provided that the above copyright notice appears in all *
11  * copies and that both the copyright notice and this permission notice *
12  * appear in the supporting documentation. The authors make no claims *
13  * about the suitability of this software for any purpose. It is *
14  * provided "as is" without express or implied warranty. *
15  **************************************************************************/
16 
17 #ifndef PNDFTSARRAYIO_H
18 #define PNDFTSARRAYIO_H
19 
20 #include <iostream>
21 #include "PndFTSArray.h"
22 
23 namespace {
24 namespace AnsiColor {
25 static const char *const green = "\033[1;40;32m";
26 static const char *const yellow = "\033[1;40;33m";
27 static const char *const blue = "\033[1;40;34m";
28 static const char *const normal = "\033[0m";
29 } // namespace AnsiColor
30 } // anonymous namespace
31 
32 template <typename T>
33 inline std::ostream &operator<<(std::ostream &out, const PndFTSArray<T> &a)
34 {
35  out << AnsiColor::blue << "{" << AnsiColor::normal;
36  for (int i = 0; i < a.Size(); ++i) {
37  if (i > 0) {
38  out << AnsiColor::blue << ", " << AnsiColor::normal;
39  }
40  out << a[i];
41  }
42  out << AnsiColor::blue << "}" << AnsiColor::normal;
43  return out;
44 }
45 #endif // ALIHLTARRAYIO_H
unsigned int i
Definition: P4_F32vec4.h:21