Advanced Tools Module User’s Guide : PART II Advanced Tools Module Packages : Chapter 3 The Streams Package : The Stream Families
The Stream Families
The Streams package has five different stream families:
Binary streams read and write binary data (8 bits). They allow operations on a single byte or on a group of bytes.
Narrow character streams read and write narrow characters (C++ type char). They allow operations on a single narrow character or on a narrow string.
Unicode character streams read and write Unicode characters (16 bits). They include operations on a single Unicode character or on a group of Unicode characters.
Wide character streams read and write wide characters. They include operations on a single wide character or on a group of wide characters. Wide characters are stored using the C++ type wchar_t. The size is platform-dependent.
Data streams read and write C++ base types, such as bool, int, and float. They include operations on a single element or on a group of elements.
Some concrete classes can be used by themselves, but often they are chained to other stream elements in a processing stream. For instance, each stream family has a synchronized stream that synchronizes individual streaming operations in a multithreaded environment. The synchronized streams take a handle to the next processing element when constructed. Then each operation invoked on the synchronized stream locks an internal mutex and is forwarded on to the next processing stream element.
For more information on the stream families and their classes, see “The Streams Package Classes.”
Memory Streams
The binary, narrow character, Unicode character, and wide character stream families include memory streams. You can use memory streams to avoid performance problems that occur when the internal buffer needs to be resized, which requires data to be copied. The memory streams use small linked buffers as internal storage.
Interpackage Dependencies
The Streams package depends on the Smart Pointer, Synchronization, Execution Tracing, and Thread-compatible Exception packages of the Advanced Tools Module.