I've blogged about a macro for collection classes. Briefly, the macro
adds new fields to a collection class corresponding to an enum being
added to the collection. This allows enums to be used as elements of a
collection without the annoyance of having to dereference their contents
in a switch - from within the class itself. It provides a single
instance injection as a by product.