xtd 0.2.0
cancellation_token_source.h
Go to the documentation of this file.
1 #pragma once
5 #include "cancellation_token.h"
6 #include "../core_export.h"
7 #include "../object.h"
8 #include "../types.h"
9 
11 namespace xtd {
13  namespace threading {
36  class core_export_ cancellation_token_source : public object {
37  struct data;
38  public:
40 
42  cancellation_token_source(int32 milliseconds_delay);
45 
49  cancellation_token_source& operator=(const cancellation_token_source& cancellation_token_source);
50  ~cancellation_token_source();
52 
54 
56  bool is_cancellation_requested() const noexcept;
57 
58  const cancellation_token& token() const noexcept;
60 
62 
65 
66  private:
67  bool can_be_canceled() const noexcept;
69 
70  friend class cancellation_token;
71  std::shared_ptr<data> data_;
72  };
73  }
74 }
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Contains xtd::threading::cancellation_token class.
Signals to a xtd::threading::cancellation_token that it should be canceled.
Definition: cancellation_token_source.h:36
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes...
Definition: object.h:32
Represents a time interval.
Definition: time_span.h:26
int_least32_t int32
Represents a 32-bit signed integer.
Definition: types.h:129
Propagates notification that operations should be canceled.
Definition: cancellation_token.h:37
Encapsulates operating system specific objects that wait for exclusive access to shared resources...
Definition: wait_handle.h:48