Teuchos - Trilinos Tools Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
Teuchos::CommandLineProcessor::TimeMonitorSurrogate Class Referenceabstract

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

#include <Teuchos_CommandLineProcessor.hpp>

Inheritance diagram for Teuchos::CommandLineProcessor::TimeMonitorSurrogate:
Teuchos::TimeMonitorSurrogateImpl

Public Member Functions

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

Detailed Description

Interface by which CommandLineProcessor may use TimeMonitor.

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

Summary

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 ( )
inlinevirtual

! 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: