当前位置: 首页>>代码示例>>C++>>正文


C++ CallbackHandle类代码示例

本文整理汇总了C++中CallbackHandle的典型用法代码示例。如果您正苦于以下问题:C++ CallbackHandle类的具体用法?C++ CallbackHandle怎么用?C++ CallbackHandle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CallbackHandle类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ssl_ctx_callback

static CURLcode ssl_ctx_callback(CURL* curl, void* sslCtx, void* userPointer)
{
    CallbackHandle* handle = (CallbackHandle*)userPointer;

    int32_t result = handle->sslCtxCallback(curl, sslCtx, handle->sslUserPointer);
    return (CURLcode)result;
}
开发者ID:AmeerThasthahir,项目名称:corefx,代码行数:7,代码来源:pal_easy.c

示例2: debug_callback

static int debug_callback(CURL* curl, curl_infotype type, char* data, size_t size, void* userPointer)
{
    assert(userPointer != NULL);
    CallbackHandle* handle = (CallbackHandle*)userPointer;
    handle->debugCallback(curl, (PAL_CurlInfoType)type, data, size, handle->debugUserPointer);
    return 0;
}
开发者ID:AmeerThasthahir,项目名称:corefx,代码行数:7,代码来源:pal_easy.c

示例3: ssl_ctx_callback

static CURLcode ssl_ctx_callback(CURL* curl, void* sslCtx, void* userPointer)
{
    CallbackHandle* handle = static_cast<CallbackHandle*>(userPointer);

    int32_t result = handle->sslCtxCallback(curl, sslCtx, handle->sslUserPointer);
    return static_cast<CURLcode>(result);
}
开发者ID:geleems,项目名称:corefx,代码行数:7,代码来源:pal_easy.cpp

示例4: debug_callback

static int debug_callback(CURL* curl, curl_infotype type, char* data, size_t size, void* userPointer)
{
    assert(userPointer != nullptr);
    CallbackHandle* handle = static_cast<CallbackHandle*>(userPointer);
    handle->debugCallback(curl, static_cast<PAL_CurlInfoType>(type), data, size, handle->debugUserPointer);
    return 0;
}
开发者ID:geleems,项目名称:corefx,代码行数:7,代码来源:pal_easy.cpp

示例5: unregisterCallback

bool GraphObject::unregisterCallback(const CallbackHandle& handle)
{
    if (!handle)
        return false;

    auto attribute = _attribFunctions.find(handle.getAttribute());
    if (attribute == _attribFunctions.end())
        return false;

    return attribute->second.unregisterCallback(handle);
}
开发者ID:jing-interactive,项目名称:splash,代码行数:11,代码来源:graph_object.cpp

示例6: wait

void ThreadPoolTaskExecutor::wait(const CallbackHandle& cbHandle) {
    invariant(cbHandle.isValid());
    auto cbState = checked_cast<CallbackState*>(getCallbackFromHandle(cbHandle));
    if (cbState->isFinished.load()) {
        return;
    }
    stdx::unique_lock<stdx::mutex> lk(_mutex);
    if (!cbState->finishedCondition) {
        cbState->finishedCondition.emplace();
    }
    while (!cbState->isFinished.load()) {
        cbState->finishedCondition->wait(lk);
    }
}
开发者ID:Ferryworld,项目名称:mongo,代码行数:14,代码来源:thread_pool_task_executor.cpp

示例7: cancel

void ThreadPoolTaskExecutor::cancel(const CallbackHandle& cbHandle) {
    invariant(cbHandle.isValid());
    auto cbState = checked_cast<CallbackState*>(getCallbackFromHandle(cbHandle));
    stdx::unique_lock<stdx::mutex> lk(_mutex);
    cbState->canceled.store(1);
    if (cbState->isNetworkOperation) {
        lk.unlock();
        _net->cancelCommand(cbHandle);
        return;
    }
    if (cbState->readyDate != Date_t{}) {
        // This callback might still be in the sleeper queue; if it is, schedule it now
        // rather than when the alarm fires.
        auto iter = std::find_if(_sleepersQueue.begin(),
                                 _sleepersQueue.end(),
                                 [cbState](const std::shared_ptr<CallbackState>& other) {
                                     return cbState == other.get();
                                 });
        if (iter != _sleepersQueue.end()) {
            invariant(iter == cbState->iter);
            scheduleIntoPool_inlock(&_sleepersQueue, cbState->iter);
        }
    }
}
开发者ID:qihsh,项目名称:mongo,代码行数:24,代码来源:thread_pool_task_executor.cpp

示例8: header_callback

static size_t header_callback(char* buffer, size_t size, size_t nitems, void* instream)
{
    CallbackHandle* handle = (CallbackHandle*)instream;
    return (size_t)(handle->headerCallback((uint8_t*)buffer, size, nitems, handle->headerUserPointer));
}
开发者ID:AmeerThasthahir,项目名称:corefx,代码行数:5,代码来源:pal_easy.c

示例9: seek_callback

static int seek_callback(void* userp, curl_off_t offset, int origin)
{
    CallbackHandle* handle = (CallbackHandle*)userp;
    return handle->seekCallback(handle->seekUserPointer, offset, origin);
}
开发者ID:AmeerThasthahir,项目名称:corefx,代码行数:5,代码来源:pal_easy.c

示例10: header_callback

static size_t header_callback(char* buffer, size_t size, size_t nitems, void* instream)
{
    CallbackHandle* handle = static_cast<CallbackHandle*>(instream);
    return static_cast<size_t>(
        handle->headerCallback(reinterpret_cast<uint8_t*>(buffer), size, nitems, handle->headerUserPointer));
}
开发者ID:geleems,项目名称:corefx,代码行数:6,代码来源:pal_easy.cpp

示例11: wait

void ThreadPoolTaskExecutor::wait(const CallbackHandle& cbHandle) {
    invariant(cbHandle.isValid());
    auto cbState = checked_cast<CallbackState*>(getCallbackFromHandle(cbHandle));
    waitForEvent(cbState->finishedEvent);
}
开发者ID:qihsh,项目名称:mongo,代码行数:5,代码来源:thread_pool_task_executor.cpp


注:本文中的CallbackHandle类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。