hamigaki.png

前のページ 上に戻る ホーム 次のページ

Class template lazy_restriction

hamigaki::iostreams::lazy_restriction —

Synopsis

template<typename Device> 
class lazy_restriction {
public:
  // types
  typedef boost::iostreams::char_type_of<Device>::type char_type;

  // construct/copy/destruct
  lazy_restriction(Device&, boost::iostreams::stream_offset, 
                   boost::iostreams::stream_offset = -1);

  // Boost.Iostreams implementation
  std::streamsize read(char_type*, std::streamsize);
  std::streamsize write(const char_type*, std::streamsize);
  std::streampos seek(boost::iostreams::stream_offset, std::ios_base::seekdir);
};

// creation
template<typename Device> 
  lazy_restriction<Device> 
  lazy_restrict(Device&, boost::iostreams::stream_offset, 
                boost::iostreams::stream_offset = -1);

Description

lazy_restrictionboost::iostreams::restrictionの変種である。restrictionとの違いは、

  • オフセットの基準はストリームの先頭である

  • オフセット位置へのシークは、実際にストリームにアクセスするまで遅延される

  • ストリームのコピーを行わず、ポインタを保持する

である。

モデルとなるコンセプト:SeekableSource(DeviceSeekableSourceである場合), SeekableSink(DeviceSeekableSinkである場合)

lazy_restriction construct/copy/destruct

  1. lazy_restriction(Device& dev, boost::iostreams::stream_offset off, 
                     boost::iostreams::stream_offset len = -1);

lazy_restriction Boost.Iostreams implementation

  1. std::streamsize read(char_type* s, std::streamsize n);
  2. std::streamsize write(const char_type* s, std::streamsize n);
  3. std::streampos 
    seek(boost::iostreams::stream_offset off, std::ios_base::seekdir way);

lazy_restriction creation

  1. template<typename Device> 
      lazy_restriction<Device> 
      lazy_restrict(Device& dev, boost::iostreams::stream_offset off, 
                    boost::iostreams::stream_offset len = -1);
    Returns: lazy_restriction<Device>(dev, off, len)
製作著作 © 2006, 2007 Takeshi Mouri

前のページ 上に戻る ホーム 次のページ