Teuchos - Trilinos Tools Package Version of the Day
|! brief. |
|virtual void||summarize (std::ostream &out=std::cout)=0|
|Summarize timings over all process(es) to the given output stream. |
This class provides an interface by which CommandLineProcessor may optionally call TimeMonitor::summarize(), without needing to know that the TimeMonitor class exists. This allows Teuchos to put CommandLineProcessor in a separate package from TimeMonitor. We want to do this because TimeMonitor depends on Comm, and is therefore in the TeuchosComm subpackage, but CommandLineProcessor does not depend on Comm, and is therefore in a different subpackage. This design lets CommandLineProcessor automatically support showing summary timings just by having the TeuchosComm subpackage enabled and having its libaries linked in.
The TimeMonitorSurrogateImplInserter class in the TeuchosComm subpackage will ensure that CommandLineProcessor gets informed about TimeMonitor even before the program starts executing main(). This happens automatically; you don't need to change the main() function.
This is an instance of the Dependency injection design pattern. CommandLineProcessor is not supposed to know about TimeMonitor, because CommandLineProcessor's subpackage does not depend on TimeMonitor's subpackage. Thus, CommandLineProcessor interacts with TimeMonitor through the TimeMonitorSurrogate interface.
|virtual void Teuchos::CommandLineProcessor::TimeMonitorSurrogate::summarize||(||std::ostream &||out = ||)||
Summarize timings over all process(es) to the given output stream.