Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:38:48

0001 /*
0002  * Defines the class template boost::iostreams::detail::device_adapter,
0003  * a convenience base class for device adapters.
0004  *
0005  * File:        boost/iostreams/detail/adapter/filter_adapter.hpp
0006  * Date:        Mon Nov 26 14:35:48 MST 2007
0007  * 
0008  * Copyright:   2007-2008 CodeRage, LLC
0009  * Author:      Jonathan Turkanis
0010  * Contact:     turkanis at coderage dot com
0011  *
0012  * Distributed under the Boost Software License, Version 1.0.(See accompanying 
0013  * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
0014  * 
0015  * See http://www.boost.org/libs/iostreams for documentation.
0016  */
0017 
0018 #ifndef BOOST_IOSTREAMS_DETAIL_DEVICE_ADAPTER_HPP_INCLUDED
0019 #define BOOST_IOSTREAMS_DETAIL_DEVICE_ADAPTER_HPP_INCLUDED
0020 
0021 #include <boost/iostreams/categories.hpp>
0022 #include <boost/iostreams/detail/call_traits.hpp>
0023 #include <boost/iostreams/detail/ios.hpp>
0024 #include <boost/iostreams/operations.hpp>
0025 #include <boost/iostreams/traits.hpp>
0026 #include <boost/static_assert.hpp>
0027 
0028 namespace boost { namespace iostreams { namespace detail {
0029 
0030 template<typename T>
0031 class device_adapter {
0032 private:
0033     typedef typename detail::value_type<T>::type value_type;
0034     typedef typename detail::param_type<T>::type param_type;
0035 public:
0036     explicit device_adapter(param_type t) : t_(t) { }
0037     T& component() { return t_; }
0038 
0039     void close() 
0040     {
0041         detail::close_all(t_);
0042     }
0043 
0044     void close(BOOST_IOS::openmode which) 
0045     { 
0046         iostreams::close(t_, which); 
0047     }
0048 
0049     bool flush() 
0050     { 
0051         return iostreams::flush(t_); 
0052     }
0053 
0054     template<typename Locale> // Avoid dependency on <locale>
0055     void imbue(const Locale& loc) { iostreams::imbue(t_, loc); }
0056 
0057     std::streamsize optimal_buffer_size() const 
0058     { return iostreams::optimal_buffer_size(t_); }
0059 public:
0060     value_type t_;
0061 };
0062 
0063 //----------------------------------------------------------------------------//
0064 
0065 } } } // End namespaces detail, iostreams, boost.
0066 
0067 #endif // #ifndef BOOST_IOSTREAMS_DETAIL_DEVICE_ADAPTER_HPP_INCLUDED