OListStreamAllocator Class Reference

An stream/stream-buffer output allocator with DynamicList-like storage. More...

Inheritance diagram for OListStreamAllocator:
[legend]
Collaboration diagram for OListStreamAllocator:
[legend]

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
 
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...
 

Detailed Description

An stream/stream-buffer output allocator with DynamicList-like storage.

Definition at line 64 of file OListStream.H.

Member Typedef Documentation

◆ stream_type

typedef std::ostream stream_type
protected

Definition at line 266 of file OListStream.H.

Constructor & Destructor Documentation

◆ OListStreamAllocator() [1/3]

OListStreamAllocator ( size_t  nbytes = 512)
inlineprotected

Default construct, with initial reserved number of bytes.

Definition at line 278 of file OListStream.H.

◆ OListStreamAllocator() [2/3]

OListStreamAllocator ( List< char > &&  buffer)
inlineprotected

Move construct from List.

Definition at line 285 of file OListStream.H.

◆ OListStreamAllocator() [3/3]

OListStreamAllocator ( DynamicList< char, SizeMin > &&  buffer)
inlineprotected

Move construct from DynamicList.

Definition at line 293 of file OListStream.H.

Member Function Documentation

◆ printBufInfo()

void printBufInfo ( Ostream os) const
inlineprotected

Definition at line 302 of file OListStream.H.

References OListStreamAllocator::buf_, and os().

Here is the call graph for this function:

◆ list() [1/2]

const UList< char > list ( ) const
inline

Const UList access to the characters written (shallow copy).

Definition at line 314 of file OListStream.H.

References OListStreamAllocator::buf_.

◆ list() [2/2]

UList< char > list ( )
inline

Non-const UList access to the characters written (shallow copy).

Definition at line 320 of file OListStream.H.

References OListStreamAllocator::buf_.

◆ capacity()

label capacity ( ) const
inline

The current list output capacity.

Definition at line 326 of file OListStream.H.

References OListStreamAllocator::buf_.

◆ size()

label size ( ) const
inline

The current output position in the buffer, which is also the addressed list size

Definition at line 333 of file OListStream.H.

References OListStreamAllocator::buf_.

◆ reserve()

void reserve ( const std::streamsize  n)
inline

Reserve output space for at least this amount.

Definition at line 339 of file OListStream.H.

References OListStreamAllocator::buf_, and n.

◆ setBlockSize()

void setBlockSize ( int  n)
inline

Adjust block size for output.

Definition at line 350 of file OListStream.H.

References OListStreamAllocator::buf_, and n.

◆ swap() [1/2]

void swap ( List< char > &  other)
inline

Transfer list contents to other List.

Definition at line 356 of file OListStream.H.

References OListStreamAllocator::buf_.

◆ swap() [2/2]

void swap ( DynamicList< char, SizeMin > &  other)
inline

Transfer list contents to a DynamicList.

Definition at line 363 of file OListStream.H.

References OListStreamAllocator::buf_.

◆ shrink()

void shrink ( )
inline

Shrink to addressed space, should not affect stream.

Definition at line 369 of file OListStream.H.

References OListStreamAllocator::buf_.

◆ clearStorage()

void clearStorage ( )
inline

Clear storage.

Definition at line 375 of file OListStream.H.

References OListStreamAllocator::buf_, and OListStreamAllocator::stream_.

◆ rewind()

void rewind ( )
inline

Move to buffer start, clear errors.

Definition at line 382 of file OListStream.H.

References OListStreamAllocator::buf_, and OListStreamAllocator::stream_.

Referenced by OListStream::rewind().

Here is the caller graph for this function:

Member Data Documentation

◆ buf_

◆ stream_

stream_type stream_
protected

The stream.

Definition at line 272 of file OListStream.H.

Referenced by OListStreamAllocator::clearStorage(), and OListStreamAllocator::rewind().


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