Turi Create  4.0
turi::fileio_impl::cache_stream_sink Class Reference

#include <core/storage/fileio/cache_stream_sink.hpp>

Public Member Functions

 cache_stream_sink (cache_id_type cache_id)
 
 ~cache_stream_sink ()
 Destructor. CLoses the stream.
 
std::streamsize write (const char *c, std::streamsize bufsize)
 
bool is_open () const
 
void close ()
 
std::streampos seek (std::streamoff off, std::ios_base::seekdir way)
 
bool good () const
 
bool bad () const
 
bool fail () const
 

Detailed Description

A boost::iostreams::sink concept implemented using cache_block as the underlying sink device.

Definition at line 24 of file cache_stream_sink.hpp.

Constructor & Destructor Documentation

◆ cache_stream_sink()

turi::fileio_impl::cache_stream_sink::cache_stream_sink ( cache_id_type  cache_id)
explicit

Construct the sink from a cache_id.

Intialize the underlying data sink, either the in memory array or the on disk cache file.

Member Function Documentation

◆ bad()

bool turi::fileio_impl::cache_stream_sink::bad ( ) const

Returns true if the stream is bad. See std::ios_base

◆ close()

void turi::fileio_impl::cache_stream_sink::close ( )

Closes all file handles

◆ fail()

bool turi::fileio_impl::cache_stream_sink::fail ( ) const

Returns true if a stream operation failed. See std::ios_base

◆ good()

bool turi::fileio_impl::cache_stream_sink::good ( ) const

Returns true if the stream is good. See std::ios_base

◆ is_open()

bool turi::fileio_impl::cache_stream_sink::is_open ( ) const

Returns true if the file is opened

◆ seek()

std::streampos turi::fileio_impl::cache_stream_sink::seek ( std::streamoff  off,
std::ios_base::seekdir  way 
)

Seeks to a different location. Will fail on compressed files.

◆ write()

std::streamsize turi::fileio_impl::cache_stream_sink::write ( const char *  c,
std::streamsize  bufsize 
)

Attempts to write bufsize bytes into the stream from the buffer. Returns the actual number of bytes written. Returns -1 on failure.


The documentation for this class was generated from the following file: