Teuchos Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
Teuchos::basic_FancyOStream_buf< CharT, Traits > Class Template Reference

Stream buffering class that performs the magic of indenting data sent to an std::ostream object. More...

#include <Teuchos_FancyOStream.hpp>

Inheritance diagram for Teuchos::basic_FancyOStream_buf< CharT, Traits >:
Inheritance graph
[legend]

Public Types

typedef CharT char_type
 
typedef Traits traits_type
 
typedef traits_type::int_type int_type
 
typedef traits_type::pos_type pos_type
 
typedef traits_type::off_type off_type
 

Public Member Functions

 basic_FancyOStream_buf (const RCP< std::basic_ostream< char_type, traits_type > > &oStream, const std::basic_string< char_type, traits_type > &tabIndentStr, const int startingTab, const bool showLinePrefix, const int maxLenLinePrefix, const bool showTabCount, const bool showProcRank)
 
void initialize (const RCP< std::basic_ostream< char_type, traits_type > > &oStream, const std::basic_string< char_type, traits_type > &tabIndentStr, const int startingTab, const bool showLinePrefix, const int maxLenLinePrefix, const bool showTabCount, const bool showProcRank)
 
RCP< std::basic_ostream< char_type, traits_type > > getOStream ()
 
void setTabIndentStr (const std::basic_string< char_type, traits_type > &tabIndentStr)
 
const std::basic_string< char_type, traits_type > & getTabIndentStr () const
 
void setShowLinePrefix (const bool showLinePrefix)
 
bool getShowLinePrefix () const
 
void setMaxLenLinePrefix (const int maxLenLinePrefix)
 
int getMaxLenLinePrefix () const
 
void setShowTabCount (const bool showTabCount)
 
bool getShowTabCount () const
 
void setShowProcRank (const bool showProcRank)
 
bool getShowProcRank () const
 
void setProcRankAndSize (const int procRank, const int numProcs)
 Set the (MPI) process rank and the number of processes in the communicator.
 
int getProcRank () const
 Get the rank of the calling (MPI) process.
 
int getNumProcs () const
 Get the number of processes in the communicator.
 
void setOutputToRootOnly (const int rootRank)
 Set the stream to print only on the (MPI) process with the given rank.
 
int getOutputToRootOnly () const
 
void pushTab (const int tabs)
 Push one or more tabs.
 
int getNumCurrTabs () const
 
void popTab ()
 Pop the current tab.
 
void pushLinePrefix (const std::basic_string< char_type, traits_type > &linePrefix)
 
void popLinePrefix ()
 
const std::basic_string< char_type, traits_type > & getTopLinePrefix () const
 
void pushDisableTabbing ()
 
void popDisableTabbing ()
 

Protected overridden functions from std::basic_streambuf

typedef std::basic_string< char_type, traits_typestring_t
 
typedef std::deque< inttabIndentStack_t
 
typedef std::deque< string_tlinePrefixStack_t
 
RCP< std::basic_ostream< char_type, traits_type > > oStreamSet_
 
RCP< std::basic_ostream< char_type, traits_type > > oStream_
 
std::basic_string< char_type, traits_typetabIndentStr_
 
bool showLinePrefix_
 
int maxLenLinePrefix_
 
bool showTabCount_
 
bool showProcRank_
 
int rootRank_
 
int procRank_
 
int numProcs_
 
int rankPrintWidth_
 
RCP< std::ostringstream > lineOut_
 
int tabIndent_
 
tabIndentStack_t tabIndentStack_
 
linePrefixStack_t linePrefixStack_
 
int enableTabbingStack_
 
bool wroteNewline_
 
std::streamsize xsputn (const char_type *s, std::streamsize n)
 
int_type overflow (int_type c)
 
std::ostream & out ()
 
void writeChars (const char_type s[], std::streamsize n)
 
void writeFrontMatter ()
 
 basic_FancyOStream_buf ()
 
 basic_FancyOStream_buf (const basic_FancyOStream_buf< CharT, Traits > &)
 
basic_FancyOStream_buf< CharT, Traitsoperator= (const basic_FancyOStream_buf< CharT, Traits > &)
 

Detailed Description

template<typename CharT, typename Traits>
class Teuchos::basic_FancyOStream_buf< CharT, Traits >

Stream buffering class that performs the magic of indenting data sent to an std::ostream object.

Note, this is not a user-level class. Users should use basic_FancyOStream.

Definition at line 63 of file Teuchos_FancyOStream.hpp.

Member Typedef Documentation

◆ char_type

Definition at line 68 of file Teuchos_FancyOStream.hpp.

◆ traits_type

Definition at line 70 of file Teuchos_FancyOStream.hpp.

◆ int_type

template<typename CharT , typename Traits >
typedef traits_type::int_type Teuchos::basic_FancyOStream_buf< CharT, Traits >::int_type

Definition at line 72 of file Teuchos_FancyOStream.hpp.

◆ pos_type

template<typename CharT , typename Traits >
typedef traits_type::pos_type Teuchos::basic_FancyOStream_buf< CharT, Traits >::pos_type

Definition at line 74 of file Teuchos_FancyOStream.hpp.

◆ off_type

template<typename CharT , typename Traits >
typedef traits_type::off_type Teuchos::basic_FancyOStream_buf< CharT, Traits >::off_type

Definition at line 76 of file Teuchos_FancyOStream.hpp.

◆ string_t

template<typename CharT , typename Traits >
typedef std::basic_string<char_type,traits_type> Teuchos::basic_FancyOStream_buf< CharT, Traits >::string_t
private

Definition at line 302 of file Teuchos_FancyOStream.hpp.

◆ tabIndentStack_t

template<typename CharT , typename Traits >
typedef std::deque<int> Teuchos::basic_FancyOStream_buf< CharT, Traits >::tabIndentStack_t
private

Definition at line 303 of file Teuchos_FancyOStream.hpp.

◆ linePrefixStack_t

template<typename CharT , typename Traits >
typedef std::deque<string_t> Teuchos::basic_FancyOStream_buf< CharT, Traits >::linePrefixStack_t
private

Definition at line 304 of file Teuchos_FancyOStream.hpp.

Constructor & Destructor Documentation

◆ basic_FancyOStream_buf() [1/3]

template<typename CharT , typename Traits >
Teuchos::basic_FancyOStream_buf< CharT, Traits >::basic_FancyOStream_buf ( const RCP< std::basic_ostream< char_type, traits_type > > & oStream,
const std::basic_string< char_type, traits_type > & tabIndentStr,
const int startingTab,
const bool showLinePrefix,
const int maxLenLinePrefix,
const bool showTabCount,
const bool showProcRank )

Definition at line 875 of file Teuchos_FancyOStream.hpp.

◆ basic_FancyOStream_buf() [2/3]

template<typename CharT , typename Traits >
Teuchos::basic_FancyOStream_buf< CharT, Traits >::basic_FancyOStream_buf ( )
private

◆ basic_FancyOStream_buf() [3/3]

Member Function Documentation

◆ initialize()

template<typename CharT , typename Traits >
void Teuchos::basic_FancyOStream_buf< CharT, Traits >::initialize ( const RCP< std::basic_ostream< char_type, traits_type > > & oStream,
const std::basic_string< char_type, traits_type > & tabIndentStr,
const int startingTab,
const bool showLinePrefix,
const int maxLenLinePrefix,
const bool showTabCount,
const bool showProcRank )

Definition at line 891 of file Teuchos_FancyOStream.hpp.

◆ getOStream()

template<typename CharT , typename Traits >
RCP< std::basic_ostream< CharT, Traits > > Teuchos::basic_FancyOStream_buf< CharT, Traits >::getOStream ( )

Definition at line 922 of file Teuchos_FancyOStream.hpp.

◆ setTabIndentStr()

template<typename CharT , typename Traits >
void Teuchos::basic_FancyOStream_buf< CharT, Traits >::setTabIndentStr ( const std::basic_string< char_type, traits_type > & tabIndentStr)

Definition at line 929 of file Teuchos_FancyOStream.hpp.

◆ getTabIndentStr()

template<typename CharT , typename Traits >
const std::basic_string< CharT, Traits > & Teuchos::basic_FancyOStream_buf< CharT, Traits >::getTabIndentStr ( ) const

Definition at line 939 of file Teuchos_FancyOStream.hpp.

◆ setShowLinePrefix()

template<typename CharT , typename Traits >
void Teuchos::basic_FancyOStream_buf< CharT, Traits >::setShowLinePrefix ( const bool showLinePrefix)

Definition at line 946 of file Teuchos_FancyOStream.hpp.

◆ getShowLinePrefix()

template<typename CharT , typename Traits >
bool Teuchos::basic_FancyOStream_buf< CharT, Traits >::getShowLinePrefix ( ) const

Definition at line 953 of file Teuchos_FancyOStream.hpp.

◆ setMaxLenLinePrefix()

template<typename CharT , typename Traits >
void Teuchos::basic_FancyOStream_buf< CharT, Traits >::setMaxLenLinePrefix ( const int maxLenLinePrefix)

Definition at line 960 of file Teuchos_FancyOStream.hpp.

◆ getMaxLenLinePrefix()

template<typename CharT , typename Traits >
int Teuchos::basic_FancyOStream_buf< CharT, Traits >::getMaxLenLinePrefix ( ) const

Definition at line 968 of file Teuchos_FancyOStream.hpp.

◆ setShowTabCount()

template<typename CharT , typename Traits >
void Teuchos::basic_FancyOStream_buf< CharT, Traits >::setShowTabCount ( const bool showTabCount)

Definition at line 975 of file Teuchos_FancyOStream.hpp.

◆ getShowTabCount()

template<typename CharT , typename Traits >
bool Teuchos::basic_FancyOStream_buf< CharT, Traits >::getShowTabCount ( ) const

Definition at line 982 of file Teuchos_FancyOStream.hpp.

◆ setShowProcRank()

template<typename CharT , typename Traits >
void Teuchos::basic_FancyOStream_buf< CharT, Traits >::setShowProcRank ( const bool showProcRank)

Definition at line 989 of file Teuchos_FancyOStream.hpp.

◆ getShowProcRank()

template<typename CharT , typename Traits >
bool Teuchos::basic_FancyOStream_buf< CharT, Traits >::getShowProcRank ( ) const

Definition at line 996 of file Teuchos_FancyOStream.hpp.

◆ setProcRankAndSize()

template<typename CharT , typename Traits >
void Teuchos::basic_FancyOStream_buf< CharT, Traits >::setProcRankAndSize ( const int procRank,
const int numProcs )

Set the (MPI) process rank and the number of processes in the communicator.

Parameters
procRank[in] The rank of the calling process.
numProcs[in] The number of processes in the communicator.

You must call this method before you may call setOutputToRootOnly().

Definition at line 1003 of file Teuchos_FancyOStream.hpp.

◆ getProcRank()

template<typename CharT , typename Traits >
int Teuchos::basic_FancyOStream_buf< CharT, Traits >::getProcRank ( ) const

Get the rank of the calling (MPI) process.

Precondition
The calling process rank and the number of processes in the communicator were set via a call to setProcRankAndSize().

Definition at line 1013 of file Teuchos_FancyOStream.hpp.

◆ getNumProcs()

template<typename CharT , typename Traits >
int Teuchos::basic_FancyOStream_buf< CharT, Traits >::getNumProcs ( ) const

Get the number of processes in the communicator.

Precondition
The calling process rank and the number of processes in the communicator were set via a call to setProcRankAndSize().

Definition at line 1020 of file Teuchos_FancyOStream.hpp.

◆ setOutputToRootOnly()

template<typename CharT , typename Traits >
void Teuchos::basic_FancyOStream_buf< CharT, Traits >::setOutputToRootOnly ( const int rootRank)

Set the stream to print only on the (MPI) process with the given rank.

Precondition
The calling process rank and the number of processes in the communicator were set via a call to setProcRankAndSize().
Parameters
rootRank[in] The rank of the process on which to print. The convention is to use Process 0 as the "root" process, but this is not required.
Warning
The effect of this method is currently irreversible. This commits downstream users of this output stream to the same assignment of ranks to processes. The result of calling setProcRankAndSize() after this method has been called is undefined. It will likely have no effect.

Definition at line 1027 of file Teuchos_FancyOStream.hpp.

◆ getOutputToRootOnly()

template<typename CharT , typename Traits >
int Teuchos::basic_FancyOStream_buf< CharT, Traits >::getOutputToRootOnly ( ) const

Definition at line 1051 of file Teuchos_FancyOStream.hpp.

◆ pushTab()

Push one or more tabs.

Users should generally not call this method directly. It is better to use OSTab to automate the process. OSTab's constructor calls pushTab() for you. It also calls popTab() automatically on scope exit, whether the scope was exited normally or by an exception throw. This "puts things back how you found them."

Definition at line 1058 of file Teuchos_FancyOStream.hpp.

◆ getNumCurrTabs()

template<typename CharT , typename Traits >
int Teuchos::basic_FancyOStream_buf< CharT, Traits >::getNumCurrTabs ( ) const

Definition at line 1072 of file Teuchos_FancyOStream.hpp.

◆ popTab()

Pop the current tab.

Users should generally not call this method directly. It is better to use OSTab to automate the process. OSTab calls popTab() automatically on scope exit, whether the scope was exited normally or by an exception throw. This "puts things back how you found them."

Definition at line 1079 of file Teuchos_FancyOStream.hpp.

◆ pushLinePrefix()

template<typename CharT , typename Traits >
void Teuchos::basic_FancyOStream_buf< CharT, Traits >::pushLinePrefix ( const std::basic_string< char_type, traits_type > & linePrefix)

Definition at line 1087 of file Teuchos_FancyOStream.hpp.

◆ popLinePrefix()

Definition at line 1096 of file Teuchos_FancyOStream.hpp.

◆ getTopLinePrefix()

template<typename CharT , typename Traits >
const std::basic_string< CharT, Traits > & Teuchos::basic_FancyOStream_buf< CharT, Traits >::getTopLinePrefix ( ) const

Definition at line 1104 of file Teuchos_FancyOStream.hpp.

◆ pushDisableTabbing()

template<typename CharT , typename Traits >
void Teuchos::basic_FancyOStream_buf< CharT, Traits >::pushDisableTabbing ( )

Definition at line 1111 of file Teuchos_FancyOStream.hpp.

◆ popDisableTabbing()

template<typename CharT , typename Traits >
void Teuchos::basic_FancyOStream_buf< CharT, Traits >::popDisableTabbing ( )

Definition at line 1118 of file Teuchos_FancyOStream.hpp.

◆ xsputn()

template<typename CharT , typename Traits >
std::streamsize Teuchos::basic_FancyOStream_buf< CharT, Traits >::xsputn ( const char_type * s,
std::streamsize n )
protected

Definition at line 1128 of file Teuchos_FancyOStream.hpp.

◆ overflow()

Definition at line 1142 of file Teuchos_FancyOStream.hpp.

◆ out()

template<typename CharT , typename Traits >
std::ostream & Teuchos::basic_FancyOStream_buf< CharT, Traits >::out ( )
private

Definition at line 1160 of file Teuchos_FancyOStream.hpp.

◆ writeChars()

template<typename CharT , typename Traits >
void Teuchos::basic_FancyOStream_buf< CharT, Traits >::writeChars ( const char_type s[],
std::streamsize n )
private

Definition at line 1169 of file Teuchos_FancyOStream.hpp.

◆ writeFrontMatter()

template<typename CharT , typename Traits >
void Teuchos::basic_FancyOStream_buf< CharT, Traits >::writeFrontMatter ( )
private

Definition at line 1215 of file Teuchos_FancyOStream.hpp.

◆ operator=()

Member Data Documentation

◆ oStreamSet_

template<typename CharT , typename Traits >
RCP<std::basic_ostream<char_type,traits_type> > Teuchos::basic_FancyOStream_buf< CharT, Traits >::oStreamSet_
private

Definition at line 309 of file Teuchos_FancyOStream.hpp.

◆ oStream_

template<typename CharT , typename Traits >
RCP<std::basic_ostream<char_type,traits_type> > Teuchos::basic_FancyOStream_buf< CharT, Traits >::oStream_
private

Definition at line 310 of file Teuchos_FancyOStream.hpp.

◆ tabIndentStr_

template<typename CharT , typename Traits >
std::basic_string<char_type,traits_type> Teuchos::basic_FancyOStream_buf< CharT, Traits >::tabIndentStr_
private

Definition at line 311 of file Teuchos_FancyOStream.hpp.

◆ showLinePrefix_

template<typename CharT , typename Traits >
bool Teuchos::basic_FancyOStream_buf< CharT, Traits >::showLinePrefix_
private

Definition at line 312 of file Teuchos_FancyOStream.hpp.

◆ maxLenLinePrefix_

template<typename CharT , typename Traits >
int Teuchos::basic_FancyOStream_buf< CharT, Traits >::maxLenLinePrefix_
private

Definition at line 313 of file Teuchos_FancyOStream.hpp.

◆ showTabCount_

template<typename CharT , typename Traits >
bool Teuchos::basic_FancyOStream_buf< CharT, Traits >::showTabCount_
private

Definition at line 314 of file Teuchos_FancyOStream.hpp.

◆ showProcRank_

template<typename CharT , typename Traits >
bool Teuchos::basic_FancyOStream_buf< CharT, Traits >::showProcRank_
private

Definition at line 315 of file Teuchos_FancyOStream.hpp.

◆ rootRank_

Definition at line 316 of file Teuchos_FancyOStream.hpp.

◆ procRank_

Definition at line 317 of file Teuchos_FancyOStream.hpp.

◆ numProcs_

Definition at line 318 of file Teuchos_FancyOStream.hpp.

◆ rankPrintWidth_

template<typename CharT , typename Traits >
int Teuchos::basic_FancyOStream_buf< CharT, Traits >::rankPrintWidth_
private

Definition at line 319 of file Teuchos_FancyOStream.hpp.

◆ lineOut_

template<typename CharT , typename Traits >
RCP<std::ostringstream> Teuchos::basic_FancyOStream_buf< CharT, Traits >::lineOut_
private

Definition at line 321 of file Teuchos_FancyOStream.hpp.

◆ tabIndent_

Definition at line 323 of file Teuchos_FancyOStream.hpp.

◆ tabIndentStack_

Definition at line 324 of file Teuchos_FancyOStream.hpp.

◆ linePrefixStack_

Definition at line 325 of file Teuchos_FancyOStream.hpp.

◆ enableTabbingStack_

template<typename CharT , typename Traits >
int Teuchos::basic_FancyOStream_buf< CharT, Traits >::enableTabbingStack_
private

Definition at line 326 of file Teuchos_FancyOStream.hpp.

◆ wroteNewline_

template<typename CharT , typename Traits >
bool Teuchos::basic_FancyOStream_buf< CharT, Traits >::wroteNewline_
private

Definition at line 328 of file Teuchos_FancyOStream.hpp.


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