本文整理汇总了C++中GroupPtr::restart方法的典型用法代码示例。如果您正苦于以下问题:C++ GroupPtr::restart方法的具体用法?C++ GroupPtr::restart怎么用?C++ GroupPtr::restart使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GroupPtr
的用法示例。
在下文中一共展示了GroupPtr::restart方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadComponentInfos
void
SuperGroup::realDoRestart(const Options &options, unsigned int generation) {
TRACE_POINT();
vector<ComponentInfo> componentInfos = loadComponentInfos(options);
vector<ComponentInfo>::const_iterator it;
PoolPtr pool = getPool();
Pool::DebugSupportPtr debug = pool->debugSupport;
if (debug != NULL && debug->superGroup) {
debug->debugger->send("About to finish SuperGroup restart");
debug->messages->recv("Proceed with restarting SuperGroup");
}
boost::unique_lock<boost::mutex> lock(getPoolSyncher(pool));
if (OXT_UNLIKELY(this->generation != generation)) {
return;
}
assert(state == RESTARTING);
verifyInvariants();
vector<GroupPtr> allGroups;
vector<GroupPtr> updatedGroups;
vector<GroupPtr> newGroups;
vector<GroupPtr>::const_iterator g_it;
vector<Callback> actions;
this->options = options;
// Update the component information for existing groups.
UPDATE_TRACE_POINT();
for (it = componentInfos.begin(); it != componentInfos.end(); it++) {
const ComponentInfo &info = *it;
pair<GroupPtr, unsigned int> result =
findGroupCorrespondingToComponent(groups, info);
GroupPtr group = result.first;
if (group != NULL) {
unsigned int index = result.second;
group->componentInfo = info;
updatedGroups.push_back(group);
groups[index].reset();
} else {
// This is not an existing group but a new one,
// so create it.
group = boost::make_shared<Group>(shared_from_this(),
options, info);
newGroups.push_back(group);
}
// allGroups must be in the same order as componentInfos.
allGroups.push_back(group);
}
// Some components might have been deleted, so delete the
// corresponding groups.
detachAllGroups(groups, actions);
// Tell all previous existing groups to restart.
for (g_it = updatedGroups.begin(); g_it != updatedGroups.end(); g_it++) {
GroupPtr group = *g_it;
group->restart(options);
}
groups = allGroups;
defaultGroup = findDefaultGroup(allGroups);
setState(READY);
assignGetWaitlistToGroups(actions);
UPDATE_TRACE_POINT();
verifyInvariants();
lock.unlock();
runAllActions(actions);
}