Tapkee
 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  {
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
void report_progress(double x) const
Definition: context.hpp:24
void(* progress_function)(double)
Definition: context.hpp:38
Context(void(*progress)(double), bool(*cancel)())
Definition: context.hpp:19