void TClientCollection::printAll()  // print info for all clients
{
    cout << endl << "Client List:" << endl;
    forEach( &print, 0 ); // call print for each client
}
Example #2
0
size_t TGroup::dataSize() {
   size_t T = 0;
   forEach(addSubviewDataSize, &T);
   return T;
}
Example #3
0
void iterate(ArrayList list, ForEach* forEach){
	int index;
	for(index = 0;index < list.length ;index++){
		forEach(list.base[index]);
	}
}
Example #4
0
void Profile::restoreAll()
{
    forEach(&ProfileNode::restore);
}
Example #5
0
void TGroup::awaken() {
   forEach(doAwaken, 0);
}
Example #6
0
int JList::size() const {
    int sz = 0;
    forEach(DoSize, (void**)&sz);
    return sz;
}
Example #7
0
 static void runMatching(    const std::string& testSpec, 
                             Expected::Result expectedResult ) {
     forEach(    getCurrentContext().getTestCaseRegistry().getMatchingTestCases( testSpec ), 
                 MetaTestRunner( expectedResult ) );
 }
Example #8
0
PassOwnPtr<TypeCountSet> Heap::objectTypeCounts()
{
    TypeCounter typeCounter;
    forEach(typeCounter);
    return typeCounter.take();
}
Example #9
0
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;
}
Example #10
0
 /**
  * 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;
}
Example #12
0
void CNode::forEachChar( const function<void( unsigned char, CBits& )>& op ) const {
	CBits b;
	forEach( b, op );
}