Advanced Multi-Physics (AMP)
On-Line Documentation
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
AMP::ParallelStreamBuffer Class Referencefinal

#include <PIO.h>

Inherits std::streambuf.

Public Types

enum  StreamOutputType : uint8_t {
  null = 0 , out = 1 , log = 2 , err = 4 ,
  out_log = 3 , err_log = 6
}
 

Public Member Functions

int overflow (int ch) override
 
 ParallelStreamBuffer (StreamOutputType type)
 
void reset ()
 
void setOutputStream (std::ofstream *stream)
 
void setOutputType (StreamOutputType type)
 
int sync () override
 
int underflow () override
 
std::streamsize xsputn (const char *text, std::streamsize n) override
 
virtual ~ParallelStreamBuffer ()
 

Private Member Functions

void reserve (size_t size)
 

Private Attributes

char * d_buffer
 
size_t d_buffer_size
 
size_t d_size
 
std::ofstream * d_stream
 
StreamOutputType d_type
 

Detailed Description

Class ParallelBuffer is a simple I/O stream utility that intercepts output from an ostream and redirects the output as necessary for parallel I/O. This class defines a stream buffer class for an ostream class.

Definition at line 19 of file PIO.h.

Member Enumeration Documentation

◆ StreamOutputType

Enumerator
null 
out 
log 
err 
out_log 
err_log 

Definition at line 22 of file PIO.h.

Constructor & Destructor Documentation

◆ ParallelStreamBuffer()

AMP::ParallelStreamBuffer::ParallelStreamBuffer ( StreamOutputType  type)
explicit

Create a parallel buffer class. The object will require further initialization to set up the I/O streams and prefix string.

Parameters
typeOutput type

◆ ~ParallelStreamBuffer()

virtual AMP::ParallelStreamBuffer::~ParallelStreamBuffer ( )
virtual

The destructor simply deallocates any internal data buffers. It does not modify the output streams.

Member Function Documentation

◆ overflow()

int AMP::ParallelStreamBuffer::overflow ( int  ch)
override

Write an overflow character into the parallel buffer (called from streambuf).

◆ reserve()

void AMP::ParallelStreamBuffer::reserve ( size_t  size)
inlineprivate

◆ reset()

void AMP::ParallelStreamBuffer::reset ( )

Clear the internal buffer's memory

◆ setOutputStream()

void AMP::ParallelStreamBuffer::setOutputStream ( std::ofstream *  stream)

Set the output file stream

Parameters
streamOutput stream

◆ setOutputType()

void AMP::ParallelStreamBuffer::setOutputType ( StreamOutputType  type)

Set the output stream type

Parameters
typeOutput type

◆ sync()

int AMP::ParallelStreamBuffer::sync ( )
override

Synchronize the parallel buffer (called from streambuf).

◆ underflow()

int AMP::ParallelStreamBuffer::underflow ( )
override

Read an overflow character from the parallel buffer (called from streambuf). This is not implemented. It is needed by the MSVC++ stream implementation.

◆ xsputn()

std::streamsize AMP::ParallelStreamBuffer::xsputn ( const char *  text,
std::streamsize  n 
)
override

Write the specified number of characters into the output stream (called from streambuf).

Member Data Documentation

◆ d_buffer

char* AMP::ParallelStreamBuffer::d_buffer
private

Definition at line 89 of file PIO.h.

◆ d_buffer_size

size_t AMP::ParallelStreamBuffer::d_buffer_size
private

Definition at line 88 of file PIO.h.

◆ d_size

size_t AMP::ParallelStreamBuffer::d_size
private

Definition at line 87 of file PIO.h.

◆ d_stream

std::ofstream* AMP::ParallelStreamBuffer::d_stream
private

Definition at line 90 of file PIO.h.

◆ d_type

StreamOutputType AMP::ParallelStreamBuffer::d_type
private

Definition at line 86 of file PIO.h.


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



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:42.
Comments on this page