Interface for Device sets. More...
Inherited by DriverDeviceTracker, FileDriverDeviceSet, and VinDriverDeviceSet.
Public Member Functions | |
bool | Add (Device device) |
Adds the given device to this set. More... | |
bool | Remove (Device device) |
Removes the given device from this set. More... | |
bool | Contains (Device deviceToCheck, out Device presentDevice) |
Checks whether an instance equivalent to deviceToCheck is present in this set. More... | |
IEnumerable< Device > | GetDevices () |
Gets all currently tracked devices. More... | |
void | Collect () |
Checks this set for expired weak references and trims the set to the actually alive objects. | |
Properties | |
int | Count [get] |
Gets the number of active devices in this set. | |
Interface for Device sets.
A set contains a sorted list of unique entries.
These sets are a bit special as new instances are to be checked against present instances. This is necessary as different native objects can reference the same native device. With this API only one managed object of a device must be available at one point in time.
bool Add | ( | Device | device | ) |
Adds the given device to this set.
device | Device to add. |
true
if device was not present and thus could be added; false
if it was present and could not be added.Implemented in VinDriverDeviceSet, FileDriverDeviceSet, and DriverDeviceTracker.
Checks whether an instance equivalent to deviceToCheck is present in this set.
deviceToCheck | Device to be checked whether an equivalent device is available in this set. |
presentDevice | Contains the equivalent device which is present in this set if available; null otherwise. |
true
if equivalent device is present; false
if not.Implemented in VinDriverDeviceSet, FileDriverDeviceSet, and DriverDeviceTracker.
IEnumerable< Device > GetDevices | ( | ) |
Gets all currently tracked devices.
Implemented in VinDriverDeviceSet, FileDriverDeviceSet, and DriverDeviceTracker.
bool Remove | ( | Device | device | ) |
Removes the given device from this set.
device | Device to remove. |
true
if device was present and thus could be removed; false
if it was not present.Implemented in VinDriverDeviceSet, FileDriverDeviceSet, and DriverDeviceTracker.