Back to Arangodb

Function Template invert

3rdParty/boost/1.78.0/libs/iostreams/doc/functions/invert.html

3.12.9.13.4 KB
Original Source

Function Template invert

DescriptionHeadersReference


Description

The class template inverse is an adapter which transforms an InputFilter into an OutputFilter or vice versa. The function template invert is an object generator which when passed a Filter returns a instance of an appropriate specialization of inverse.

Given an InputFilter f, the inverse of f is Multi-CharacterOutputFilter whose member function write is implemented as follows. Given a Sinksnk and a character type buffer s of length n, we

  • construct a Source based on the buffer s and compose it with f to form a Source, then
  • repeatedly read sequences of character types from the composite Source and write them to snk until the buffer s is exhausted.

Similarly, given an OutputFilterf, the inverse of f is Multi-CharacterInputFilter whose member function read is implemented as follows. Given a Sourcesrc and a character type buffer s of length n, we

  • construct a Sink based on the buffer s and compose it with f to form a Sink, then
  • repeatedly read sequences of character types from src and write them to the composite Sink until the buffer s is full.

The mode of a specialization of inverse is equal to output if the mode of the underlying filter refines input, and to input otherwise.

Headers

<boost/iostreams/invert.hpp>

Reference

Synopsis

namespaceboost {namespaceiostreams {template<typename[Filter](#inverse_template_params)>class[inverse](#inverse){public:typedeftypename[char\_type\_of](../guide/traits.html#char_type_of_ref)<Filter>::type char_type;typedefsee abovemode;[inverse](#inverse_ctor)(constFilter& filter);// Filter member functions};template<typename[Filter](#invert_template_params)>[inverse](#inverse)<Filter>[invert](#invert)(constFilter& filter);

} } // End namespace boost::io

Class Template inverse

Template parameters

| | | | Filter | - | A model of Filter |

inverse::inverse

inverse(constFilter& filter);

Constructs an instance of inverse based on the given filter.

Function Template invert

template<typenameFilter>
inverse<Filter> invert(constFilter& filter);

Template parameters

| | | | Filter | - | A model of Filter |

Constructs an instance of an appropriate specialization of inverse based on the given filter.


Copyright 2008 CodeRage, LLC
Copyright 2004-2007 Jonathan Turkanis

Distributed under 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)