本文整理汇总了C++中Domain::anyTargetsAttached方法的典型用法代码示例。如果您正苦于以下问题:C++ Domain::anyTargetsAttached方法的具体用法?C++ Domain::anyTargetsAttached怎么用?C++ Domain::anyTargetsAttached使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Domain
的用法示例。
在下文中一共展示了Domain::anyTargetsAttached方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: prepareProbes
DysectAPI::DysectErrorCode Backend::prepareProbes(struct DysectBEContext_t* context) {
assert(context);
assert(context->walkerSet);
walkerSet = context->walkerSet;
Domain::setBEContext(context);
DysectAPI::DaemonHostname = context->hostname;
vector<Probe*> roots = ProbeTree::getRoots();
for(int i = 0; i < roots.size(); i++) {
Probe* probe = roots[i];
// Prepare all streams ie. ensure all domain ids and tags are created
// for stream -> domain binding
if(probe->prepareStream(recursive) != OK) {
Err::warn(Error, "Error occured while preparing streams");
}
if(probe->prepareEvent(recursive) != OK) {
Err::warn(Error, "Error occured while preparing events");
}
Err::verbose(true, "Starting preparation of conditions");
if(probe->prepareCondition(recursive) != OK) {
Err::warn(Error, "Error occured while preparing conditions");
}
if(probe->prepareAction(recursive) != OK) {
Err::warn(Error, "Error occured while preparing actions");
}
}
// Add all domains to missing bindings
map<tag_t, Domain*> domainMap = Domain::getDomainMap();
map<tag_t, Domain*>::iterator domainIter = domainMap.begin();
for(;domainIter != domainMap.end(); domainIter++) {
tag_t domainId = domainIter->first;
Domain* dom = domainIter->second;
if(dom->anyTargetsAttached()) {
Err::verbose(true, "Missing domain: %x", domainId);
missingBindings.insert(domainId);
}
}
// List generated - wait for incoming frontend init packages
if(missingBindings.empty()) {
state = ready;
if(controlStream != 0) {
Err::verbose(true, "No domains need to be bound - send ack");
ackBindings();
}
} else {
state = bindingStreams;
}
return OK;
}
示例2: prepareProbes
DysectAPI::DysectErrorCode Backend::prepareProbes(struct DysectBEContext_t* context, bool pending) {
if(!pending) {
assert(context);
assert(context->walkerSet);
walkerSet = context->walkerSet;
Domain::setBEContext(context);
DysectAPI::DaemonHostname = context->hostname;
}
vector<Probe*> roots, removePending;
if(pending)
roots = ProbeTree::getPendingRoots();
else
roots = ProbeTree::getRoots();
for(int i = 0; i < roots.size(); i++) {
Probe* probe = roots[i];
// Prepare all streams ie. ensure all domain ids and tags are created
// for stream -> domain binding
if(probe->prepareStream(recursive) != OK) {
DYSECTWARN(Error, "Error occured while preparing streams");
if(!pending)
ProbeTree::addPendingRoot(probe);
continue;
}
if(probe->prepareEvent(recursive) != OK) {
if(!pending) {
DYSECTLOG(Error, "Error occured while preparing events, adding to pending events");
ProbeTree::addPendingRoot(probe);
}
continue;
DYSECTWARN(Error, "Error occured while preparing events");
}
DYSECTVERBOSE(true, "Starting preparation of conditions");
if(probe->prepareCondition(recursive) != OK) {
DYSECTWARN(Error, "Error occured while preparing conditions");
if(!pending)
ProbeTree::addPendingRoot(probe);
continue;
}
if(probe->prepareAction(recursive) != OK) {
DYSECTWARN(Error, "Error occured while preparing actions");
if(!pending)
ProbeTree::addPendingRoot(probe);
continue;
}
if(pending) {
DYSECTVERBOSE(true, "Enabled pending probe %x", probe);
removePending.push_back(probe);
}
}
if(pending) {
if(removePending.size() == 0)
return OK;
for(int i = 0; i < removePending.size(); i++)
ProbeTree::removePendingRoot(removePending[i]);
}
// Add all domains to missing bindings
map<tag_t, Domain*> domainMap = Domain::getDomainMap();
map<tag_t, Domain*>::iterator domainIter = domainMap.begin();
for(;domainIter != domainMap.end(); domainIter++) {
tag_t domainId = domainIter->first;
Domain* dom = domainIter->second;
if(dom->anyTargetsAttached()) {
DYSECTVERBOSE(true, "Missing domain: %x", domainId);
missingBindings.insert(domainId);
}
}
// List generated - wait for incoming frontend init packages
if(missingBindings.empty()) {
state = ready;
if(controlStream != 0) {
DYSECTVERBOSE(true, "No domains need to be bound - send ack");
ackBindings();
}
} else {
state = bindingStreams;
}
return OK;
}