Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos_CWrapperSupport.cpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
12 
13 
14 namespace {
15 
16 
17 Teuchos::RCP<Teuchos::FancyOStream>& printErrorOStreamImpl()
18 {
19  static Teuchos::RCP<Teuchos::FancyOStream> printErrorOStream;
20  if (is_null(printErrorOStream)) {
22  }
23  return printErrorOStream;
24 }
25 
26 
27 bool& showStackTraceOnExceptionImpl()
28 {
29  static bool showStackTraceOnException = false;
30  return showStackTraceOnException;
31 }
32 
33 
34 } // namespace
35 
36 
37 namespace Teuchos {
38 
39 
40 //
41 // CWrapperErrorHandling
42 //
43 
44 
46  const RCP<FancyOStream> &errorOStream
47  )
48 {
49  printErrorOStreamImpl() = errorOStream;
50 }
51 
52 
54 {
55  return printErrorOStreamImpl();
56 }
57 
58 
60  const bool showStrackTraceOnException)
61 {
62  showStackTraceOnExceptionImpl() = showStrackTraceOnException;
63 }
64 
65 
67 {
68  return showStackTraceOnExceptionImpl();
69 }
70 
71 
72 } // namespace Teuchos
static RCP< FancyOStream > getPrintErrorOStream()
Get the ostream that will be printed when errors occur.
static bool getShowStackTraceOnException()
Get if the stacktrace should be shown on every caught exception.
bool is_null(const ArrayRCP< T > &p)
Returns true if p.get()==NULL.
static RCP< FancyOStream > getDefaultOStream()
Get the default output stream object.
static void setPrintErrorOStream(const RCP< FancyOStream > &errorOStream)
Set the ostream that will be printed to when errors occur.
Smart reference counting pointer class for automatic garbage collection.
static void setShowStackTraceOnException(const bool showStrackTraceOnException)
Set if the stacktrace should be shown on every caught exception.