本文整理汇总了C++中DomainList::GetIterator方法的典型用法代码示例。如果您正苦于以下问题:C++ DomainList::GetIterator方法的具体用法?C++ DomainList::GetIterator怎么用?C++ DomainList::GetIterator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DomainList
的用法示例。
在下文中一共展示了DomainList::GetIterator方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddressString
static int
dump_domains(int argc, char** argv)
{
DomainList::Iterator iterator = sDomains.GetIterator();
while (net_domain_private* domain = iterator.Next()) {
kprintf("domain: %p, %s, %d\n", domain, domain->name, domain->family);
kprintf(" module: %p\n", domain->module);
kprintf(" address_module: %p\n", domain->address_module);
if (!domain->routes.IsEmpty())
kprintf(" routes:\n");
RouteList::Iterator routeIterator = domain->routes.GetIterator();
while (net_route_private* route = routeIterator.Next()) {
kprintf(" %p: dest %s, mask %s, gw %s, flags %" B_PRIx32 ", "
"address %p\n", route, AddressString(domain, route->destination
? route->destination : NULL).Data(),
AddressString(domain, route->mask ? route->mask : NULL).Data(),
AddressString(domain, route->gateway
? route->gateway : NULL).Data(),
route->flags, route->interface_address);
}
if (!domain->route_infos.IsEmpty())
kprintf(" route infos:\n");
RouteInfoList::Iterator infoIterator = domain->route_infos.GetIterator();
while (net_route_info* info = infoIterator.Next()) {
kprintf(" %p\n", info);
}
}
return 0;
}
示例2:
/*! Scans the domain list for the specified family.
You need to hold the sDomainLock when calling this function.
*/
static net_domain_private*
lookup_domain(int family)
{
DomainList::Iterator iterator = sDomains.GetIterator();
while (net_domain_private* domain = iterator.Next()) {
if (domain->family == family)
return domain;
}
return NULL;
}
示例3: locker
void
domain_removed_device_interface(net_device_interface* deviceInterface)
{
MutexLocker locker(sDomainLock);
DomainList::Iterator iterator = sDomains.GetIterator();
while (net_domain_private* domain = iterator.Next()) {
RecursiveLocker locker(domain->lock);
net_interface_private* interface = find_interface(domain,
deviceInterface->device->name);
if (interface == NULL)
continue;
remove_interface_from_domain(interface);
}
}