1 TChunkyTieredTextBuffer buffer(OutputTextStream()); 2 buffer.PushTier(TTieredText::kGeneral); 3 buffer << "TSampleObjectBaseTest::Test()\n"; 4 buffer.PushTier(TTieredText::kNormal); 5 buffer << " fTextOption = "; 6 7 if (fTextOption) 8 buffer << *fTextOption; 9 else 10 buffer << "NIL"; 11 buffer << "\n"; 12 buffer << " TextInBuffer = " << TextInBuffer << "\n"; 13 buffer << " myText2 = " << myText2 << "\n"; 14 buffer.PopTier(); 15 buffer.PopTier(); 16 // You can flush the buffer at any time by calling Flush 17 buffer.Flush();
Line number 2 sets the tier to General for subsequent lines.
Line number 4 sets the tier to Normal for subsequent lines.
Line number 14 pops the tier back to General.
Line number 15 pops the tier back to the level set before line 2.
When you destroy the buffer object, all of the text is flushed to the object's parent. If any other TChunkyTieredTextBuffer object is flushing its text, the thread containing buffer is blocked when the buffer object attempts to flush
its text.