本文整理汇总了C++中AddressList::size方法的典型用法代码示例。如果您正苦于以下问题:C++ AddressList::size方法的具体用法?C++ AddressList::size怎么用?C++ AddressList::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AddressList
的用法示例。
在下文中一共展示了AddressList::size方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: evaluateNextPath
bool SubnetTopology::evaluateNextPath(EngineOperations& engineOperations, Path& path) {
LOG_DEBUG("evaluateNextPath - " << path);
if (getNode(path.getSource()).getNodeType() != NodeType::NODE && getNode(path.getDestination()).getNodeType()
!= NodeType::NODE) {
return true;
}
path.updateLastEvalTime();
if (path.getType() == RoutingTypes::SOURCE_ROUTING) {
AddressList addressList;
DijkstraSearch::searchDijkstra(path.getSource(), path.getDestination(), nodes, addressList);
if (addressList.size() == 0) {
LOG_DEBUG("recreatePath: There is no path between the " << ToStr(path.getSource()) << " and " << ToStr(
path.getDestination()));
return false;
} else if (path.getMaxHops() <= addressList.size()) {
LOG_DEBUG("recreatePath: There path is too long for (" << ToStr(path.getSource()) << " -> " << ToStr(
path.getDestination()) << " ), hops: " << (int) addressList.size() << " > "
<< (int) path.getMaxHops());
} else {
path.setSourcePath(addressList);
return true;
}
} else if (path.getType() == RoutingTypes::GRAPH_ROUTING || path.getType() == RoutingTypes::GRAPH_ROUTING_WITH_MIN_PATH_SELECTION) {
return graphRoutingAlgorithm->evaluateGraphPath(engineOperations, path);
}
return false;
}
示例2: createSourcePath
Uint16 SubnetTopology::createSourcePath(Address32 source, Address32 destination, Uint16 traffic, bool managementPath,
Uint8 maxHops) {
LOG_DEBUG("createSourcePath(" << ToStr(source) << ", " << ToStr(destination) << ", traffic = " << traffic
<< ", maxHops = " << (int) maxHops << ")");
AddressList addressList;
DijkstraSearch::searchDijkstra(source, destination, nodes, addressList);
if (addressList.size() == 0) {
LOG_DEBUG("createPath: There is no path between the " << ToStr(source) << " and " << ToStr(destination));
} else {
//LOG_DEBUG("createPath() : the path is : " << NE::Model::Topology::nodesToString(sourcePath));
}
Path path(getNextPathId(), source, destination, RoutingTypes::SOURCE_ROUTING, traffic);
path.setSourcePath(addressList);
paths[path.getGraphId()] = path;
LOG_TRACE("createSourcePath end");
return path.getGraphId();
}
示例3: NetException
const IpAddress& NetworkInterfaceImpl::get_dest_address(AddressList::size_type index) const {
if (!is_p2p()) {
throw NetException("Unsupported operation");
} else if (index < m_address_list.size()) {
return std::get<NetworkInterface::BROADCAST_ADDRESS>(m_address_list[index]);
}
throw NetException("IpAddress of NetworkInterface not found");
}