[MOAB-dev] r3846 - MOAB/trunk/src
Jason Kraftcheck
kraftche at cae.wisc.edu
Wed May 5 14:07:16 CDT 2010
Tim Tautges wrote:
> Please make sure this fits with the code in Interface::list_entities and
> Range::print (i.e. there's no duplicated functionality between the
> three), so it's clear what should get called for debug output.
>
Well, to combine the two Range::print would have to do all of its IO calls
through a DebugOutput instance so that the DebugOutput instance has the
opportunity to scan the output stream for newline characters. If
Range::print were given an optional argument specifying a DebugOutput
instance to print to instead of whatever it does now, then the DebugOutput
method for printing ranges could, in theory, be removed. However, there's
still the issue of formatting. Range::print() prints one range pair per
line. This is nice formatting when invoking the print() method from in a
debugger. DebugOutput prints the whole range in a more compact form on a
single line, which is more convenient when viewing large amounts of debug
output, potentially interleaved from multiple processes. We could add
another optional argument to control the output format, but that's just
confusing. IMO, it'd be better to have multiple functions (perhaps with a
common underlying implementation.) However, all of this would add a lot of
complexity to Range::print. And its only 15-20 lines of code to output an
Range with nice formatting.
- jason
More information about the moab-dev
mailing list