Pol  Revision:cb584c9
Pol::Clib::ThreadedOFStreamWriter Class Reference

#include <streamsaver.h>

+ Inheritance diagram for Pol::Clib::ThreadedOFStreamWriter:

Public Member Functions

 ThreadedOFStreamWriter ()
 ofstream implementation with worker thread for file io More...
 ThreadedOFStreamWriter (std::ofstream *stream)
virtual ~ThreadedOFStreamWriter ()
virtual void flush () POL_OVERRIDE
virtual void flush_file () POL_OVERRIDE
virtual void init (const std::string &filepath) POL_OVERRIDE
- Public Member Functions inherited from Pol::Clib::StreamWriter
 StreamWriter ()
 BaseClass implements only writer operator logic. More...
virtual ~StreamWriter ()
fmt::Writer & operator() ()

Private Types

typedef message_queue< WriterPtrwriter_queue
typedef std::unique_ptr< fmt::Writer > WriterPtr

Private Member Functions

void start_worker ()

Private Attributes

writer_queue _msg_queue
std::ofstream * _stream
std::string _stream_name
std::list< WriterPtr_writers_hold
std::thread _writethread

Additional Inherited Members

- Protected Attributes inherited from Pol::Clib::StreamWriter
std::unique_ptr< fmt::Writer > _writer

Detailed Description

Definition at line 78 of file streamsaver.h.

Member Typedef Documentation

typedef std::unique_ptr<fmt::Writer> Pol::Clib::ThreadedOFStreamWriter::WriterPtr

Definition at line 80 of file streamsaver.h.

Constructor & Destructor Documentation

Pol::Clib::ThreadedOFStreamWriter::ThreadedOFStreamWriter ( )

ofstream implementation with worker thread for file io

Definition at line 121 of file streamsaver.cpp.

References start_worker().

Pol::Clib::ThreadedOFStreamWriter::ThreadedOFStreamWriter ( std::ofstream *  stream)

Definition at line 127 of file streamsaver.cpp.

References start_worker().

Pol::Clib::ThreadedOFStreamWriter::~ThreadedOFStreamWriter ( )

Definition at line 168 of file streamsaver.cpp.

References flush_file().

Member Function Documentation

void Pol::Clib::ThreadedOFStreamWriter::flush ( )
void Pol::Clib::ThreadedOFStreamWriter::flush_file ( )
void Pol::Clib::ThreadedOFStreamWriter::init ( const std::string &  filepath)

Implements Pol::Clib::StreamWriter.

Definition at line 173 of file streamsaver.cpp.

References _stream, and _stream_name.

void Pol::Clib::ThreadedOFStreamWriter::start_worker ( )

Member Data Documentation

writer_queue Pol::Clib::ThreadedOFStreamWriter::_msg_queue

Definition at line 94 of file streamsaver.h.

Referenced by flush(), flush_file(), and start_worker().

std::ofstream* Pol::Clib::ThreadedOFStreamWriter::_stream

Definition at line 93 of file streamsaver.h.

Referenced by flush_file(), init(), and start_worker().

std::string Pol::Clib::ThreadedOFStreamWriter::_stream_name

Definition at line 97 of file streamsaver.h.

Referenced by init().

std::list<WriterPtr> Pol::Clib::ThreadedOFStreamWriter::_writers_hold

Definition at line 96 of file streamsaver.h.

Referenced by flush(), and flush_file().

std::thread Pol::Clib::ThreadedOFStreamWriter::_writethread

Definition at line 95 of file streamsaver.h.

Referenced by flush_file(), and start_worker().

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