When I started this issue, I collected the functions in one place as you suggest
but I stopped half-way through. There were several things I didn't like about
this approach:
* The code for printing a class is separated from the class itself, so when you
add stuff to the class, you have to remember to also add it to the print
function in a different file.
* dump_task::dump_state_fdr(s) is less readable to me than s.dump_fdr() mostly
because of the explicit namespace.
* It is not clear which dump functions belong in this new file or where the
remaining dump functions should go. For example, what about CausalGraph::dump()?
The causal graph is returned by a method in TaskProxy just like GoalsProxy, so
does its dump method belong in dump_task? If not, where should it go?
I'm still not completely opposed to the idea of using functions but maybe its
better to have them in task_proxy.{h,cc} next to the classes they print?
|