Teuchos - Trilinos Tools Package Version of the Day
Public Member Functions
Teuchos::CommandLineProcessor::TimeMonitorSurrogate Class Reference

Interface by which CommandLineProcessor may use TimeMonitor. More...

#include <Teuchos_CommandLineProcessor.hpp>

Inheritance diagram for Teuchos::CommandLineProcessor::TimeMonitorSurrogate:

List of all members.

Public Member Functions

virtual ~TimeMonitorSurrogate ()
 ! brief.
virtual void summarize (std::ostream &out=std::cout)=0
 Summarize timings over all process(es) to the given output stream.

Detailed Description

Interface by which CommandLineProcessor may use TimeMonitor.

Users should not use this class or rely on it in any way. It is an implementation detail.


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.

Note to Teuchos developers

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.

Definition at line 634 of file Teuchos_CommandLineProcessor.hpp.

Constructor & Destructor Documentation

virtual Teuchos::CommandLineProcessor::TimeMonitorSurrogate::~TimeMonitorSurrogate ( ) [inline, virtual]

! brief.

Definition at line 637 of file Teuchos_CommandLineProcessor.hpp.

Member Function Documentation

virtual void Teuchos::CommandLineProcessor::TimeMonitorSurrogate::summarize ( std::ostream &  out = std::cout) [pure virtual]

Summarize timings over all process(es) to the given output stream.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines