|
OpenZGY/C++ API and Internals (ALPHA)
Access seismic data stored in ZGY format.
|
Simple progress bar. More...
#include <api.h>
Public Member Functions | |
| ProgressWithDots (int length=51, std::ostream &outfile=std::cerr) | |
| Simple progress bar. More... | |
| bool | operator() (std::int64_t done, std::int64_t total) |
| Callback invoked to report progress. More... | |
Simple progress bar.
Progress bar that writes dots (51 by default) to standard output. This can be user as-is for simple command line apps, or you can use the source code as an example on how to write your own.
The default of 51 dots will print one dot at startup and then one additional dot for each 2% work done.
If you are using this to write to the cloud a file that is smaller than ~10 GB then the progress bar will probably move in larger jumps. Because writing to a cloud back-end uses very large buffers. Most cloud back-ends cannot report progress inside a "write block".
When passing a progress reporter to a function, make sure you do not pass the class itself. You need to create an instance of it.
| OpenZGY::ProgressWithDots::ProgressWithDots | ( | int | length = 51, |
| std::ostream & | outfile = std::cerr |
||
| ) |
Simple progress bar.
| length | Size of progress bar, default 51 dots. |
| outfile | Stream to write output, default std::cerr |
Progress bar that writes dots (51 by default) to standard output. This can be user as-is for simple command line apps, or you can use the source code as an example on how to write your own.
The default of 51 dots will print one dot at startup and then one additional dot for each 2% work done.
If you are using this to write to the cloud a file that is smaller than ~10 GB then the progress bar will probably move in larger jumps. Because writing to a cloud back-end uses very large buffers. Most cloud back-ends cannot report progress inside a "write block".
When passing a progress reporter to a function, make sure you do not pass the class itself. You need to create an instance of it.
| bool OpenZGY::ProgressWithDots::operator() | ( | std::int64_t | done, |
| std::int64_t | total | ||
| ) |
Callback invoked to report progress.
| done | Number of work units done. |
| total | Number of work units in total. |
The callback will normally get called exactly once with done==0, before processing starts but after "total" is known. And exactly once with done==total signifying that the work is finished and the function being monitored should soon return.
This particular callback will always return true, meaning that the operation is not to be aborted.
1.8.17