Teuchos - Trilinos Tools Package
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
core
src
Teuchos_CWrapperSupport.cpp
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
10
#include "Teuchos_CWrapperSupport_Cpp.hpp"
11
#include "Teuchos_VerboseObject.hpp"
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)) {
21
printErrorOStream =
Teuchos::VerboseObjectBase::getDefaultOStream
();
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
45
void
CWrapperErrorHandling::setPrintErrorOStream
(
46
const
RCP<FancyOStream>
&errorOStream
47
)
48
{
49
printErrorOStreamImpl() = errorOStream;
50
}
51
52
53
RCP<FancyOStream>
CWrapperErrorHandling::getPrintErrorOStream
()
54
{
55
return
printErrorOStreamImpl();
56
}
57
58
59
void
CWrapperErrorHandling::setShowStackTraceOnException
(
60
const
bool
showStrackTraceOnException)
61
{
62
showStackTraceOnExceptionImpl() = showStrackTraceOnException;
63
}
64
65
66
bool
CWrapperErrorHandling::getShowStackTraceOnException
()
67
{
68
return
showStackTraceOnExceptionImpl();
69
}
70
71
72
}
// namespace Teuchos
Teuchos::CWrapperErrorHandling::setShowStackTraceOnException
static void setShowStackTraceOnException(const bool showStrackTraceOnException)
Set if the stacktrace should be shown on every caught exception.
Definition
Teuchos_CWrapperSupport.cpp:59
Teuchos::CWrapperErrorHandling::getShowStackTraceOnException
static bool getShowStackTraceOnException()
Get if the stacktrace should be shown on every caught exception.
Definition
Teuchos_CWrapperSupport.cpp:66
Teuchos::RCP
Smart reference counting pointer class for automatic garbage collection.
Definition
Teuchos_RCPDecl.hpp:397
Teuchos::VerboseObjectBase::getDefaultOStream
static RCP< FancyOStream > getDefaultOStream()
Get the default output stream object.
Definition
Teuchos_VerboseObject.cpp:45
Teuchos::CWrapperErrorHandling::getPrintErrorOStream
static RCP< FancyOStream > getPrintErrorOStream()
Get the ostream that will be printed when errors occur.
Definition
Teuchos_CWrapperSupport.cpp:53
Teuchos::CWrapperErrorHandling::setPrintErrorOStream
static void setPrintErrorOStream(const RCP< FancyOStream > &errorOStream)
Set the ostream that will be printed to when errors occur.
Definition
Teuchos_CWrapperSupport.cpp:45
boost::is_null
bool is_null(const boost::shared_ptr< T > &p)
Returns true if p.get()==NULL.
Definition
Teuchos_RCPBoostSharedPtrConversionsDecl.hpp:122
Teuchos
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
Generated by
1.17.0