Branch data Line data Source code
1 : : // *****************************************************************************
2 : : /*!
3 : : \file src/UnitTest/QuietCerr.hpp
4 : : \copyright 2012-2015 J. Bakosi,
5 : : 2016-2018 Los Alamos National Security, LLC.,
6 : : 2019-2021 Triad National Security, LLC.,
7 : : 2022-2025 J. Bakosi
8 : : All rights reserved. See the LICENSE file for details.
9 : : \brief Charm++ nodegroup to quiet std::cerr in a thread-safe fashion
10 : : \details Charm++ nodegroup to quiet std::cerr in a thread-safe fashion.
11 : : */
12 : : // *****************************************************************************
13 : : #ifndef QuietCerr_h
14 : : #define QuietCerr_h
15 : :
16 : : #include "NoWarning/quietcerr.decl.h"
17 : :
18 : : namespace tk {
19 : :
20 : : //! Chare state Charm++ chare nodegroup class
21 : : //! \details Instantiations of QuietCerr comprise a processor aware Charm++
22 : : //! chare node group. When instantiated, a new object is created on each
23 : : //! compute node and not more (as opposed to individual chares or chare array
24 : : //! object elements). See also the Charm++ interface file quietcerr.ci.
25 [ + - ]: 18 : class QuietCerr : public CBase_QuietCerr {
26 : :
27 : : public:
28 : : //! Quiet std::cerr by redirecting its stream state to a stringstream
29 : : static void quiet();
30 : :
31 : : //! Destructor: restore std::cerr's stream state
32 : : ~QuietCerr() override;
33 : : };
34 : :
35 : : } // tk::
36 : :
37 : : #endif // QuietCerr_h
|