本文整理汇总了C++中BaseClass::getOStream方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseClass::getOStream方法的具体用法?C++ BaseClass::getOStream怎么用?C++ BaseClass::getOStream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseClass
的用法示例。
在下文中一共展示了BaseClass::getOStream方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PrintMonitor
//! Constructor
PrintMonitor(const BaseClass& object, const std::string& msg, MsgType msgLevel = Runtime0) {
// Inherit verbosity from 'object'
SetVerbLevel(object.GetVerbLevel());
setOStream(object.getOStream());
// Print description and new indent
if (IsPrint(msgLevel)) {
GetOStream(msgLevel, 0) << msg << std::endl;
tab_ = rcp(new Teuchos::OSTab(getOStream()));
}
}
示例2: MutuallyExclusiveTimeMonitor
/*! @brief Constructor
@param[in] object Reference to the class instance that is creating this MutuallyExclusiveTimeMonitor.
@param[in] msg String that indicates what the Monitor is monitoring, e.g., "Build"
@param[in] timerLevel Governs whether timing information should be *gathered*. Setting this to NoTimeReport prevents the creation of timers.
*/
MutuallyExclusiveTimeMonitor(const BaseClass& object, const std::string& msg, MsgType timerLevel = Timings0)
{
// Inherit verbosity from 'object'
SetVerbLevel(object.GetVerbLevel());
setOStream(object.getOStream());
if (IsPrint(timerLevel) &&
/* disable timer if never printed: */ (IsPrint(RuntimeTimings) || (!IsPrint(NoTimeReport)))) {
if (!IsPrint(NoTimeReport)) {
timer_ = MutuallyExclusiveTime<TagName>::getNewTimer("MueLu: " + msg /*+ " (MutuallyExclusive)" */);
} else {
timer_ = rcp(new MutuallyExclusiveTime<TagName> ("MueLu: " + msg /*+ " (MutuallyExclusive)" */));
}
timer_->start();
timer_->incrementNumCalls();
}
}
示例3: TimeMonitor
TimeMonitor(const BaseClass& object, const std::string& msg, MsgType timerLevel = Timings0)
{
// Inherit verbosity from 'object'
SetVerbLevel(object.GetVerbLevel());
setOStream(object.getOStream());
if (IsPrint(timerLevel) &&
/* disable timer if never printed: */ (IsPrint(RuntimeTimings) || (!IsPrint(NoTimeReport)))) {
if (!IsPrint(NoTimeReport)) {
// TODO: there is no function to register a timer in Teuchos::TimeMonitor after the creation of the timer. But would be useful...
timer_ = Teuchos::TimeMonitor::getNewTimer("MueLu: " + msg);
} else {
timer_ = rcp(new Teuchos::Time("MueLu: " + msg));
}
// Start the timer (this is what is done by Teuchos::TimeMonitor)
timer_->start();
timer_->incrementNumCalls();
}
}