Vowpal Wabbit
Namespaces | Classes | Functions
VW::io Namespace Reference

Namespaces

 details
 

Classes

struct  reader
 
struct  socket
 
struct  writer
 

Functions

std::unique_ptr< writeropen_file_writer (const std::string &file_path)
 
std::unique_ptr< readeropen_file_reader (const std::string &file_path)
 
std::unique_ptr< writeropen_compressed_file_writer (const std::string &file_path)
 
std::unique_ptr< readeropen_compressed_file_reader (const std::string &file_path)
 
std::unique_ptr< readeropen_compressed_stdin ()
 
std::unique_ptr< writeropen_compressed_stdout ()
 
std::unique_ptr< readeropen_stdin ()
 
std::unique_ptr< writeropen_stdout ()
 
std::unique_ptr< socketwrap_socket_descriptor (int fd)
 
std::unique_ptr< writercreate_vector_writer (std::shared_ptr< std::vector< char >> &buffer)
 
std::unique_ptr< readercreate_buffer_view (const char *data, size_t len)
 

Function Documentation

std::unique_ptr<reader> VW::io::create_buffer_view ( const char *  data,
size_t  len 
)

Creates a view over a buffer. This does not take ownership of or copy the buffer. Therefore it is very important the buffer itself outlives this reader object.

Parameters
databeginning of buffer
lenlength of buffer
std::unique_ptr<writer> VW::io::create_vector_writer ( std::shared_ptr< std::vector< char >> &  buffer)
Parameters
buffera shared pointer is required to ensure the buffer remains alive while in use. Passing this in allows callers to retrieve the results of the write operations taken on this buffer.
std::unique_ptr<reader> VW::io::open_compressed_file_reader ( const std::string &  file_path)
std::unique_ptr<writer> VW::io::open_compressed_file_writer ( const std::string &  file_path)
std::unique_ptr<reader> VW::io::open_compressed_stdin ( )
std::unique_ptr<writer> VW::io::open_compressed_stdout ( )
std::unique_ptr<reader> VW::io::open_file_reader ( const std::string &  file_path)
std::unique_ptr<writer> VW::io::open_file_writer ( const std::string &  file_path)
std::unique_ptr<reader> VW::io::open_stdin ( )
std::unique_ptr<writer> VW::io::open_stdout ( )
std::unique_ptr<socket> VW::io::wrap_socket_descriptor ( int  fd)
Parameters
fdthe file descriptor of the socket. Will take ownership of the resource.
Returns
socket object which allows creation of readers or writers from this socket