Teuchos - Trilinos Tools Package Version of the Day
Loading...
Searching...
No Matches
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"
12
13
14namespace Teuchos {
15
16
18
19
20std::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
31void
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
40void
41Describable::describe (std::ostream& out,
42 const EVerbosityLevel verbLevel) const
43{
44 RCP<FancyOStream> fancyOut = getFancyOStream (rcpFromRef (out));
45 this->describe (*fancyOut, verbLevel);
46}
47
49
50} // namespace Teuchos
Defines basic traits returning the name of a type in a portable and readable way.
static const EVerbosityLevel verbLevel_default
Default value for the verbLevel argument of describe().
virtual void describe(FancyOStream &out, const EVerbosityLevel verbLevel=verbLevel_default) const
Print the object with some verbosity level to a FancyOStream.
virtual ~Describable()
Destructor (marked virtual for memory safety of derived classes).
virtual std::string description() const
Return a simple one-line description of this object.
virtual std::string getObjectLabel() const
Get the object label (see LabeledObject).
Smart reference counting pointer class for automatic garbage collection.
std::ostream subclass that performs the magic of indenting data sent to an std::ostream object among ...
Tabbing class for helping to create formated, indented output for a basic_FancyOStream object.
std::string typeName(const T &t)
Template function for returning the concrete type name of a passed-in object.
EVerbosityLevel
Verbosity level.
@ VERB_DEFAULT
Generate output as defined by the object.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...