char_type_ofint_type_ofcategory_of
The header <boost/iostreams/categories.hpp> contains category tags for classifying models of the various Filter and Device concepts. The header <boost/iostreams/traits.hpp> contains the definitions of the metafunctions char_type_of and category, used to associate two fundamental types with each model of one the Filter or Device concepts:
The type of characters which a Filter or Device reads or writes.
A tag structure which the Iostreams library relies on to determine which operations a Filter or Device supports. It indicates, for a given type T:
T is a Filter or a Device
T
T implements
Its function is similar to the iterator_category member of std::iterator_traits.[1] Types which serve as categories are called category tags.
<boost/iostreams/categories.hpp><boost/iostreams/traits.hpp>char_type_ofMetafunction associating a character type to each Filter or Device type. Although char_type_of is designed to be specialized for new Filter and Device types, the default implementation should be suitable for most purposes.
namespace boost { namespace iostreams { template<typename T> struct char_type_of { typedef see below type; }; } } // End namespace boost::io
| T | - | A model of one of the Filter or Device concepts |
io_traits::typetypedef see below char_type;
The value of the nested type type depends on the template parameter T as follows:
T | char_type |
|---|---|
Sepcialization of std::back_insert_iterator |
The value_type of the iterator's container_type |
| All other types | T::char_type |
int_type_ofMetafunction associating an integral type to each Filter or Device type. Although int_type_of is designed to be specialized for new Filter and Device types, the default implementation should be suitable for most purposes.
namespace boost { namespace iostreams { template<typename T> struct int_type_of { typedef see below type; }; } } // End namespace boost::io
| T | - | A model of one of the Filter or Device concepts |
io_traits::typetypedef see below char_type;
Equal to std::char_traits<char_type>::int_type, where char_type is char_type_of<T>::type.
category_ofMetafunction associating a category tag to each Filter or Device type. Although category is designed to be specialized for new Filter and Device types, the default implementation should be suitable for most purposes.
namespace boost { namespace iostreams { template<typename T> struct category_of { typedef see below type; }; } } // End namespace boost::io
| T | - | A model of one of the Filter or Device concepts |
category::typetypedef see below type;
The value of the nested type type depends on the template parameter T as follows:
For more information, see <boost/iostreams/traits.hpp>.
In addition to the various mode tags, the header <boost/iostreams/categories.hpp> provides the category tags shown in the following table. To produce a new category tag which combines several existing tags, simply define a struct extending the existing tags. E.g.,
struct category
: seekable,
filter_tag,
localizable_tag
{ };
This defines a category tag representing Seekable, Localizable Filters.
| Tag | Description |
|---|---|
filter_tag |
Indicates that a type models Filter |
device_tag |
Indicates that a type models Device |
closable_taglocalizable_tagdirect_tagpeekable_tagmultichar_tag
|
Used to indicate optional behavior implemented by a Filter or Device type |
source_tagsink_tagbidirectional_device_tagseekable_device_taginput_filter_tagoutput_filter_tagbidirectional_filter_tagseekable_filter_tagmultichar_input_filter_tagmultichar_output_filter_tagmultichar_bidirectional_filter_tagmultichar_seekable_filter_tag
|
Convenience tags for defining models of the various Filter and Device refinements |
istream_tagostream_tagiostream_tagstreambuf_tag
|
Used internally to distinguish standard stream and stream buffer types |
insert_iterator_tag |
Used internally to distinguish specialization of std::back_insert_iterator |
[1][ISO] 24.3.1. See Tag Dispatching for a discussion.
Revised 20 May 2004
© Copyright Jonathan Turkanis 2004
Use modification and distribution are subject to the Boost Software License Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)