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


C++ PROJECT::suspend方法代码示例

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


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

示例1: handle_project_suspend

static void handle_project_suspend(GUI_RPC_CONN& grc) {
    PROJECT* p = get_project_parse(grc);
    if (!p) return;
    gstate.set_client_state_dirty("Project modified by user");
    msg_printf(p, MSG_INFO, "project suspended by user");
    p->suspend();
    grc.mfout.printf("<success/>\n");
}
开发者ID:Rytiss,项目名称:native-boinc-for-android,代码行数:8,代码来源:gui_rpc_server_ops.cpp

示例2: handle_project_op

static void handle_project_op(char* buf, MIOFILE& fout, const char* op) {
    PROJECT* p = get_project(buf, fout);
    if (!p) {
        fout.printf("<error>no such project</error>\n");
        return;
    }
    gstate.set_client_state_dirty("Project modified by user");
    if (!strcmp(op, "reset")) {
        gstate.request_schedule_cpus("project reset by user");
        gstate.request_work_fetch("project reset by user");
        gstate.reset_project(p, false);
    } else if (!strcmp(op, "suspend")) {
        msg_printf(p, MSG_INFO, "suspended by user");
        p->suspend();
    } else if (!strcmp(op, "resume")) {
        msg_printf(p, MSG_INFO, "resumed by user");
        p->resume();
    } else if (!strcmp(op, "detach")) {
        if (p->attached_via_acct_mgr) {
            msg_printf(p, MSG_INFO,
                "This project must be detached using the account manager web site."
            );
            fout.printf("<error>must detach using account manager</error>");
            return;
        }
        gstate.detach_project(p);
        gstate.request_schedule_cpus("project detached by user");
        gstate.request_work_fetch("project detached by user");
    } else if (!strcmp(op, "update")) {
        msg_printf(p, MSG_INFO, "update requested by user");
        p->sched_rpc_pending = RPC_REASON_USER_REQ;
        p->min_rpc_time = 0;
#if 1
        rss_feeds.trigger_fetch(p);
#endif
        gstate.request_work_fetch("project updated by user");
    } else if (!strcmp(op, "nomorework")) {
        msg_printf(p, MSG_INFO, "work fetch suspended by user");
        p->dont_request_more_work = true;
    } else if (!strcmp(op, "allowmorework")) {
        msg_printf(p, MSG_INFO, "work fetch resumed by user");
        p->dont_request_more_work = false;
        gstate.request_work_fetch("project allowed to fetch work by user");
    } else if (!strcmp(op, "detach_when_done")) {
        msg_printf(p, MSG_INFO, "detach when done set by user");
        p->detach_when_done = true;
        p->dont_request_more_work = true;
    } else if (!strcmp(op, "dont_detach_when_done")) {
        msg_printf(p, MSG_INFO, "detach when done cleared by user");
        p->detach_when_done = false;
        p->dont_request_more_work = false;
    }
    fout.printf("<success/>\n");
}
开发者ID:Rytiss,项目名称:native-boinc-for-android,代码行数:54,代码来源:gui_rpc_server_ops.cpp

示例3: handle_reply


//.........这里部分代码省略.........
                        if (pp->detach_when_done) {
                            pp->dont_request_more_work = true;
                        }
                    } else {
                        pp->detach_when_done = false;
                    }

                    // initiate a scheduler RPC if requested by AMS
                    //
                    if (acct.update) {
                        pp->sched_rpc_pending = RPC_REASON_ACCT_MGR_REQ;
                        pp->min_rpc_time = 0;
                    }
                    if (acct.resource_share.present) {
                        pp->ams_resource_share = acct.resource_share.value;
                        pp->resource_share = pp->ams_resource_share;
                    } else {
                        // no host-specific resource share;
                        // if currently have one, restore to value from web
                        //
                        if (pp->ams_resource_share >= 0) {
                            pp->ams_resource_share = -1;
                            PROJECT p2;
                            safe_strcpy(p2.master_url, pp->master_url);
                            retval = p2.parse_account_file();
                            if (!retval) {
                                pp->resource_share = p2.resource_share;
                            } else {
                                pp->resource_share = 100;
                            }
                        }
                    }

                    if (acct.suspend.present) {
                        if (acct.suspend.value) {
                            pp->suspend();
                        } else {
                            pp->resume();
                        }
                    }
                    if (acct.abort_not_started.present) {
                        if (acct.abort_not_started.value) {
                            pp->abort_not_started();
                        }
                    }
                    for (int j=0; j<MAX_RSC; j++) {
                        pp->no_rsc_ams[j] = acct.no_rsc[j];
                    }
                }
            } else {
                // here we don't already have the project.
                //
                retval = check_string_signature2(
                    acct.url.c_str(), acct.url_signature, ami.signing_key, verified
                );
                if (retval || !verified) {
                    msg_printf(NULL, MSG_INTERNAL_ERROR,
                        "Bad signature for URL %s", acct.url.c_str()
                    );
                    continue;
                }
                if (acct.authenticator.empty()) {
                    msg_printf(NULL, MSG_INFO,
                        "Account manager reply missing authenticator for %s",
                        acct.url.c_str()
                    );
开发者ID:drshawnkwang,项目名称:boinc,代码行数:67,代码来源:acct_mgr.cpp


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