Psi4
Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | List of all members
psi::PsiStreamBase< T > Class Template Reference

The base class for Psi4's new parallel safe printing system. More...

#include <StreamBase.h>

Inheritance diagram for psi::PsiStreamBase< T >:
psi::BasesBase

Public Member Functions

 PsiStreamBase (const MyType &other)
 Calls Clone for actual copy. More...
 
const MyTypeoperator= (const MyType &other)
 Calls Clone for assignment iff this!=&other, returns *this. More...
 
 PsiStreamBase ()
 Default constructor of stringstream is called. More...
 
virtual ~PsiStreamBase ()
 Memory not worried about until we get down the class tree to files. More...
 

Protected Member Functions

void EmptyBuffer ()
 I always forget how to empty a stringstream. More...
 
- Protected Member Functions inherited from psi::BasesBase
 BasesBase ()
 Returns true if this is the lucky MPI process that gets to read/write. More...
 
int WhoIsSpecial () const
 Returns the integer of the Lucky MPI process. More...
 
bool ImSpecial () const
 Returns true if this is the lucky MPI process that gets to read/write. More...
 

Protected Attributes

std::stringstream Buffer_
 This is where each MPI task ultimately writes from or to. More...
 
std::shared_ptr< TStream_
 The actual stream. More...
 

Private Types

typedef PsiStreamBase< TMyType
 

Private Member Functions

void Clone (const MyType &other)
 Makes this a copy of other, copies data in Buffer_, not &Buffer. More...
 

Detailed Description

template<typename T>
class psi::PsiStreamBase< T >

The base class for Psi4's new parallel safe printing system.

At this level we take care of the "who gets to print" sort of details. The call PsiStreamBase::ImSpecial is the function that determines this; if down the road people want to change this, this is where to do it at. Other than that, this class takes care of copying the Buffer_ and synching it across MPI processes.

template parameter T Either std::istream or std::ostream for input/output streams respectively

Member Typedef Documentation

template<typename T>
typedef PsiStreamBase<T> psi::PsiStreamBase< T >::MyType
private

Constructor & Destructor Documentation

template<typename T>
psi::PsiStreamBase< T >::PsiStreamBase ( const MyType other)
inline

Calls Clone for actual copy.

template<typename T>
psi::PsiStreamBase< T >::PsiStreamBase ( )
inline

Default constructor of stringstream is called.

template<typename T>
virtual psi::PsiStreamBase< T >::~PsiStreamBase ( )
inlinevirtual

Memory not worried about until we get down the class tree to files.

Member Function Documentation

template<typename T>
void psi::PsiStreamBase< T >::Clone ( const MyType other)
inlineprivate

Makes this a copy of other, copies data in Buffer_, not &Buffer.

template<typename T>
void psi::PsiStreamBase< T >::EmptyBuffer ( )
inlineprotected

I always forget how to empty a stringstream.

template<typename T>
const MyType& psi::PsiStreamBase< T >::operator= ( const MyType other)
inline

Calls Clone for assignment iff this!=&other, returns *this.

Member Data Documentation

template<typename T>
std::stringstream psi::PsiStreamBase< T >::Buffer_
protected

This is where each MPI task ultimately writes from or to.

template<typename T>
std::shared_ptr<T> psi::PsiStreamBase< T >::Stream_
protected

The actual stream.


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