/***
* Copyright (C) Microsoft. All rights reserved.
* Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
*
* =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
*
* Parallel Patterns Library - PPLx Tasks
*
* For the latest on this and related APIs, please see: https://github.com/Microsoft/cpprestsdk
*
* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
****/
#pragma once
#ifndef PPLXTASKS_H
#define PPLXTASKS_H
#include "cpprest/details/cpprest_compat.h"
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) && !CPPREST_FORCE_PPLX
#include <ppltasks.h>
namespace pplx = Concurrency;
namespace Concurrency
{
/// <summary>
/// Sets the ambient scheduler to be used by the PPL constructs.
/// </summary>
_ASYNCRTIMP void __cdecl set_cpprestsdk_ambient_scheduler(const std::shared_ptr<scheduler_interface>& _Scheduler);
/// <summary>
/// Gets the ambient scheduler to be used by the PPL constructs
/// </summary>
_ASYNCRTIMP const std::shared_ptr<scheduler_interface>& __cdecl get_cpprestsdk_ambient_scheduler();
} // namespace Concurrency
#if (_MSC_VER >= 1900)
#include <concrt.h>
namespace Concurrency {
namespace extensibility {
typedef ::std::condition_variable condition_variable_t;
typedef ::std::mutex critical_section_t;
typedef ::std::unique_lock< ::std::mutex> scoped_critical_section_t;
typedef ::Concurrency::event event_t;
typedef ::Concurrency::reader_writer_lock reader_writer_lock_t;
typedef ::Concurrency::reader_writer_lock::scoped_lock scoped_rw_lock_t;
typedef ::Concurrency::reader_writer_lock::scoped_lock_read scoped_read_lock_t;
typedef ::Concurrency::details::_ReentrantBlockingLock recursive_lock_t;
typedef recursive_lock_t::_Scoped_lock scoped_recursive_lock_t;
}
}
#endif // _MSC_VER >= 1900
#else
#include "pplx/pplx.h"
#if defined(__ANDROID__)
#include <jni.h>
void cpprest_init(JavaVM*);
#endif
// Cannot build using a compiler that is older than dev10 SP1
#if defined(_MSC_VER)
#if _MSC_FULL_VER < 160040219 /*IFSTRIP=IGN*/
#error ERROR: Visual Studio 2010 SP1 or later is required to build ppltasks
#endif /*IFSTRIP=IGN*/
#endif /* defined(_MSC_VER) */
#include <functional>
#include <vector>
#include <utility>
#include <exception>
#include <algorithm>
#include <atomic>
#if defined(_MSC_VER)
#include <intrin.h>
#if defined(__cplusplus_winrt)
#include <windows.h>
#include <ctxtcall.h>
#include <agile.h>
#include <winapifamily.h>
#ifndef _UITHREADCTXT_SUPPORT
#ifdef WINAPI_FAMILY /*IFSTRIP=IGN*/
// It is safe to include winapifamily as WINAPI_FAMILY was defined by the user
#include <winapifamily.h>
#if WINAPI_FAMILY == WINAPI_FAMILY_APP
// UI thread context support is not required for desktop and Windows Store apps
#define _UITHREADCTXT_SUPPORT 0
#elif WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP
// UI thread context support is not required for desktop and Windows Store apps
#define _UITHREADCTXT_SUPPORT 0
#else /* WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP */
#define _UITHREADCTXT_SUPPORT 1
#endif /* WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP */
#else /* WINAPI_FAMILY */
// Not supported without a WINAPI_FAMILY setting.
#define _UITHREADCTXT_SUPPORT 0
#endif /* WINAPI_FAMILY */
#endif /* _UITHREADCTXT_SUPPORT */
#if _UITHREADCTXT_SUPPORT
#include <uithreadctxt.h>
#endif /* _UITHREADCTXT_SUPPORT */
#pragma detect_mismatch("PPLXTASKS_WITH_WINRT", "1")
#else /* defined(__cplusplus_winrt) */
#pragma detect_mismatch("PPLXTASKS_WITH_WINRT", "0")
#endif /* defined(__cplusplus_winrt) */
#endif /* defined(_MSC_VER) */
#ifdef _DEBUG
#define _DBG_ONLY(X) X
#else
#define _DBG_ONLY(X)
#endif // #ifdef _DEBUG
// std::copy_exception changed to std::make_exception_ptr from VS 2010 to VS 11.
#ifdef _MSC_VER
#if _MSC_VER < 1700 /*IFSTRIP=IGN*/
namespace std
{
template<class _E> exception_ptr make_exception_ptr(_E _Except)
{
return copy_exception(_Except);
}
}
#endif /* _MSC_VER < 1700 */
#ifndef PPLX_TASK_ASYNC_LOGGING
#if _MSC_VER >= 1800 && defined(__cplusplus_winrt)
#define PPLX_TASK_ASYNC_LOGGING 1 // Only enable async logging under dev12 winrt
#else
#define PPLX_TASK_ASYNC_LOGGING 0
#endif
#endif /* !PPLX_TASK_ASYNC_LOGGING */
#endif /* _MSC_VER */
#pragma pack(push,_CRT_PACKING)
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable: 28197)
#pragma warning(disable: 4100) // Unreferenced formal parameter - needed for document generation
#pragma warning(disable: 4127) // constant express in if condition - we use it for meta programming
#endif /* defined(_MSC_VER) */
// All CRT public header files are required to be protected from the macro new
#pragma push_macro("new")
#undef new
// stuff ported from Dev11 CRT
// NOTE: this doesn't actually match std::declval. it behaves differently for void!
// so don't blindly change it to std::declval.
namespace stdx
{
template<class _T>
_T&& declval();
}
/// <summary>
/// The <c>pplx</c> namespace provides classes and functions that give you access to the Concurrency Runtime,
/// a concurrent programming framework for C++. For more information, see <see cref="Concurrency Runtime"/>.
/// </summary>
/**/
namespace pplx
{
/// <summary>
/// A type that represents the terminal state of a task. Valid values are <c>completed</c> and <c>canceled</c>.
/// </summary>
/// <seealso cref="task Class"/>
/**/
typedef task_group_status task_status;
template <typename _Type> class task;
template <> class task<void>;
// In debug builds, default to 10 frames, unless this is overridden prior to #includ'ing ppltasks.h. In retail builds, default to only one frame.
#ifndef PPLX_TASK_SAVE_FRAME_COUNT
#ifdef _DEBUG
#define PPLX_TASK_SAVE_FRAME_COUNT 10
#else
#define PPLX_TASK_SAVE_FRAME_COUNT 1
#endif
#endif
/// <summary>
/// Helper macro to determine how many stack frames need to be saved. When any number less or equal to 1 is specified,
/// only one frame is captured and no stackwalk will be involved. Otherwise, the number of callstack frames will be captured.
/// </summary>
/// <ramarks>
/// This needs to be defined as a macro rather than a function so that if we're only gathering one frame, _ReturnAddress()
/// will evaluate to client code, rather than a helper function inside of _TaskCreationCallstack, itself.
/// </remarks>
#if PPLX_TASK_SAVE_FRAME_COUNT > 1
#if defined(__cplusplus_winrt) && !defined(_DEBUG)
#pragma message ("WARNING: Redefining PPLX_TASK_SAVE_FRAME_COUNT under Release build for non-desktop applications is not supported; only one frame will be captured!")
#define PPLX_CAPTURE_CALLSTACK() ::pplx::details::_TaskCreationCallstack::_CaptureSingleFrameCallstack(_ReturnAddress())
#else
#define PPLX_CAPTURE_CALLSTACK() ::pplx::details::_TaskCreationCallstack::_CaptureMultiFramesCallstack(PPLX_TASK_SAVE_FRAME_COUNT)
#endif
#else
#define PPLX_CAPTURE_CALLSTACK() ::pplx::details::_TaskCreationCallstack::_CaptureSingleFrameCallstack(_ReturnAddress())
#endif
/// <summary>
/// Returns an indication of whether the task that is currently executing has received a request to cancel its
/// execution. Cancellation is requested on a task if the task was created with a cancellation token, and
/// the token source associated with that token is canceled.
/// </summary>
/// <returns>
/// <c>true</c> if the currently executing task has received a request for cancellation, <c>false</c> otherwise.
/// </returns>
/// <remarks>
/// If you call this method in the body of a task and it returns <c>true</c>, you
没有合适的资源?快使用搜索试试~ 我知道了~
微软开源网络库:c++REST SDK 编译包
共2000个文件
hpp:5198个
h:263个
ipp:70个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 9 下载量 157 浏览量
2022-11-04
17:28:58
上传
评论
收藏 43.82MB ZIP 举报
温馨提示
微软开源网络库:c++REST SDK 编译包,包含:include、lib、dll文件夹,提供x64位debug和release编译结果,开箱即用!可以支持VS2015 / VS2017 / VS2019的使用,自带个人编写的VS示例工程,post/get请求示例。
资源推荐
资源详情
资源评论
收起资源包目录
微软开源网络库:c++REST SDK 编译包 (2000个子文件)
applink.c 3KB
TestCppRestSdk.cpp 7KB
src.cpp 712B
stdafx.cpp 218B
pplxtasks.h 322KB
safestack.h 198KB
obj_mac.h 172KB
ssl.h 146KB
zlib.h 94KB
json.h 73KB
evp.h 71KB
http_msg.h 66KB
streams.h 64KB
asn1.h 62KB
astreambuf.h 55KB
ec.h 55KB
x509.h 52KB
objects.h 46KB
engine.h 44KB
bn.h 43KB
filestream.h 43KB
x509v3.h 39KB
tls1.h 38KB
bio.h 38KB
ts.h 34KB
asn1t.h 34KB
ssl3.h 33KB
http_client.h 31KB
pplxcancellation_token.h 30KB
rsa.h 29KB
x509_vfy.h 29KB
cms.h 28KB
symhacks.h 27KB
crypto.h 27KB
ocsp.h 27KB
producerconsumerstream.h 26KB
pem.h 25KB
asyncrt_utils.h 25KB
rawptrstream.h 24KB
containerstream.h 24KB
asn1_mac.h 24KB
ws_client.h 22KB
oauth2.h 21KB
des_old.h 21KB
pkcs7.h 20KB
oauth1.h 20KB
interopstream.h 20KB
dso.h 20KB
ui.h 18KB
base_uri.h 17KB
zconf.h 16KB
err.h 16KB
dh.h 16KB
encode.h 15KB
http_compression.h 15KB
pkcs12.h 15KB
decode.h 14KB
ecdsa.h 14KB
dsa.h 14KB
ssl2.h 12KB
des.h 12KB
http_listener.h 11KB
alloc_lib.h 11KB
uri_builder.h 11KB
conf.h 11KB
e_os2.h 11KB
http_headers.h 11KB
lhash.h 9KB
dtls1.h 9KB
fileio.h 9KB
open.h 9KB
pplxlinux.h 8KB
modes.h 8KB
krb5_asn.h 8KB
sha.h 8KB
ossl_typ.h 8KB
ws_msg.h 8KB
opensslconf.h 8KB
pplxwin.h 7KB
endian.h 7KB
kssl.h 7KB
pplxinterface.h 7KB
srtp.h 6KB
web_utilities.h 6KB
aes.h 6KB
seed.h 6KB
pplx.h 6KB
rand.h 6KB
srp.h 6KB
camellia.h 5KB
blowfish.h 5KB
ecdh.h 5KB
make.h 5KB
buffer.h 5KB
md4.h 5KB
md5.h 5KB
idea.h 5KB
cast.h 5KB
txt_db.h 5KB
rc2.h 4KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
欧特克_Glodon
- 粉丝: 4w+
- 资源: 64
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 笔记实验六,spark,大数据分析
- ####蓝桥杯python的详细的信息介绍
- 电子万年历软件仿真(经过多次修改,保证正确性)
- Unity XR 手势射击控制脚本(适用于任何可手势识别的设备)
- 机械设计全自动电表(NB和IC卡表)控制和上壳装配线sw16可编辑非常好的设计图纸100%好用.zip
- 基于matlab的EAN-13条形码识别系统GUI界面.zip代码53
- matlab基于bp神经网络交通信号标志识别GUI界面13个标志.zip代码54
- 电子万年历答辩实物展示视频mp4格式
- 基于python实现的程序,包括哈希感知算法cvHash,图像切割cvsplit,固定目标检测cvRec(附文档ppt)等
- 计算0-10000之间所有偶数的和
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页