本文整理汇总了C++中Subscription::printInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ Subscription::printInfo方法的具体用法?C++ Subscription::printInfo怎么用?C++ Subscription::printInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Subscription
的用法示例。
在下文中一共展示了Subscription::printInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printWorldStateInfo
int TopologyWorldState::printWorldStateInfo (void)
{
// Prints information about local node, like subscriptions, alive neighbors, dead peers, etc
_m.lock (141);
checkAndLogMsg ("TopologyWorldState::printWorldStateInfo", Logger::L_Info, "=========================================================================\n");
checkAndLogMsg ("TopologyWorldState::printWorldStateInfo", Logger::L_Info, " PRINT WORLD STATE INFO\n");
checkAndLogMsg ("TopologyWorldState::printWorldStateInfo", Logger::L_Info, " Node id: %s\n", _pDisService->getNodeId());
if ((_pLocalNodeInfo->getConsolidatedSubscriptions())->getCount() == 0) {
checkAndLogMsg ("TopologyWorldState::printWorldStateInfo", Logger::L_Info, " No subscribed groups\n");
} else {
_pLocalNodeInfo->printAllSubscribedGroups();
// Print subscribing clients
checkAndLogMsg ("TopologyWorldState::printWorldStateInfo", Logger::L_Info, " SUBSCRIBING CLIENTS:\n");
DArray<uint16> *pSubClients = _pLocalNodeInfo->getAllSubscribingClients();
for (int j = 0; j <= pSubClients->getHighestIndex(); j++) {
checkAndLogMsg ("TopologyWorldState::printWorldStateInfo", Logger::L_Info, " SUB CLIENT N.%d:\n", (*pSubClients)[j]);
SubscriptionList *pSubsForClient = _pLocalNodeInfo->getSubscriptionListForClient ((*pSubClients)[j]);
_pLocalNodeInfo->releaseLocalNodeInfo();
if (pSubsForClient && pSubsForClient->getCount() != 0) {
for (StringHashtable<Subscription>::Iterator i = pSubsForClient->getIterator(); !i.end(); i.nextElement()) {
checkAndLogMsg ("TopologyWorldState::printWorldStateInfo", Logger::L_Info, " SUBSCRIPTION:\n");
checkAndLogMsg ("TopologyWorldState::printWorldStateInfo", Logger::L_Info, " groupname %s\n", i.getKey());
Subscription *pS = i.getValue();
pS->printInfo();
}
}
}
// Print local consolidated subscriptions
checkAndLogMsg ("TopologyWorldState::printWorldStateInfo", Logger::L_Info, " LOCAL CONSOLIDATED SUBSCRIPTIONS:\n");
SubscriptionList *pSubscriptions = _pLocalNodeInfo->getConsolidatedSubscriptions();
for (StringHashtable<Subscription>::Iterator i = pSubscriptions->getIterator(); !i.end(); i.nextElement()) {
checkAndLogMsg ("TopologyWorldState::printWorldStateInfo", Logger::L_Info, " SUBSCRIPTION:\n");
checkAndLogMsg ("TopologyWorldState::printWorldStateInfo", Logger::L_Info, " groupname %s\n", i.getKey());
Subscription *pS = i.getValue();
pS->printInfo();
}
}
checkAndLogMsg ("TopologyWorldState::printWorldStateInfo", Logger::L_Info, "-------------------------------------------------------------------------\n");
checkAndLogMsg ("TopologyWorldState::printWorldStateInfo", Logger::L_Info, " %d ACTIVE NEIGHBORS\n", _pLocalNodeInfo->getCount());
for (StringHashtable<Thing>::Iterator iNeighbors = _pLocalNodeInfo->getAllElements(); !iNeighbors.end(); iNeighbors.nextElement()) {
checkAndLogMsg ("TopologyWorldState::printWorldStateInfo", Logger::L_Info, "-------------------------------------------------------------------------\n");
RemoteNodeInfo *pRNI = (RemoteNodeInfo *) iNeighbors.getValue();
pRNI->printRemoteNodeInfo();
}
checkAndLogMsg ("TopologyWorldState::printWorldStateInfo", Logger::L_Info, "-------------------------------------------------------------------------\n");
checkAndLogMsg ("TopologyWorldState::printWorldStateInfo", Logger::L_Info, " %d DEAD PEERS\n", _deadPeers.getCount());
for (StringHashtable<RemoteNodeInfo>::Iterator iDead = _deadPeers.getAllElements(); !iDead.end(); iDead.nextElement()) {
checkAndLogMsg ("TopologyWorldState::printWorldStateInfo", Logger::L_Info, "-------------------------------------------------------------------------\n");
RemoteNodeInfo *pRNI = (RemoteNodeInfo *) iDead.getValue();
pRNI->printRemoteNodeInfo();
}
checkAndLogMsg ("TopologyWorldState::printWorldStateInfo", Logger::L_Info, "=========================================================================\n");
_m.unlock (141);
return 0;
}