21 out <<
"\nEntering someDumbFunction(...)\n";
23 out << std::endl << indentSpacer <<
"I am \"dumb\" code that knows nothing of FancyOStream and does indenting manually! ...\n";
25 out <<
"\nLeaving someDumbFunction(...)\n";
38 out = Teuchos::getFancyOStream(
Teuchos::rcp(&out_arg,
false));
41 *out <<
"\nEntering someLessDumbFunction(...)\n";
44 << std::endl <<
"I am less \"dumb\" code that knows about FancyOStream but my interface does not support it directly! ...\n";
46 << std::endl <<
"Another print from this less \"dumb\" code ...\n";
48 *out <<
"\nLeaving someLessDumbFunction(...)\n";
54 const std::string AlgoType_name =
"Algo Type";
55 const std::string AlgoType_default =
"Bob";
57 const std::string AlgoTol_name =
"Algo Tol";
58 const double AlgoTol_default = 1e-5;
76 : algoType_(ALGO_BOB), algoTol_(AlgoTol_default)
106 Teuchos::readVerboseObjectSublist(&*paramList_,
this);
140 using Teuchos::setStringToIntegralParameter;
141 using Teuchos::tuple;
142 static RCP<const ParameterList> validParams;
146 setStringToIntegralParameter<EAlgoType>(
147 AlgoType_name, AlgoType_default,
148 "The algorithm type to use",
149 tuple<std::string>(
"Bob",
"John",
"Harry"),
153 Teuchos::setDoubleParameter(
154 AlgoTol_name, AlgoTol_default,
155 "The tolerance for the algorithm.",
158 Teuchos::setupVerboseObjectSublist(&*pl);
178 *out <<
"\nEntering AlgorithmA::doAlgorithm() with verbLevel="<<
Teuchos::toString(verbLevel)<<
"\n";
186 <<
"\nI am \"smart\" code that knows about FancyOStream and OSTab ...\n"
188 <<
"\nUsing tolerance of " <<
algoTol_ <<
"\n";
193 *out <<
"\n***\n*** Warning, I am doing something very dangerous so watch out!!!\n***\n";
196 *out <<
"\nHere I am doing some more stuff and printing with indenting turned back on!\n";
219 *out <<
"\nLeaving AlgorithmA::doAlgorithm()\n";
EVerbosityLevel
Verbosity level.
bool is_null(const boost::shared_ptr< T > &p)
Returns true if p.get()==NULL.
Generate only a minimal amount of output.
void setParameterList(Teuchos::RCP< Teuchos::ParameterList > const ¶mList)
Set parameters from a parameter list and return with default values.
Teuchos::RCP< Teuchos::ParameterList > unsetParameterList()
Unset the parameter list that was set using setParameterList().
T * get() const
Get the raw C++ pointer to the underlying object.
basic_OSTab< char > OSTab
const std::basic_string< char_type, traits_type > & getTabIndentStr() const
Get the tab indent string.
virtual VerboseObjectBase & setLinePrefix(const std::string &linePrefix)
Set line prefix name for this object.
void someDumbFunction(std::ostream &out, const std::string &indentSpacer)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Return a ParameterList containing all of the valid parameters that this->setParameterList(...) will accept, along with any validators.
std::string toString(const HashSet< Key > &h)
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. ...
Teuchos::RCP< const Teuchos::ParameterList > getParameterList() const
Get const version of the parameter list that was set using setParameterList().
void validateParametersAndSetDefaults(ParameterList const &validParamList, int const depth=1000)
Validate the parameters in this list given valid selections in the input list and set defaults for th...
A list of parameters of arbitrary type.
TEUCHOSCORE_LIB_DLL_EXPORT bool includesVerbLevel(const EVerbosityLevel verbLevel, const EVerbosityLevel requestedVerbLevel, const bool isDefaultLevel=false)
Return true if the verbosity level includes the given level.
static const std::string toString(AlgorithmA::EAlgoType algoType)
void someLessDumbFunction(std::ostream &out_arg)
Smart reference counting pointer class for automatic garbage collection.
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...
Teuchos::RCP< Teuchos::ParameterList > paramList_
virtual EVerbosityLevel getVerbLevel() const
Get the verbosity level.
virtual RCP< FancyOStream > getOStream() const
Return the output stream to be used for out for *this object.
Teuchos::RCP< Teuchos::ParameterList > getNonconstParameterList()
Get a nonconst version of the parameter list that was set using setParameterList().
#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...