I have been finding myself using the same design pattern more and more often lately, and I'm thinking of building a little class to carry around with me and implement it (or, maybe not, 'cause it's so easy).
The design pattern is one of keeping track of and enumerating all objects of a given class. I use this for implementing menus (so I can find all the menu lines), comm-channel listeners (so I can send incoming messages to all of them), etc.
Currently I implement these with a linked list. Since I'm generally doing the work in the embedded world, and since that means that nearly every object I create gets instantiated at boot-up and never gets destroyed, it's often a "write-only" list.
So -- anyone have a name for this thingie?
Thanks.