A
Aleksandr Dubinskiy
Hello folks,
This question is a bit involved, so I am posting the code on the web,
instead of cutting and pasting it on the email.
http://www.cis.ohio-state.edu/~dubinski/Code/
I think the code is pretty clear, just there's a lot of it, so
I'll try to guide you thru it.
Here's the layout. There are 5 packages / namespaces:
Updater, Energizer, Converter, Proposal, and finally Diffuser
Energizer, Converter, and Updater are independent.
Proposal knows about all three of them, and Diffuser
knows about all other packages.
Start looking with Diffuser.
In DiffuserExt.h you can see the declarations for
classes APrime and MuCenter. You should notice that
the data memebers look similar, but are actually of
different template instantiations. Similarly in
DiffuserSF.h you will see the declarations for classes
Param, and Coeff, which have the same property.
Then if you look at the definitions for the
constructors of these classes (in DiffuserSF.cpp and DiffuserExt.cpp),
you'll see they're
almost identical in the feel and look.
And this is what I'm trying to take care of. I want to
be able to unify these classes "under one roof". I want
the diffuser interface to have 3 members: _prop,
_conv, and _upd. It's just that these are different
template instantiations, and they don't conform to the
same interface. I would like them to, but I don't see
how.
This becomes especially clear when you try to unify
Converters (see files TinyConverter.h and
Converters.h). Because of the templates, I don't see
how to make them conform to the same interface and
treat them uniformly. This is also begging for some creative design pattern,
but I am afraid I need handle the issue with the templates first.
Well, I hope this makes sense.
Does anybody see a nice solution here?
Alex
This question is a bit involved, so I am posting the code on the web,
instead of cutting and pasting it on the email.
http://www.cis.ohio-state.edu/~dubinski/Code/
I think the code is pretty clear, just there's a lot of it, so
I'll try to guide you thru it.
Here's the layout. There are 5 packages / namespaces:
Updater, Energizer, Converter, Proposal, and finally Diffuser
Energizer, Converter, and Updater are independent.
Proposal knows about all three of them, and Diffuser
knows about all other packages.
Start looking with Diffuser.
In DiffuserExt.h you can see the declarations for
classes APrime and MuCenter. You should notice that
the data memebers look similar, but are actually of
different template instantiations. Similarly in
DiffuserSF.h you will see the declarations for classes
Param, and Coeff, which have the same property.
Then if you look at the definitions for the
constructors of these classes (in DiffuserSF.cpp and DiffuserExt.cpp),
you'll see they're
almost identical in the feel and look.
And this is what I'm trying to take care of. I want to
be able to unify these classes "under one roof". I want
the diffuser interface to have 3 members: _prop,
_conv, and _upd. It's just that these are different
template instantiations, and they don't conform to the
same interface. I would like them to, but I don't see
how.
This becomes especially clear when you try to unify
Converters (see files TinyConverter.h and
Converters.h). Because of the templates, I don't see
how to make them conform to the same interface and
treat them uniformly. This is also begging for some creative design pattern,
but I am afraid I need handle the issue with the templates first.
Well, I hope this makes sense.
Does anybody see a nice solution here?
Alex