本文整理汇总了C++中PROJECT::write_state方法的典型用法代码示例。如果您正苦于以下问题:C++ PROJECT::write_state方法的具体用法?C++ PROJECT::write_state怎么用?C++ PROJECT::write_state使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PROJECT
的用法示例。
在下文中一共展示了PROJECT::write_state方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handle_get_project_status
static void handle_get_project_status(MIOFILE& fout) {
unsigned int i;
fout.printf("<projects>\n");
for (i=0; i<gstate.projects.size(); i++) {
PROJECT* p = gstate.projects[i];
p->write_state(fout, true);
}
fout.printf("</projects>\n");
}
示例2: handle_get_project_status
static void handle_get_project_status(GUI_RPC_CONN& grc) {
unsigned int i;
grc.mfout.printf("<projects>\n");
for (i=0; i<gstate.projects.size(); i++) {
PROJECT* p = gstate.projects[i];
p->write_state(grc.mfout, true);
}
grc.mfout.printf("</projects>\n");
}
示例3: handle_get_simple_gui_info
static void handle_get_simple_gui_info(MIOFILE& fout) {
unsigned int i;
fout.printf("<simple_gui_info>\n");
for (i=0; i<gstate.projects.size(); i++) {
PROJECT* p = gstate.projects[i];
p->write_state(fout, true);
}
gstate.write_tasks_gui(fout, false);
fout.printf("</simple_gui_info>\n");
}
示例4: handle_get_simple_gui_info
static void handle_get_simple_gui_info(GUI_RPC_CONN& grc) {
unsigned int i;
grc.mfout.printf("<simple_gui_info>\n");
for (i=0; i<gstate.projects.size(); i++) {
PROJECT* p = gstate.projects[i];
p->write_state(grc.mfout, true);
}
gstate.write_tasks_gui(grc.mfout, true);
grc.mfout.printf("</simple_gui_info>\n");
}
示例5: write_state_gui
int CLIENT_STATE::write_state_gui(MIOFILE& f) {
unsigned int i, j;
int retval;
f.printf("<client_state>\n");
retval = host_info.write(f, true, true);
if (retval) return retval;
// the following are for compatibility with old managers
//
if (coprocs.have_nvidia()) {
f.printf("<have_cuda/>\n");
}
if (coprocs.have_ati()) {
f.printf("<have_ati/>\n");
}
#if 1
// NOTE: the following is not in CC_STATE.
// However, BoincView (which does its own parsing) expects it
// to be in the get_state() reply, so leave it in for now
//
retval = net_stats.write(f);
if (retval) return retval;
#endif
retval = time_stats.write(f, true);
if (retval) return retval;
for (j=0; j<projects.size(); j++) {
PROJECT* p = projects[j];
retval = p->write_state(f, true);
if (retval) return retval;
for (i=0; i<apps.size(); i++) {
if (apps[i]->project == p) {
retval = apps[i]->write(f);
if (retval) return retval;
}
}
for (i=0; i<app_versions.size(); i++) {
if (app_versions[i]->project == p) app_versions[i]->write(f);
}
for (i=0; i<workunits.size(); i++) {
if (workunits[i]->project == p) workunits[i]->write(f);
}
for (i=0; i<results.size(); i++) {
if (results[i]->project == p) results[i]->write_gui(f);
}
}
f.printf(
"<platform_name>%s</platform_name>\n"
"<core_client_major_version>%d</core_client_major_version>\n"
"<core_client_minor_version>%d</core_client_minor_version>\n"
"<core_client_release>%d</core_client_release>\n"
"<executing_as_daemon>%d</executing_as_daemon>\n",
get_primary_platform(),
core_client_version.major,
core_client_version.minor,
core_client_version.release,
executing_as_daemon?1:0
);
for (i=0; i<platforms.size(); i++) {
f.printf(
"<platform>%s</platform>\n", platforms[i].name.c_str()
);
}
global_prefs.write(f);
// the following used by BoincView - don't remove
//
if (strlen(main_host_venue)) {
f.printf("<host_venue>%s</host_venue>\n", main_host_venue);
}
f.printf("</client_state>\n");
return 0;
}
示例6: write_state
int CLIENT_STATE::write_state(MIOFILE& f) {
unsigned int i, j;
int retval;
#ifdef SIM
fprintf(stderr, "simulator shouldn't write state file\n");
exit(1);
#endif
f.printf("<client_state>\n");
retval = host_info.write(f, true, true);
if (retval) return retval;
retval = time_stats.write(f, false);
if (retval) return retval;
retval = net_stats.write(f);
if (retval) return retval;
for (j=0; j<projects.size(); j++) {
PROJECT* p = projects[j];
retval = p->write_state(f);
if (retval) return retval;
for (i=0; i<apps.size(); i++) {
if (apps[i]->project == p) {
retval = apps[i]->write(f);
if (retval) return retval;
}
}
for (i=0; i<file_infos.size(); i++) {
if (file_infos[i]->project != p) continue;
FILE_INFO* fip = file_infos[i];
// don't write file infos for anonymous platform app files
//
if (fip->anonymous_platform_file) continue;
retval = fip->write(f, false);
if (retval) return retval;
}
for (i=0; i<app_versions.size(); i++) {
if (app_versions[i]->project == p) {
app_versions[i]->write(f);
}
}
for (i=0; i<workunits.size(); i++) {
if (workunits[i]->project == p) workunits[i]->write(f);
}
for (i=0; i<results.size(); i++) {
if (results[i]->project == p) results[i]->write(f, false);
}
p->write_project_files(f);
#ifdef ENABLE_AUTO_UPDATE
if (auto_update.present && auto_update.project==p) {
auto_update.write(f);
}
#endif
}
active_tasks.write(f);
f.printf(
"<platform_name>%s</platform_name>\n"
"<core_client_major_version>%d</core_client_major_version>\n"
"<core_client_minor_version>%d</core_client_minor_version>\n"
"<core_client_release>%d</core_client_release>\n"
"<user_run_request>%d</user_run_request>\n"
"<user_run_prev_request>%d</user_run_prev_request>\n"
"<user_gpu_request>%d</user_gpu_request>\n"
"<user_gpu_prev_request>%d</user_gpu_prev_request>\n"
"<user_network_request>%d</user_network_request>\n"
"<new_version_check_time>%f</new_version_check_time>\n"
"<all_projects_list_check_time>%f</all_projects_list_check_time>\n",
get_primary_platform(),
core_client_version.major,
core_client_version.minor,
core_client_version.release,
cpu_run_mode.get_perm(),
cpu_run_mode.get_prev(),
gpu_run_mode.get_perm(),
gpu_run_mode.get_prev(),
network_run_mode.get_perm(),
new_version_check_time,
all_projects_list_check_time
);
if (strlen(language)) {
f.printf("<language>%s</language>\n", language);
}
if (newer_version.size()) {
f.printf("<newer_version>%s</newer_version>\n", newer_version.c_str());
}
for (i=1; i<platforms.size(); i++) {
f.printf("<alt_platform>%s</alt_platform>\n", platforms[i].name.c_str());
}
if (gui_proxy_info.present) {
gui_proxy_info.write(f);
}
if (strlen(main_host_venue)) {
f.printf("<host_venue>%s</host_venue>\n", main_host_venue);
}
f.printf("</client_state>\n");
return 0;
}