delegate invocation list, briefly

— based on http://www.ikriv.com/en/prog/info/dotnet/Delegates.html
An invocation list is a reverse singly linked list, with the last appended “single” as head. Like in hash table buckets, this is optimized for insertion. 

Invocation time — Since this is a singly linked list, we need recursion. Head node’s method (last appended) starts first, invoking 2nd-last-appended.

When you append [d1,d2, d3, d4] to an existing invocation list, system effectively adds d1, then adds d2… (Internally, it could do it faster with pointers.), so I call these d1, d2 .. items “single-method delegates”, or “singles”.

Note the link pointer between link nodes is named “PreviousNode”.

Remove() is by logical-equality, not by reference equality.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s