Functors

Because of the vast amount of data processing Qoole-AID will produce, "functors" will be used to (hopefully) eliminate the excessive code reproduced with sifting through parameterized linked lists. While functors will assuredly be used elsewhere in the code, their primary intended implementation and use is with linked list iterators.

By allowing functors to be dynamically assigned to list iterators, they eliminate code often used to determine if an element in the list qualifies for the current operation. A good example of this is during a constructive solid geometry operation. Some context objects may not support or allow CSG operations to be performed on them which would mean that all code which performs a CSG operation would need to perform that check before proceeding with the operation. Using a functor eliminates duplication of that code by not only implementing it in a single location but generically integrating the check within the list itself.

There are several pitfalls associated with having functors integrated into the list iterator. For every piece of code which uses iterators to operate on lists, the functor but be set or cleared before any operations take place. Knowing this ahead of time however alerts the developer to ensure that the correct construction method is used to initialize the iterator.