Definitions
The stream families use the handle-body idiom. Concrete stream classes are called only through handle classes, which preserves value semantics. The stream body classes cannot be called directly. Most concrete streams accept a handle to another stream through their constructors. Requests to the other stream are forwarded through the handle.
The stream families include a common set of stream elements:
*Stream handle classes
These define the interface for the stream user.
*Stream abstract body classes
These classes define the interface that is required from any stream concrete implementation.
*Filtered streams
These are abstract classes that inherit from the abstract stream body classes and implement support for the stream cascading mechanism. Concrete stream classes that support stream cascading inherit from a filtered stream.
*Synchronized streams
These are concrete classes that inherit from a filtered stream and include thread safety at the single operation level.
*Guarded streams
These are concrete classes that inherit from a filtered stream and include thread safety for a group of operations. The guarded streams are used in combination with the synchronized streams, because they use the synchronized stream’s internal mutex.
*Buffered streams (common to all families except the data stream family)
Buffered streams are concrete classes that inherit from a filtered stream and implement a simple buffering mechanism.
The data stream family does not possess a buffered stream because data streams convert data to one of the other stream family data types, which can use its own buffered stream.