DP3
ProgressMeter.h
Go to the documentation of this file.
1 // ProgressMeter.h: Visual indication of a tasks progress.
2 // Copyright (C) 2020 ASTRON (Netherlands Institute for Radio Astronomy)
3 // SPDX-License-Identifier: GPL-3.0-or-later
4 
5 #ifndef LOFAR_COMMON_PROGRESSMETER_H
6 #define LOFAR_COMMON_PROGRESSMETER_H
7 
8 #include <string>
9 
10 namespace dp3 {
11 namespace base {
12 
14 
42 
44  public:
48 
67  ProgressMeter(double min, double max, const std::string& title,
68  const std::string& subtitle, const std::string& minlabel,
69  const std::string& maxlabel, bool estimateTime = true,
70  int updateEvery = 1);
71 
77 
78  void update(double value, bool force = false);
79 
82  double min() const { return min_p; }
83  double max() const { return max_p; }
85 
86  friend class ObjectController;
87 
88  private:
89  int id_p;
90  double min_p, max_p;
91  int update_every_p, update_count_p;
92 
95  static int (*creation_function_p)(double, double, const std::string&,
96  const std::string&, const std::string&,
97  const std::string&, bool);
98  static void (*update_function_p)(int, double);
99 
102  ProgressMeter& operator=(const ProgressMeter&);
103 };
104 
105 } // namespace base
106 } // namespace dp3
107 
108 #endif
Visual indication of a tasks progress.
Definition: ProgressMeter.h:43
void update(double value, bool force=false)
friend class ObjectController
Definition: ProgressMeter.h:86
double max() const
Definition: ProgressMeter.h:83
ProgressMeter(double min, double max, const std::string &title, const std::string &subtitle, const std::string &minlabel, const std::string &maxlabel, bool estimateTime=true, int updateEvery=1)
double min() const
Definition: ProgressMeter.h:82
This file has generic helper routines for testing steps.
Definition: AntennaConfig.h:53