void TClientCollection::printAll() // print info for all clients { cout << endl << "Client List:" << endl; forEach( &print, 0 ); // call print for each client }
size_t TGroup::dataSize() { size_t T = 0; forEach(addSubviewDataSize, &T); return T; }
void iterate(ArrayList list, ForEach* forEach){ int index; for(index = 0;index < list.length ;index++){ forEach(list.base[index]); } }
void Profile::restoreAll() { forEach(&ProfileNode::restore); }
void TGroup::awaken() { forEach(doAwaken, 0); }
int JList::size() const { int sz = 0; forEach(DoSize, (void**)&sz); return sz; }
static void runMatching( const std::string& testSpec, Expected::Result expectedResult ) { forEach( getCurrentContext().getTestCaseRegistry().getMatchingTestCases( testSpec ), MetaTestRunner( expectedResult ) ); }
PassOwnPtr<TypeCountSet> Heap::objectTypeCounts() { TypeCounter typeCounter; forEach(typeCounter); return typeCounter.take(); }
static bool claimDevice(struct libusb_device *dev, usbId *id, usbDeviceList *list, usbDevice *devPos) { int retval; bool success = false; usbDevice *newDev = NULL; newDev = (usbDevice*)malloc(sizeof(usbDevice)); memset(newDev, 0, sizeof(usbDevice)); /* basic stuff */ newDev->info.type = *id; newDev->busIndex = libusb_get_bus_number(dev); newDev->devIndex = libusb_get_device_address(dev); /* determine the id (reusing if possible) */ newDev->info.id = 0; while(true) { unsigned int prev = newDev->info.id; forEach(&list->deviceList, findId, &newDev->info.id); if (prev == newDev->info.id) break; } /* open a handle to the usb device */ if ((retval = libusb_open(dev, &newDev->device)) != LIBUSB_SUCCESS) setError(newDev, "Failed to open usb device", retval); else { /* prime errno to control this loop */ errno = 0; do { /* try to force an unbind but only once */ if (errno == EBUSY && (! list->force || ! checkInUse(dev, false))) break; /* try to configure device and claim the interface */ if ((retval = libusb_set_configuration(newDev->device, 1)) < 0) setError(newDev, "Failed to set device configuration", retval); else if ((retval = libusb_claim_interface(newDev->device, 0)) < 0) setError(newDev, "libusb_claim_interface failed 0", retval); else { insertItem(&list->deviceList, (itemHeader*)devPos, (itemHeader*)newDev); if (list->newDev != NULL) list->newDev(&newDev->info); success = true; break; } } while(errno == EBUSY); } /* grab error if there was one */ if (!success) { printError(LOG_ERROR, " updateDeviceList failed", &newDev->info); if (errno == EBUSY) message(LOG_ERROR, "Check device status with igdaemon --devices\n"); if (newDev->device != NULL) libusb_close(newDev->device); free(newDev); } return success; }
/** * Invoke `op' on every records in the tree, in increasingly order * * @param op the Operator used to visit records * @see forEach(Iterator _begin, Iterator last, Operator op) * @see forEachReverse(Operator op) * @see forEachReverse(Iterator first, Iterator last, Operator op) */ inline void forEach(Operator op) { forEach(begin(), end(), op); }
hashValueType Container::hashValue() const { hashValueType val = 0; forEach( getHashValue, &val ); return val; }
void CNode::forEachChar( const function<void( unsigned char, CBits& )>& op ) const { CBits b; forEach( b, op ); }