<div>What would you all think of using a bitmask for device class identification rather than using strings. This would have the advantage of using bit comparison (usually about 1-4 cpu cycles or O(1)) rather than using string comparison (many cpu cycles per letter or O(x)). If using an unsigned integer this would allow us to have 16 different device classes but more importantly have multiple device contexts such as storage and camera in the same device. The code would look something like:
</div>
<div> </div>
<div>FakeDevice *dev;<br><br> // Initialise a fake system<br> dev = fakeManager->newDevice( "/fake/doeseverything2000" );<br> dev->addCapability(STORAGE_DEVICE | CAMERA_DEVICE | FLYING_MACHINE);</div>
<div> </div>
<div>Any thoughts?</div>
<div>Chris</div>