cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
solver_progress.cpp
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: Solver Progress Reporting
4
5
Author: Daniel Kroening, dkr@amazon.com
6
7
\*******************************************************************/
8
11
12
#include "
solver_progress.h
"
13
14
#include <
util/console.h
>
15
16
#include <iostream>
17
18
void
solver_progresst::operator()
(
size_t
current)
19
{
20
if
(
verbose
)
21
{
22
if
(current != 0)
23
std::cout <<
'\n'
;
24
std::cout <<
consolet::orange
<<
"Processing property "
<< (current + 1)
25
<<
'/'
<<
total
<<
consolet::reset
<<
'\n'
;
26
}
27
else
28
{
29
if
(
first
)
30
{
31
first
=
false
;
32
}
33
else
34
{
35
if
(
consolet::is_terminal
())
36
{
37
// up one row and clear the line
38
std::cout <<
consolet::cursorup
<<
consolet::cleareol
;
39
}
40
}
41
42
std::cout <<
consolet::orange
<<
"Processing property "
<< (current + 1)
43
<<
'/'
<<
total
<<
consolet::reset
<<
'\n'
;
44
}
45
}
46
47
void
solver_progresst::finished
()
48
{
49
if
(
verbose
)
50
{
51
std::cout <<
'\n'
;
52
}
53
else
54
{
55
if
(
consolet::is_terminal
())
56
{
57
if
(!
first
)
58
{
59
// up one row and clear the line
60
std::cout <<
consolet::cursorup
<<
consolet::cleareol
;
61
}
62
}
63
}
64
}
consolet::cursorup
static std::ostream & cursorup(std::ostream &)
Definition
console.cpp:184
consolet::reset
static std::ostream & reset(std::ostream &)
Definition
console.cpp:176
consolet::is_terminal
static bool is_terminal()
Definition
console.h:43
consolet::orange
static std::ostream & orange(std::ostream &)
Definition
console.cpp:144
consolet::cleareol
static std::ostream & cleareol(std::ostream &)
Definition
console.cpp:190
solver_progresst::operator()
void operator()(std::size_t current)
Definition
solver_progress.cpp:18
solver_progresst::total
std::size_t total
Definition
solver_progress.h:30
solver_progresst::finished
void finished()
Definition
solver_progress.cpp:47
solver_progresst::first
bool first
Definition
solver_progress.h:29
solver_progresst::verbose
bool verbose
Definition
solver_progress.h:31
console.h
Console.
solver_progress.h
Solver Progress Reporting.
cprover
solver_progress.cpp
Generated by
1.17.0