STIR  6.2.0
warning.h
Go to the documentation of this file.
1 //
2 //
3 #ifndef __stir_warning_H__
4 #define __stir_warning_H__
5 /*
6  Copyright (C) 2010- 2013, Hammersmith Imanet Ltd
7  This file is part of STIR.
8  SPDX-License-Identifier: Apache-2.0
9 
10  See STIR/LICENSE.txt for details
11 */
20 #include "stir/common.h"
21 #include "stir/Verbosity.h"
22 #include <iostream>
23 
24 #include "TextWriter.h"
25 
26 START_NAMESPACE_STIR
27 
29 
41 void warning(const char* const s, ...);
42 
44 
64 template <class STRING>
65 inline void
66 warning(const STRING& string, const int verbosity_level = 1)
67 {
68  if (Verbosity::get() >= verbosity_level)
69  {
70  std::stringstream sstr;
71  sstr << "\nWARNING: " << string << std::endl;
72  writeText(sstr.str().c_str(), WARNING_CHANNEL);
73  }
74 }
75 END_NAMESPACE_STIR
76 #endif
void warning(const STRING &string, const int verbosity_level=1)
Use this function for writing warning messages.
Definition: warning.h:66
Declaration of class stir::Verbosity.
const Array< num_dimensions - num_dimensions2, elemT > & get(const Array< num_dimensions, elemT > &a, const BasicCoordinate< num_dimensions2, int > &c)
an alternative for array indexing using BasicCoordinate objects
Definition: array_index_functions.inl:114
basic configuration include file