I have a list of many objects. Further, I have an additional group of lists consuming those objects. It's a strict rule that any given object either belong to the main list, or one of the other lists.
In general, the main object contains a master list of objects. Further, this main object also has its own concept of grouping these objects together into any separate arbitrary list.
I'd like to be able to query a list of those objects which are not currently a part of any of the other lists. I can naturally assume that I can synchronize a dedicated list of these objects, but that's not how I need to approach this. Instead, at any given time, I need to be able to fetch a list of those objects which are NOT a part of any of those group lists.
Another way put, out of that big giant list of all possible objects, I need to be able to iterate one by one through those which are NOT a part of any of the other group lists. Identifying whether it's a part of one of those lists is easy. But how do I fetch a list of items which are NOT a part of any group?
Specifically, without creating a whole separate list. I intend to use this main list of objects, yet filter out those objects which are a part of any given sub-list of objects.
More specifically, I need to be able to traverse through the list of objects which are not a part of any other list. I'd hate to keep track of a totally separate "ugrouped" list. I'd rather use the main list, and iterate each object in order in the list, while skipping over those objects which are part of the sub-lists.
For example, let's say I have a master list of 100 widgets. Only 30 of those have been categorized into some specific group list. The other 70 objects need to still be accessible by querying a list.
I'm looking for a loop something like...
for X := 0 to UngroupedObjectCount-1 do begin
O:= UngroupedObjectByIndex[X];
//TODO: Do something with O
end;