File: progress_bar.hpp

package info (click to toggle)
r-cran-rcppprogress 0.4.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 216 kB
  • sloc: cpp: 490; sh: 13; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 655 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 * progress_bar.hpp
 *
 * An abstract class for classes that display a progress bar
 *
 * Author: karl.forner@gmail.com
 *
 */
#ifndef _RcppProgress_PROGRESS_BAR_HPP
#define _RcppProgress_PROGRESS_BAR_HPP

class ProgressBar {
  public:

    // subclasses should not rely on the destructor to finalize the display
    virtual ~ProgressBar() = 0;

    // start the display. It will be updated by subsequent calls to update()
    virtual void display() = 0;

    // update if needed the display
    virtual void update(float progress) = 0;

    // finalize the display
    virtual void end_display() = 0;
};

inline ProgressBar::~ProgressBar() {}

#endif