An stream/stream-buffer output allocator with DynamicList-like storage. More...
Public Member Functions | |
const UList< char > | list () const |
Const UList access to the characters written (shallow copy). More... | |
UList< char > | list () |
Non-const UList access to the characters written (shallow copy). More... | |
label | capacity () const |
The current list output capacity. More... | |
label | size () const |
The current output position in the buffer, which is also the addressed list size. More... | |
void | reserve (const std::streamsize n) |
Reserve output space for at least this amount. More... | |
void | setBlockSize (int n) |
Adjust block size for output. More... | |
void | swap (List< char > &other) |
Transfer list contents to other List. More... | |
template<int SizeMin> | |
void | swap (DynamicList< char, SizeMin > &other) |
Transfer list contents to a DynamicList. More... | |
void | shrink () |
Shrink to addressed space, should not affect stream. More... | |
void | clearStorage () |
Clear storage. More... | |
void | rewind () |
Move to buffer start, clear errors. More... | |
Protected Types | |
typedef std::ostream | stream_type |
Protected Member Functions | |
OListStreamAllocator (size_t nbytes=512) | |
Default construct, with initial reserved number of bytes. More... | |
OListStreamAllocator (List< char > &&buffer) | |
Move construct from List. More... | |
template<int SizeMin> | |
OListStreamAllocator (DynamicList< char, SizeMin > &&buffer) | |
Move construct from DynamicList. More... | |
void | printBufInfo (Ostream &os) const |
Protected Attributes | |
dynbuf | buf_ |
The stream buffer. More... | |
stream_type | stream_ |
The stream. More... | |
An stream/stream-buffer output allocator with DynamicList-like storage.
Definition at line 60 of file OListStream.H.
|
protected |
Definition at line 300 of file OListStream.H.
|
inlineprotected |
Default construct, with initial reserved number of bytes.
Definition at line 318 of file OListStream.H.
|
inlineprotected |
Move construct from List.
Definition at line 327 of file OListStream.H.
|
inlineprotected |
Move construct from DynamicList.
Definition at line 337 of file OListStream.H.
|
inlineprotected |
Definition at line 346 of file OListStream.H.
References OListStreamAllocator::buf_, and os().
|
inline |
Const UList access to the characters written (shallow copy).
Definition at line 360 of file OListStream.H.
References OListStreamAllocator::buf_.
|
inline |
Non-const UList access to the characters written (shallow copy).
Definition at line 368 of file OListStream.H.
References OListStreamAllocator::buf_.
|
inline |
The current list output capacity.
Definition at line 376 of file OListStream.H.
References OListStreamAllocator::buf_.
|
inline |
The current output position in the buffer, which is also the addressed list size.
Definition at line 385 of file OListStream.H.
References OListStreamAllocator::buf_.
|
inline |
Reserve output space for at least this amount.
Definition at line 393 of file OListStream.H.
References OListStreamAllocator::buf_, and n.
|
inline |
Adjust block size for output.
Definition at line 406 of file OListStream.H.
References OListStreamAllocator::buf_, and n.
|
inline |
Transfer list contents to other List.
Definition at line 414 of file OListStream.H.
References OListStreamAllocator::buf_.
|
inline |
Transfer list contents to a DynamicList.
Definition at line 423 of file OListStream.H.
References OListStreamAllocator::buf_.
|
inline |
Shrink to addressed space, should not affect stream.
Definition at line 431 of file OListStream.H.
References OListStreamAllocator::buf_.
|
inline |
Clear storage.
Definition at line 439 of file OListStream.H.
References OListStreamAllocator::buf_, and OListStreamAllocator::stream_.
|
inline |
Move to buffer start, clear errors.
Definition at line 448 of file OListStream.H.
References OListStreamAllocator::buf_, and OListStreamAllocator::stream_.
Referenced by OListStream::rewind().
|
protected |
The stream buffer.
Definition at line 305 of file OListStream.H.
Referenced by OListStreamAllocator::capacity(), OListStreamAllocator::clearStorage(), OListStreamAllocator::list(), OListStreamAllocator::printBufInfo(), OListStreamAllocator::reserve(), OListStreamAllocator::rewind(), OListStreamAllocator::setBlockSize(), OListStreamAllocator::shrink(), OListStreamAllocator::size(), and OListStreamAllocator::swap().
|
protected |
The stream.
Definition at line 310 of file OListStream.H.
Referenced by OListStreamAllocator::clearStorage(), and OListStreamAllocator::rewind().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.