Vowpal Wabbit
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions
VW::io Namespace Reference

Namespaces

namespace  details
 

Classes

class  logger
 
class  noop_output_streambuf
 
class  owning_ostream
 
class  reader
 
class  socket
 
class  writer
 
class  writer_stream_buf
 

Typedefs

using write_func_t = ssize_t(*)(void *, const char *, size_t)
 
using logger_output_func_t = void(*)(void *, VW::io::log_level, const std::string &)
 
using logger_legacy_output_func_t = void(*)(void *, const std::string &)
 

Enumerations

enum class  output_location { STDOUT , STDERR , COMPAT }
 
enum class  log_level {
  TRACE_LEVEL = 0 , DEBUG_LEVEL = 1 , INFO_LEVEL = 2 , WARN_LEVEL = 3 ,
  ERROR_LEVEL = 4 , CRITICAL_LEVEL = 5 , OFF_LEVEL = 6
}
 

Functions

std::string strerror_to_string (int error_number)
 
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< writercreate_custom_writer (void *context, write_func_t write_func)
 
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)
 
output_location get_output_location (const std::string &name)
 
log_level get_log_level (const std::string &level)
 
logger create_default_logger ()
 
logger create_null_logger ()
 
logger create_custom_sink_logger (void *context, logger_output_func_t func)
 
logger create_custom_sink_logger_legacy (void *context, logger_legacy_output_func_t func)
 

Typedef Documentation

◆ logger_legacy_output_func_t

using VW::io::logger_legacy_output_func_t = typedef void (*)(void*, const std::string&)

◆ logger_output_func_t

using VW::io::logger_output_func_t = typedef void (*)(void*, VW::io::log_level, const std::string&)

◆ write_func_t

using VW::io::write_func_t = typedef ssize_t (*)(void*, const char*, size_t)

Enumeration Type Documentation

◆ log_level

enum class VW::io::log_level
strong
Enumerator
TRACE_LEVEL 
DEBUG_LEVEL 
INFO_LEVEL 
WARN_LEVEL 
ERROR_LEVEL 
CRITICAL_LEVEL 
OFF_LEVEL 

◆ output_location

enum class VW::io::output_location
strong
Enumerator
STDOUT 
STDERR 
COMPAT 

Function Documentation

◆ create_buffer_view()

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

◆ create_custom_sink_logger()

logger VW::io::create_custom_sink_logger ( void *  context,
logger_output_func_t  func 
)

◆ create_custom_sink_logger_legacy()

logger VW::io::create_custom_sink_logger_legacy ( void *  context,
logger_legacy_output_func_t  func 
)

◆ create_custom_writer()

std::unique_ptr< writer > VW::io::create_custom_writer ( void *  context,
write_func_t  write_func 
)

◆ create_default_logger()

logger VW::io::create_default_logger ( )

◆ create_null_logger()

logger VW::io::create_null_logger ( )

◆ create_vector_writer()

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.

◆ get_log_level()

log_level VW::io::get_log_level ( const std::string &  level)

◆ get_output_location()

output_location VW::io::get_output_location ( const std::string &  name)

◆ open_compressed_file_reader()

std::unique_ptr< reader > VW::io::open_compressed_file_reader ( const std::string &  file_path)

◆ open_compressed_file_writer()

std::unique_ptr< writer > VW::io::open_compressed_file_writer ( const std::string &  file_path)

◆ open_compressed_stdin()

std::unique_ptr< reader > VW::io::open_compressed_stdin ( )

◆ open_compressed_stdout()

std::unique_ptr< writer > VW::io::open_compressed_stdout ( )

◆ open_file_reader()

std::unique_ptr< reader > VW::io::open_file_reader ( const std::string &  file_path)

◆ open_file_writer()

std::unique_ptr< writer > VW::io::open_file_writer ( const std::string &  file_path)

◆ open_stdin()

std::unique_ptr< reader > VW::io::open_stdin ( )

◆ open_stdout()

std::unique_ptr< writer > VW::io::open_stdout ( )

◆ strerror_to_string()

std::string VW::io::strerror_to_string ( int  error_number)

◆ wrap_socket_descriptor()

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