1 // (C) Copyright Jonathan Turkanis 2003.
2 // Distributed under the Boost Software License, Version 1.0. (See accompanying
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
5 // See http://www.boost.org/libs/iostreams for documentation.
7 // Contains category and mode tags for classifying filters, devices and
8 // standard stream and stream buffers types.
10 #ifndef BOOST_IOSTREAMS_CATEGORIES_HPP_INCLUDED
11 #define BOOST_IOSTREAMS_CATEGORIES_HPP_INCLUDED
13 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
17 namespace boost { namespace iostreams {
19 //------------------Tags for dispatch according to i/o mode-------------------//
22 namespace detail { struct two_sequence : virtual any_tag { }; }
23 namespace detail { struct random_access : virtual any_tag { }; }
24 namespace detail { struct one_head : virtual any_tag { }; }
25 namespace detail { struct two_head : virtual any_tag { }; }
26 struct input : virtual any_tag { };
27 struct output : virtual any_tag { };
28 struct bidirectional : virtual input, virtual output, detail::two_sequence { };
29 struct dual_use : virtual input, virtual output { }; // Pseudo-mode.
30 struct input_seekable : virtual input, virtual detail::random_access { };
31 struct output_seekable : virtual output, virtual detail::random_access { };
33 : virtual input_seekable,
34 virtual output_seekable,
38 : virtual input_seekable,
39 virtual output_seekable,
42 struct bidirectional_seekable
43 : input_seekable, output_seekable,
44 bidirectional, detail::two_head
47 //------------------Tags for use as i/o categories----------------------------//
49 struct device_tag : virtual any_tag { };
50 struct filter_tag : virtual any_tag { };
53 // Tags for optional behavior.
56 struct peekable_tag : virtual any_tag { }; // Devices.
57 struct closable_tag : virtual any_tag { };
58 struct flushable_tag : virtual any_tag { };
59 struct localizable_tag : virtual any_tag { };
60 struct optimally_buffered_tag : virtual any_tag { };
61 struct direct_tag : virtual any_tag { }; // Devices.
62 struct multichar_tag : virtual any_tag { }; // Filters.
64 struct source_tag : device_tag, input { };
65 struct sink_tag : device_tag, output { };
66 struct bidirectional_device_tag : device_tag, bidirectional { };
67 struct seekable_device_tag : virtual device_tag, seekable { };
69 struct input_filter_tag : filter_tag, input { };
70 struct output_filter_tag : filter_tag, output { };
71 struct bidirectional_filter_tag : filter_tag, bidirectional { };
72 struct seekable_filter_tag : filter_tag, seekable { };
73 struct dual_use_filter_tag : filter_tag, dual_use { };
75 struct multichar_input_filter_tag
79 struct multichar_output_filter_tag
83 struct multichar_bidirectional_filter_tag
85 bidirectional_filter_tag
87 struct multichar_seekable_filter_tag
91 struct multichar_dual_use_filter_tag
97 // Tags for standard streams and streambufs.
100 struct std_io_tag : virtual localizable_tag { };
102 : virtual input_seekable,
104 virtual peekable_tag,
108 : virtual output_seekable,
110 virtual peekable_tag,
114 : seekable_device_tag,
119 : seekable_device_tag,
123 struct stringstream_tag
136 struct linked_tag : streambuf_tag { };
138 } // End namespace detail.
140 } } // End namespaces iostreams, boost.
142 #endif // #ifndef BOOST_IOSTREAMS_CATEGORIES_HPP_INCLUDED