OOPS
oops/base/PostTimer.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2009-2016 ECMWF.
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  * In applying this licence, ECMWF does not waive the privileges and immunities
7  * granted to it by virtue of its status as an intergovernmental organisation nor
8  * does it submit to any jurisdiction.
9  */
10 
11 #ifndef OOPS_BASE_POSTTIMER_H_
12 #define OOPS_BASE_POSTTIMER_H_
13 
14 #include <memory>
15 #include <vector>
16 
17 #include <boost/noncopyable.hpp>
18 
19 #include "eckit/config/LocalConfiguration.h"
21 #include "oops/util/DateTime.h"
22 #include "oops/util/Duration.h"
23 
24 namespace oops {
25 
26 // -----------------------------------------------------------------------------
27 
28 /// Handles timing of post-processing and similar actions
29 /*!
30  * By default processing is performed on every call.
31  */
32 
33 class PostTimer : private boost::noncopyable {
34  public:
35  PostTimer();
36  explicit PostTimer(const eckit::Configuration &);
37  PostTimer(const util::DateTime &, const util::DateTime &, const util::Duration &);
38 
39  void initialize(const util::DateTime &, const util::DateTime &);
40  bool itIsTime(const util::DateTime &);
41 
42  private:
44  util::DateTime bgn_;
45  util::DateTime end_;
46  std::unique_ptr<util::DateTime> start_;
47  std::unique_ptr<util::DateTime> finish_;
48  std::vector<util::DateTime> pptimes_;
49 };
50 
51 // -----------------------------------------------------------------------------
52 
53 } // namespace oops
54 
55 #endif // OOPS_BASE_POSTTIMER_H_
oops::PostTimer::pptimes_
std::vector< util::DateTime > pptimes_
Definition: oops/base/PostTimer.h:48
oops
The namespace for the main oops code.
Definition: ErrorCovarianceL95.cc:22
oops::PostTimer::bgn_
util::DateTime bgn_
Definition: oops/base/PostTimer.h:44
oops::PostTimer::finish_
std::unique_ptr< util::DateTime > finish_
Definition: oops/base/PostTimer.h:47
oops::PostTimer
Handles timing of post-processing and similar actions.
Definition: oops/base/PostTimer.h:33
oops::PostTimerParameters
Options controlling PostTimer.
Definition: PostTimerParameters.h:24
oops::PostTimer::options_
PostTimerParameters options_
Definition: oops/base/PostTimer.h:43
oops::PostTimer::end_
util::DateTime end_
Definition: oops/base/PostTimer.h:45
PostTimerParameters.h
oops::PostTimer::start_
std::unique_ptr< util::DateTime > start_
Definition: oops/base/PostTimer.h:46
oops::PostTimer::PostTimer
PostTimer()
Definition: oops/base/PostTimer.cc:26
oops::PostTimer::itIsTime
bool itIsTime(const util::DateTime &)
Definition: oops/base/PostTimer.cc:61
oops::PostTimer::initialize
void initialize(const util::DateTime &, const util::DateTime &)
Definition: oops/base/PostTimer.cc:44