benson@odi.com (Benson I. Margulies) (12/18/89)
In 2.0, ostream has two functions osfx and opfx that are used to give the stream control (for buffering purposes) before and after output. They aren't virtual. As per my previous message, I need to implement some specializations of ostream that are sensitive to line boundaries. osfx would serve my purposes fine -- if it were virtual. As it is, if I implement my own osfx, it isn't called when ostream::whatever does its thing, so its no use at all. I'm hesitant to add the "virtual", since this version will ship to our customers, and I'd hate to be InComPatIble. If the folks from AT&T would bless the addition of virtual in this spot, I could make the change with a clear conscience. -- Benson I. Margulies
jss@jra.ardent.com (12/22/89)
In article <1989Dec18.141217.19738@odi.com> benson@odi.com () writes: >In 2.0, ostream has two functions osfx and opfx that are used to give >the stream control (for buffering purposes) before and after output. >They aren't virtual. > >As per my previous message, I need to implement some specializations >of ostream that are sensitive to line boundaries. osfx would serve >my purposes fine -- if it were virtual. > What these functions do is check for special conditions inline and and then call out of line code to deal with these special conditions as necessary. Since all this involves private data it was not appropriate to specify exactly what they would have to do and it was therefore not appropriate to make them virtual. They are part of the public interface so that they can be called by user defined inserters. There is also the efficiency consideration, that making them virtual would have had a significant performance impact on the char inserter. As I suggested in another note, the best way to deal with this sort of thing within the iostream interface is to put the special handling into the streambuf rather than the ostream. It is possible to cause flush to be called on every character by making sure the streambuf always looks "full" even when there is still room in the arrays. Jerry Schwarz