forked from jancarlsson/snarklib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgressCallback.hpp
44 lines (32 loc) · 1002 Bytes
/
ProgressCallback.hpp
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef _SNARKLIB_PROGRESS_CALLBACK_HPP_
#define _SNARKLIB_PROGRESS_CALLBACK_HPP_
#include <cstdint>
namespace snarklib {
////////////////////////////////////////////////////////////////////////////////
// progress callback
//
class ProgressCallback
{
public:
virtual ~ProgressCallback() = default;
// number of major callback from PPZK keypair, proof, verify
virtual void majorSteps(const std::size_t numberSteps) = 0;
// callback from PPZK keypair, proof, verify
virtual void major(const bool newLine = false) = 0;
// number of minor callbacks expected
virtual std::size_t minorSteps() = 0;
// callback inside function called from PPZK
virtual void minor() = 0;
};
// no operation callback
template <typename T>
class ProgressCallback_NOP : public ProgressCallback
{
public:
void majorSteps(const std::size_t) {}
void major(const bool newLine) {}
std::size_t minorSteps() { return 0; }
void minor() {}
};
} // namespace snarklib
#endif