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