Tapkee
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
context.hpp
Go to the documentation of this file.
1
/* This software is distributed under BSD 3-clause license (see LICENSE file).
2
*
3
* Copyright (c) 2012-2013 Sergey Lisitsyn, Fernando Iglesias
4
*/
5
6
#ifndef TAPKEE_CONTEXT_H_
7
#define TAPKEE_CONTEXT_H_
8
9
namespace
tapkee
10
{
12
namespace
tapkee_internal
13
{
14
15
class
Context
16
{
17
public
:
18
19
Context
(
void
(*progress)(
double
),
bool
(*cancel)()) :
20
progress_function
(progress),
cancel_function
(cancel)
21
{
22
}
23
24
inline
void
report_progress
(
double
x)
const
25
{
26
if
(
progress_function
)
27
progress_function
(x);
28
}
29
30
inline
bool
is_cancelled
()
const
31
{
32
if
(
cancel_function
)
33
return
cancel_function
();
34
return
false
;
35
}
36
37
private
:
38
void (*
progress_function
)(double);
39
bool (*
cancel_function
)();
40
};
41
42
}
43
}
44
45
#endif
tapkee::tapkee_internal::Context::report_progress
void report_progress(double x) const
Definition:
context.hpp:24
tapkee::tapkee_internal::Context::is_cancelled
bool is_cancelled() const
Definition:
context.hpp:30
tapkee::tapkee_internal::Context::cancel_function
bool(* cancel_function)()
Definition:
context.hpp:39
tapkee::tapkee_internal::Context::progress_function
void(* progress_function)(double)
Definition:
context.hpp:38
tapkee::tapkee_internal::Context
Definition:
context.hpp:15
tapkee::tapkee_internal::Context::Context
Context(void(*progress)(double), bool(*cancel)())
Definition:
context.hpp:19
include
tapkee
parameters
context.hpp
Generated by
1.8.5