A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/multi__source__file_8cpp_source.html below:

NCBI C++ ToolKit: src/objtools/writers/multi_source_file.cpp Source File

39 #include <condition_variable> 55 static

constexpr

size_t

s_reserved_buffers = 10;

56 static

constexpr

size_t

s_default_max_writers = 50;

57 static

constexpr

size_t

s_default_buffer_size = 64*1024;

59 using

TBuffersPool = TResourcePool<std::array<char, s_default_buffer_size>>;

60 static

TBuffersPool s_reused_buffers(s_reserved_buffers);

71  void

Open(std::ostream& o_stream);

78  return

m_filename_delayed;

86

std::shared_ptr<CMultiSourceOStreamBuf> NewStreamBuf();

92

std::deque<std::shared_ptr<CMultiSourceOStreamBuf>>

m_writers

;

93

std::atomic<size_t> m_max_writers = s_default_max_writers;

94

std::atomic<CMultiSourceOStreamBuf*>

m_head

;

97

std::condition_variable

m_cv

;

99

std::atomic<std::ostream*> m_ostream =

nullptr

;

114  void Dump

(std::ostream& ostr);

116

int_type

overflow

( int_type ch )

override

;

126

_other.m_buf =

nullptr

;

127

_MyBase::set_rdbuf(

m_buf

.get());

128

_other.set_rdbuf(

nullptr

);

134  if

(&_other ==

this

)

return

*

this

;

138

_MyBase::operator=(std::move(_other));

139  m_buf

= std::move(_other.m_buf);

141

_MyBase::set_rdbuf(

m_buf

.get());

142

_other.set_rdbuf(

nullptr

);

155

_MyBase::set_rdbuf(

nullptr

);

185  auto

_pptr = _MyBase::pptr();

186  auto

_pbase = _MyBase::pbase();

187  size_t size

= _pptr - _pbase;

189

ostr.write(_pbase,

size

);

208

setp(

nullptr

,

nullptr

);

209  return

_MyBase::overflow(ch);

223  auto

new_stream = std::make_unique<std::ofstream>();

224

new_stream->exceptions( ios::failbit | ios::badbit );

225

new_stream->open(filename);

233  throw

std::runtime_error(

"already open"

);

244  throw

std::runtime_error(

"stream is not open"

);

253  throw

std::runtime_error(

"already open"

);

269

std::unique_lock<std::mutex> lock(

m_mutex

);

270  m_cv

.wait(lock, [

this

]

289

std::unique_lock<std::mutex> lock(

m_mutex

);

290  m_cv

.wait(lock, [

this

]

303

std::shared_ptr<CMultiSourceOStreamBuf>

buf

;

305

std::unique_lock<std::mutex> lock(

m_mutex

);

306  m_cv

.wait(lock, [

this

]

312  throw

runtime_error(

"CMultiSourceWriter is not open"

);

314  buf

= std::make_shared<CMultiSourceOStreamBuf>(*

this

);

328  return

s_reused_buffers.Allocate();

336

std::unique_lock<std::mutex> lock(

m_mutex

);

337  m_cv

.wait(lock, [

this

, strbuf]

339  bool

is_head = strbuf ==

m_head

.load();

356

std::unique_lock<std::mutex> lock(

m_mutex

);

357  m_cv

.wait(lock, [

this

, strbuf]

359  bool

is_head = strbuf ==

m_head

.load();

388  m_impl

->OpenDelayed(filename);

405  return m_impl

->GetFilename();

413  return

{

m_impl

->NewStreamBuf()};

415  throw

std::runtime_error(

"CMultiSourceWriter is not configured"

);

421  return

std::make_unique<CMultiSourceOStream>(

m_impl

->NewStreamBuf());

423  throw

std::runtime_error(

"CMultiSourceWriter is not configured"

);

434  m_impl

->SetMaxWriters(num);

447  m_impl

= make_unique<CMultiSourceWriterImpl>();

CMultiSourceWriterImpl & m_parent

TBuffersPool::value_type TBuffer

std::atomic< int > m_leftover

~CMultiSourceOStreamBuf()

TBuffersPool::TUniqPointer TBufferPtr

CMultiSourceOStreamBuf(CMultiSourceWriterImpl &parent)

void Dump(std::ostream &ostr)

int_type overflow(int_type ch) override

CMultiSourceOStream & operator=(CMultiSourceOStream &&)

CMultiSourceOStream()=default

std::shared_ptr< CMultiSourceOStreamBuf > m_buf

const std::string & GetFilename() const

void CloseStreamBuf(CMultiSourceOStreamBuf *strbuf, int leftover)

std::unique_ptr< std::ostream > m_own_stream

std::atomic< size_t > m_max_writers

~CMultiSourceWriterImpl()

std::shared_ptr< CMultiSourceOStreamBuf > NewStreamBuf()

void SetMaxWriters(size_t num)

std::atomic< CMultiSourceOStreamBuf * > m_head

TBufferPtr AllocateBuffer()

CMultiSourceWriterImpl(CMultiSourceWriterImpl &&)=delete

std::deque< std::shared_ptr< CMultiSourceOStreamBuf > > m_writers

std::condition_variable m_cv

void Open(const std::string &filename)

TBuffersPool::TUniqPointer TBufferPtr

void OpenDelayed(const std::string &filename)

void FlushStreamBuf(CMultiSourceOStreamBuf *strbuf)

std::string m_filename_delayed

std::atomic< std::ostream * > m_ostream

CMultiSourceWriterImpl(const CMultiSourceWriterImpl &)=delete

std::unique_ptr< CMultiSourceWriterImpl > m_impl

const std::string & GetFilename() const

void OpenDelayed(const std::string &filename)

void Open(std::ostream &o_stream)

void SetMaxWriters(size_t num)

CMultiSourceOStream NewStream()

std::unique_ptr< CMultiSourceOStream > NewStreamPtr()

The NCBI C++ standard methods for dealing with std::string.

static const char * expected[]

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

#define NCBI_XOBJWRITE_EXPORT

double value_type

The numeric datatype used by the parser.

const struct ncbi::grid::netcache::search::fields::SIZE size


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4