Artec 3D Scanning SDK  2.0
ICancellationTokenSource.h
Go to the documentation of this file.
1 /********************************************************************
2 *
3 * Project Artec 3D Scanning SDK
4 *
5 * Purpose: Create cancellation token
6 *
7 * Copyright: Artec Group
8 *
9 ********************************************************************/
10 
11 #ifndef _ICANCELLATIONTOKENSOURCE_H_
12 #define _ICANCELLATIONTOKENSOURCE_H_
13 
15 #include <artec/sdk/base/Errors.h>
16 #include <artec/sdk/base/IRef.h>
18 
19 namespace artec { namespace sdk { namespace base
20 {
21 
22 class ICancellationTokenSource;
23 
24 extern "C"
25 {
26 
28  createCancellationTokenSource(ICancellationTokenSource** pCancellationTokenSource);
29 
30 }
31 
32 /**
33 * ICancellationTokenSource is an interface to handle \ref ICancellationToken
34 */
36 {
37 public:
38 
39 
40  /** Set cancellation signal. isCancellationRequested() will return "true".
41  */
42  virtual void cancel() = 0;
43 
44 
45  /** Return ICancellationToken interface
46  *
47  * @return
48  * pointer to ICancellationToken
49  */
50  virtual ICancellationToken* getToken() = 0;
51 };
52 
53 
54 } } } // namespace artec::sdk::base
55 
56 #endif // _ICANCELLATIONTOKENSOURCE_H_
virtual ICancellationToken * getToken()=0
Return ICancellationToken interface.
ICancellationTokenSource is an interface to handle ICancellationToken.
Callback interface to notify process about cancellation.
ErrorCode ABASESDK_LINK_SPEC createCancellationTokenSource(ICancellationTokenSource **pCancellationTokenSource)
virtual void cancel()=0
Set cancellation signal.
#define ABASESDK_LINK_SPEC
Interface that implements reference counting and life-time management.
Definition: IRef.h:22