Teuchos - Trilinos Tools Package
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
core
src
Teuchos_Describable.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_Describable.hpp"
11
#include "
Teuchos_TypeNameTraits.hpp
"
12
13
14
namespace
Teuchos
{
15
16
17
const
EVerbosityLevel
Describable::verbLevel_default
=
VERB_DEFAULT
;
18
19
20
std::string
Describable::description
()
const
21
{
22
const
std::string objectLabel = this->
getObjectLabel
();
23
std::ostringstream oss;
24
if
(objectLabel.length ()) {
25
oss <<
"\""
<< objectLabel <<
"\": "
;
26
}
27
oss <<
typeName
(*
this
);
28
return
oss.str ();
29
}
30
31
void
32
Describable::describe
(
FancyOStream
& out_arg,
33
const
EVerbosityLevel
/* verbLevel */
)
const
34
{
35
RCP<FancyOStream>
out =
rcpFromRef
(out_arg);
36
OSTab
tab
(out);
37
*out << this->
description
() << std::endl;
38
}
39
40
void
41
Describable::describe
(std::ostream& out,
42
const
EVerbosityLevel
verbLevel)
const
43
{
44
RCP<FancyOStream>
fancyOut =
getFancyOStream
(
rcpFromRef
(out));
45
this->
describe
(*fancyOut, verbLevel);
46
}
47
48
Describable::~Describable
() {}
49
50
}
// namespace Teuchos
Teuchos_TypeNameTraits.hpp
Defines basic traits returning the name of a type in a portable and readable way.
Teuchos::Describable::verbLevel_default
static const EVerbosityLevel verbLevel_default
Default value for the verbLevel argument of describe().
Definition
Teuchos_Describable.hpp:47
Teuchos::Describable::describe
virtual void describe(FancyOStream &out, const EVerbosityLevel verbLevel=verbLevel_default) const
Print the object with some verbosity level to a FancyOStream.
Definition
Teuchos_Describable.cpp:32
Teuchos::Describable::~Describable
virtual ~Describable()
Destructor (marked virtual for memory safety of derived classes).
Definition
Teuchos_Describable.cpp:48
Teuchos::Describable::description
virtual std::string description() const
Return a simple one-line description of this object.
Definition
Teuchos_Describable.cpp:20
Teuchos::LabeledObject::getObjectLabel
virtual std::string getObjectLabel() const
Get the object label (see LabeledObject).
Definition
Teuchos_LabeledObject.cpp:31
Teuchos::RCP
Smart reference counting pointer class for automatic garbage collection.
Definition
Teuchos_RCPDecl.hpp:397
Teuchos::RCP::rcpFromRef
RCP< T > rcpFromRef(T &r)
Return a non-owning weak RCP object from a raw object reference for a defined type.
Teuchos::basic_FancyOStream::tab
RCP< basic_FancyOStream< CharT, Traits > > tab(const RCP< basic_FancyOStream< CharT, Traits > > &out, const int tabs=1, const std::basic_string< CharT, Traits > linePrefix="")
Create a tab for an RCP-wrapped basic_FancyOStream object to cause the indentation of all output auto...
Definition
Teuchos_FancyOStream.hpp:759
Teuchos::basic_FancyOStream::getFancyOStream
RCP< basic_FancyOStream< char > > getFancyOStream(const RCP< std::basic_ostream< char > > &out)
Get a FancyOStream from an std::ostream object.
Definition
Teuchos_FancyOStream.hpp:597
Teuchos::typeName
std::string typeName(const T &t)
Template function for returning the concrete type name of a passed-in object.
Definition
Teuchos_TypeNameTraits.hpp:83
Teuchos::FancyOStream
basic_FancyOStream< char > FancyOStream
Definition
Teuchos_FancyOStream.hpp:813
Teuchos::OSTab
basic_OSTab< char > OSTab
Definition
Teuchos_FancyOStream.hpp:819
Teuchos::EVerbosityLevel
EVerbosityLevel
Verbosity level.
Definition
Teuchos_VerbosityLevel.hpp:31
Teuchos::VERB_DEFAULT
@ VERB_DEFAULT
Generate output as defined by the object.
Definition
Teuchos_VerbosityLevel.hpp:32
Teuchos
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
Generated by
1.17.0