Logo Search packages:      
Sourcecode: kdebluetooth version File versions

bool KBluetooth::DeviceAddress::operator< ( const DeviceAddress b  )  const

Less-than-operator. Mainly there to use DeviceAddress inside STL containers, like STL sets or as a key in a STL map.

b the DeviceAddress to compare to (right hand side)
true if this < b, false otherwise.

Definition at line 86 of file deviceaddress.cpp.

References bdaddr, and isValid.

    if (isValid == false && b.isValid == false)
        return false;
    else if (isValid == false && b.isValid == true)
        return false;
    else if (isValid == true && b.isValid == false)
        return true;

    if (bdaddr.b[5] != b.bdaddr.b[5]) return (bdaddr.b[5] < b.bdaddr.b[5]);
    if (bdaddr.b[4] != b.bdaddr.b[4]) return (bdaddr.b[4] < b.bdaddr.b[4]);
    if (bdaddr.b[3] != b.bdaddr.b[3]) return (bdaddr.b[3] < b.bdaddr.b[3]);
    if (bdaddr.b[2] != b.bdaddr.b[2]) return (bdaddr.b[2] < b.bdaddr.b[2]);
    if (bdaddr.b[1] != b.bdaddr.b[1]) return (bdaddr.b[1] < b.bdaddr.b[1]);
    if (bdaddr.b[0] != b.bdaddr.b[0]) return (bdaddr.b[0] < b.bdaddr.b[0]);
    return false;

Generated by  Doxygen 1.6.0   Back to index