/* Copyright (c) by respective owners including Yahoo!, Microsoft, and individual contributors. All rights reserved. Released under a BSD (revised) license as described in the file LICENSE. */ #include "io_buf.h" #include namespace VW { /// /// IO Buffer keeping data in memory. Used by VowpalWabbit::Reload. /// class clr_io_memory_buf : public io_buf { private: std::vector m_data; std::vector::const_iterator m_iterator; public: /// /// Initializes a new instance. /// clr_io_memory_buf(); virtual int open_file(const char* name, bool stdin_off, int flag = READ); virtual void reset_file(int f); virtual ssize_t read_file(int f, void* buf, size_t nbytes); virtual size_t num_files(); virtual ssize_t write_file(int file, const void* buf, size_t nbytes); virtual bool compressed(); virtual bool close_file(); }; }