Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
OListStreamAllocator Class Reference

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

Inheritance diagram for OListStreamAllocator:
Inheritance graph
[legend]
Collaboration diagram for OListStreamAllocator:
Collaboration graph
[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
 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...
 

Detailed Description

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

Definition at line 60 of file OListStream.H.

Member Typedef Documentation

◆ stream_type

typedef std::ostream stream_type
protected

Definition at line 300 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 318 of file OListStream.H.

◆ OListStreamAllocator() [2/3]

OListStreamAllocator ( List< char > &&  buffer)
inlineprotected

Move construct from List.

Definition at line 327 of file OListStream.H.

◆ OListStreamAllocator() [3/3]

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

Move construct from DynamicList.

Definition at line 337 of file OListStream.H.

Member Function Documentation

◆ printBufInfo()

void printBufInfo ( Ostream os) const
inlineprotected

Definition at line 346 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 360 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 368 of file OListStream.H.

References OListStreamAllocator::buf_.

◆ capacity()

label capacity ( ) const
inline

The current list output capacity.

Definition at line 376 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 385 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 393 of file OListStream.H.

References OListStreamAllocator::buf_, and n.

◆ setBlockSize()

void setBlockSize ( int  n)
inline

Adjust block size for output.

Definition at line 406 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 414 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 423 of file OListStream.H.

References OListStreamAllocator::buf_.

◆ shrink()

void shrink ( )
inline

Shrink to addressed space, should not affect stream.

Definition at line 431 of file OListStream.H.

References OListStreamAllocator::buf_.

◆ clearStorage()

void clearStorage ( )
inline

Clear storage.

Definition at line 439 of file OListStream.H.

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

◆ rewind()

void rewind ( )
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().

Here is the caller graph for this function:

Member Data Documentation

◆ buf_

dynbuf buf_
protected

◆ stream_

stream_type stream_
protected

The stream.

Definition at line 310 of file OListStream.H.

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


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