From: John P. <pet...@cf...> - 2007-11-07 16:55:08
|
Roy Stogner writes: > > Reading xdr_io.C scared me, and adding yet-another-case to it scares > me too. But it does seem like getting rid of the element blocks would > make processor-wise block I/O easier. XdrIO is a good example of how code gets cobbled together over time. It might be possible to clean it up by replacing all the if (orig_type == XdrIO::DEAL) ... else if (orig_type == XdrIO::MGF) ... else if (orig_type == XdrIO::LIBM) ... bits with a family of subclasses derived from XdrIO and virtual function calls. However, this would be a thankless and error-prone job and the sheer number of tiny new virtual functions needed (even though they would be in a private interface) might make the resulting code even harder to understand! TLDR version: Moving away from (but still keeping intact for legacy use) the xda format, and developing a new one which works in parallel is the way to go! -John |