This adds a second order functionality of temporary items in lists/arrays. When the subscription is dereferenced, the item is removed from the list. I wanted this for temporary event handlers for the "interrupt" and "terminate" linux process signals. This makes use of the Collection classes in a most utilitarian way and found a few places to upgrade.
1- TArraySubscription uses pass by reference and can do subscriptions with arrays and ArrayAccess objects.
2- TCollectionSubscription uses normal object references for ArrayAccess to prevent original variable manipulation
3- TEventSubscription use a TComponent and an event name.
Adds TArraySubscription (arrays & ArrayAccess, pass by reference), TCollectionSubscription (ArrayAccess, normal arguments w/o pass by reference), and TEventSubscription (for events in a TComponent).
Adds IPriorityCollection, IWeakCollection, and ICollectionFilter (for manipulating items for storage, like "weak" classes can make the objects WeakReference).
TMap::add returns the key for when the key is null and key is set on append.
TPriorityList::insertAt returns priority of the item.
Regression
unit tests for TArraySubscription, TCollectionSubscription, and TEventSubscription.
TArrayHelper for determining if an array is a list.
This adds a second order functionality of temporary items in lists/arrays. When the subscription is dereferenced, the item is removed from the list. I wanted this for temporary event handlers for the "interrupt" and "terminate" linux process signals. This makes use of the Collection classes in a most utilitarian way and found a few places to upgrade.
1- TArraySubscription uses pass by reference and can do subscriptions with arrays and ArrayAccess objects. 2- TCollectionSubscription uses normal object references for ArrayAccess to prevent original variable manipulation 3- TEventSubscription use a TComponent and an event name.