From: Thomas M. <tma...@ze...> - 2000-08-22 19:35:49
|
Thomas Matelich wrote: > SOMEClassInfo - I'm not sure exactly how this class will work but it > will contain the class name, a category/purpose, and (if possible, I > think it is) functions for creating instances of the class. I think > this would eliminate the need for base classes, like Karl's did. I've now decided that we need to support both paradigms. The first way to use SOMELib is for just loading "known" classes at runtime, either for keeping footprints small or for simplicity of changing the system. The other concept (which I'm more keen on) is use as a plugin library, where you may have multiple types of functionality for a certain purpose. This concept requires a base class to be used because we want variable functionality to implemented with virtual functions. My idea is that you would use the category to specify what the class is supposed to do, and do lookup based upon the category to see what base class to instantiate to. Example: data filtering. You would have a filter base class with a virtual function to override for the actual filtering. When a plugin is loaded with a Filter category, you would create a SOMEObject of the base filter type and use it to provide the special functionality. So my next question is, what about parameters for plugins? A smoothing filter could require a number of iterations (int) and a smoothing factor (float < 1) while a frequency filter would have a hi-pass and low-pass freqs, or something. How do we provide that capability? Does it go in SOMEClassInfo? Do we use scripting somehow? I don't know. -- Thomas O Matelich Senior Software Designer Zetec, Inc. sos...@us... tma...@ze... |