> What arguments do we want these to take? An EquationSystems& and > string as usual? I'd think a System& would be more elegant, except > that then when someone needed more than a bare-bones System (as > everyone does...) they'd have to downcast it to ImplicitSystem or > some such, whereas at least now we hide the ugly downcasts in > EquationSystems::get_system().
No need to pass any arguments (or do any casting)... they are creating these classes... and they can store whatever they want _in_ the class itself (including full pointers to the System, etc). This, to me is the real reason to do things this way... because then when you are managing multiple systems and equation systems all of the data can be kept in one place (in the class). Our software is a an object oriented system that uses libMesh... and our way around the draconian callback system is to store a pointer to our main object in the Parameters and the first thing we do in any callback is get the pointer out and make the same call on our object. If we could just implement a few virtual functions instead... it would be a lot cleaner. > >> The user could create a class for each action or put multiple functions in >> once class as shown above. That seems useful enough to be a reason to avoid >> functors. > > These effectively are functors, just with the work done in named > methods rather than operator()(). Being able to handle multiple > inheritance sanely (at least, as sanely as multiple inheritance ever > gets) is a minor point in favor of named methods. > > The only point in favor of operator()() is that it's what C++ generic > programming algorithms expect. And I can't think of any such that > we'd really want to apply to these functions. They're not > fine-grained enough for TBB, the stuff in <algorithm>, <functional> > and <numeric> doesn't really apply... anyone know of any boost > niftiness we'd be precluding? Definitely no need for Functors. Way too much code overhead since you need a separate one for each operation. I would rather stick with callbacks over Functors. Derek ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ Libmesh-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-devel
