task_options 类(并发运行时)

表示可用于创建任务的选项

语法

class task_options;

成员

公共构造函数

名称 描述
task_options::task_options 构造函数(并发运行时) 已重载。 任务创建选项的默认列表

公共方法

名称 描述
task_options::get_cancellation_token 方法(并发运行时) 返回取消标记
task_options::get_continuation_context 方法(并发运行时) 返回持续上下文
task_options::get_scheduler 方法(并发运行时) 返回计划程序
task_options::has_cancellation_token 方法(并发运行时) 指示用户是否指定了取消标记
task_options::has_scheduler 方法(并发运行时) 指示用户是否指定了计划程序
task_options::set_cancellation_token 方法(并发运行时) 在选项中设置给定的标记
task_options::set_continuation_context 方法(并发运行时) 在选项中设置给定的持续上下文

继承层次结构

task_options

要求

标头:ppltasks.h

命名空间: 并发

task_options::get_cancellation_token 方法(并发运行时)

返回取消标记

cancellation_token get_cancellation_token() const;

返回值

task_options::get_continuation_context 方法(并发运行时)

返回持续上下文

task_continuation_context get_continuation_context() const;

返回值

task_options::get_scheduler 方法(并发运行时)

返回计划程序

scheduler_ptr get_scheduler() const;

返回值

task_options::has_cancellation_token 方法(并发运行时)

指示用户是否指定了取消标记

bool has_cancellation_token() const;

返回值

task_options::has_scheduler 方法(并发运行时)

指示用户是否指定了计划程序

bool has_scheduler() const;

返回值

task_options::set_cancellation_token 方法(并发运行时)

在选项中设置给定的标记

void set_cancellation_token(cancellation_token _Token);

参数

_Token

task_options::set_continuation_context 方法(并发运行时)

在选项中设置给定的持续上下文

void set_continuation_context(task_continuation_context _ContinuationContext);

参数

_ContinuationContext

task_options::task_options 构造函数(并发运行时)

任务创建选项的默认列表

task_options();

task_options(
    cancellation_token _Token);

task_options(
    task_continuation_context _ContinuationContext);

task_options(
    cancellation_token _Token,
    task_continuation_context _ContinuationContext);

template<typename _SchedType>
task_options(
    std::shared_ptr<_SchedType> _Scheduler);

task_options(
    scheduler_interface& _Scheduler);

task_options(
    scheduler_ptr _Scheduler);

task_options(
    const task_options& _TaskOptions);

参数

_SchedType

_Token

_ContinuationContext

_Scheduler

_TaskOptions

另请参阅

并发命名空间