本文整理汇总了C++中Daemon::idStr方法的典型用法代码示例。如果您正苦于以下问题:C++ Daemon::idStr方法的具体用法?C++ Daemon::idStr怎么用?C++ Daemon::idStr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Daemon
的用法示例。
在下文中一共展示了Daemon::idStr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setPPstyle
//.........这里部分代码省略.........
case MODE_SCHEDD_SUBMITTORS:
d = new Daemon( DT_SCHEDD, direct, addr );
break;
case MODE_NEGOTIATOR_NORMAL:
d = new Daemon( DT_NEGOTIATOR, direct, addr );
break;
case MODE_CKPT_SRVR_NORMAL:
case MODE_COLLECTOR_NORMAL:
case MODE_LICENSE_NORMAL:
case MODE_STORAGE_NORMAL:
case MODE_GENERIC_NORMAL:
case MODE_ANY_NORMAL:
case MODE_OTHER:
case MODE_GRID_NORMAL:
case MODE_HAD_NORMAL:
// These have to go to the collector, anyway.
break;
default:
fprintf( stderr, "Error: Illegal mode %d\n", mode );
exit( 1 );
break;
}
// Here is where we actually override 'addr', if we can obtain
// address of the requested daemon/subsys. If it can't be
// located, then fail with error msg.
// 'd' will be null (unset) if mode is one of above that must go to
// collector (MODE_ANY_NORMAL, MODE_COLLECTOR_NORMAL, etc)
if (NULL != d) {
if( d->locate() ) {
addr = d->addr();
requested_daemon = d;
} else {
const char* id = d->idStr();
if (NULL == id) id = d->name();
dprintf_WriteOnErrorBuffer(stderr, true);
if (NULL == id) id = "daemon";
fprintf(stderr, "Error: Failed to locate %s\n", id);
fprintf(stderr, "%s\n", d->error());
exit( 1 );
}
}
}
ClassAdList result;
CondorError errstack;
if (NULL != ads_file) {
MyString req; // query requirements
q = query->getRequirements(req);
const char * constraint = req.empty() ? NULL : req.c_str();
if (read_classad_file(ads_file, result, constraint)) {
q = Q_OK;
}
} else if (NULL != addr) {
// this case executes if pool was provided, or if in "direct" mode with
// subsystem that corresponds to a daemon (above).
// Here 'addr' represents either the host:port of requested pool, or
// alternatively the host:port of daemon associated with requested subsystem (direct mode)
q = query->fetchAds (result, addr, &errstack);
} else {
// otherwise obtain list of collectors and submit query that way
CollectorList * collectors = CollectorList::create();
q = collectors->query (*query, result, &errstack);
delete collectors;
}