Re: The new "dispatcher" and plugins

al davis <[email protected]>
Newsgroups gmane.comp.gnu.gnucap.devel
Message-ID <[email protected]>
Adding more to it ...

Recall .. the code in the attached file is:
//------------
extern DISPATCHER<MODEL_CARD> model_dispatcher;
static MODEL_DIODE p1;
static DISPATCHER<MODEL_CARD>::INSTALL
p_D(&model_dispatcher, "D", &p1);
//---------------


Inside, the code to lookup this model looks something like this:
//---------------
// the name of the model I want is in the string "model_name"
....
const MODEL_CARD* proto = model_dispatcher[model_name];
// that's square brackets, like subscripting an array.
// we have the prototype now, I think
if (proto) {
    model = proto.clone();
}else{
    error("didn't find the model");
}
// Now "model" is a pointer to a new one we can play with.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.