55 out <<
"\nEntering someDumbFunction(...)\n";
57 out << std::endl << indentSpacer <<
"I am \"dumb\" code that knows nothing of FancyOStream and does indenting manually! ...\n";
59 out <<
"\nLeaving someDumbFunction(...)\n";
72 out = Teuchos::getFancyOStream(
Teuchos::rcp(&out_arg,
false));
74 OSTab tab(out,1,
"LDUMBALGO");
75 *out <<
"\nEntering someLessDumbFunction(...)\n";
78 << std::endl <<
"I am less \"dumb\" code that knows about FancyOStream but my interface does not support it directly! ...\n";
80 << std::endl <<
"Another print from this less \"dumb\" code ...\n";
82 *out <<
"\nLeaving someLessDumbFunction(...)\n";
88const std::string AlgoType_name =
"Algo Type";
89const std::string AlgoType_default =
"Bob";
91const std::string AlgoTol_name =
"Algo Tol";
92const double AlgoTol_default = 1e-5;
110 : algoType_(ALGO_BOB), algoTol_(AlgoTol_default)
140 Teuchos::readVerboseObjectSublist(&*
paramList_,
this);
174 using Teuchos::setStringToIntegralParameter;
175 using Teuchos::tuple;
176 static RCP<const ParameterList> validParams;
177 if (is_null(validParams)) {
180 setStringToIntegralParameter<EAlgoType>(
181 AlgoType_name, AlgoType_default,
182 "The algorithm type to use",
183 tuple<std::string>(
"Bob",
"John",
"Harry"),
187 Teuchos::setDoubleParameter(
188 AlgoTol_name, AlgoTol_default,
189 "The tolerance for the algorithm.",
192 Teuchos::setupVerboseObjectSublist(&*pl);
212 *out <<
"\nEntering AlgorithmA::doAlgorithm() with verbLevel="<<
Teuchos::toString(verbLevel)<<
"\n";
220 <<
"\nI am \"smart\" code that knows about FancyOStream and OSTab ...\n"
222 <<
"\nUsing tolerance of " <<
algoTol_ <<
"\n";
225 OSTab tab2 = this->
getOSTab(OSTab::DISABLE_TABBING);
227 *out <<
"\n***\n*** Warning, I am doing something very dangerous so watch out!!!\n***\n";
230 *out <<
"\nHere I am doing some more stuff and printing with indenting turned back on!\n";
238 OSTab tab2 = this->
getOSTab(1,
"DUMBALGO");
253 *out <<
"\nLeaving AlgorithmA::doAlgorithm()\n";
void someLessDumbFunction(std::ostream &out_arg)
void someDumbFunction(std::ostream &out, const std::string &indentSpacer)
void someLessDumbFunction(std::ostream &out_arg)
void someDumbFunction(std::ostream &out, const std::string &indentSpacer)
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Return a ParameterList containing all of the valid parameters that this->setParameterList(....
void setParameterList(Teuchos::RCP< Teuchos::ParameterList > const ¶mList)
Set parameters from a parameter list and return with default values.
Teuchos::RCP< Teuchos::ParameterList > paramList_
static const std::string toString(AlgorithmA::EAlgoType algoType)
Teuchos::RCP< Teuchos::ParameterList > unsetParameterList()
Unset the parameter list that was set using setParameterList().
Teuchos::RCP< const Teuchos::ParameterList > getParameterList() const
Get const version of the parameter list that was set using setParameterList().
Teuchos::RCP< Teuchos::ParameterList > getNonconstParameterList()
Get a nonconst version of the parameter list that was set using setParameterList().
A list of parameters of arbitrary type.
void validateParameters(ParameterList const &validParamList, int const depth=1000, EValidateUsed const validateUsed=VALIDATE_USED_ENABLED, EValidateDefaults const validateDefaults=VALIDATE_DEFAULTS_ENABLED) const
Validate the parameters in this list given valid selections in the input list.
Smart reference counting pointer class for automatic garbage collection.
T * get() const
Get the raw C++ pointer to the underlying object.
virtual RCP< FancyOStream > getOStream() const
Return the output stream to be used for out for *this object.
virtual OSTab getOSTab(const int tabs=1, const std::string &linePrefix="") const
Create a tab object which sets the number of tabs and optionally the line prefix.
virtual VerboseObjectBase & setLinePrefix(const std::string &linePrefix)
Set line prefix name for this object.
virtual EVerbosityLevel getVerbLevel() const
Get the verbosity level.
Tabbing class for helping to create formated, indented output for a basic_FancyOStream object.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
This macro is designed to be a short version of TEUCHOS_TEST_FOR_EXCEPTION() that is easier to call.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.
basic_OSTab< char > OSTab
std::string toString(const HashSet< Key > &h)
EVerbosityLevel
Verbosity level.
@ VERB_LOW
Generate only a minimal amount of output.