libMesh
|
This class is intended to be reseatable like a pointer-to-ostream for flexibility, but to look like a reference when used to produce less awkward user code. More...
#include <ostream_proxy.h>
Public Types | |
typedef std::basic_ostream< charT, traits > | streamT |
This class is going to be used to proxy for ostream, but other character and traits types are possible. More... | |
typedef std::basic_streambuf< charT, traits > | streambufT |
This class is going to be used to proxy for ostream, but other character and traits types are possible. More... | |
Public Member Functions | |
BasicOStreamProxy (streamT &target) | |
Default constructor. More... | |
BasicOStreamProxy (BasicOStreamProxy &old) | |
Shallow copy constructor. More... | |
BasicOStreamProxy & | operator= (streamT &target) |
Reset the internal target to a new target output stream. More... | |
BasicOStreamProxy & | operator= (const BasicOStreamProxy &old) |
Reset the target to the same output stream as in old . More... | |
~BasicOStreamProxy ()=default | |
Default destructor. More... | |
operator streamT & () | |
Conversion to ostream &, for when we get passed to a function requesting one. More... | |
operator const streamT & () const | |
Conversion to const ostream &, for when we get passed to a function requesting one. More... | |
template<typename T > | |
BasicOStreamProxy & | operator<< (const T &in) |
Redirect any output to the target. More... | |
BasicOStreamProxy & | operator<< (streamT &(*in)(streamT &)) |
Redirect any ostream manipulators to the target. More... | |
BasicOStreamProxy & | operator<< (std::basic_ios< charT, traits > &(*in)(std::basic_ios< charT, traits > &)) |
Redirect any ios manipulators to the target. More... | |
BasicOStreamProxy & | operator<< (std::ios_base &(*in)(std::ios_base &)) |
Redirect any ios_base manipulators to the target. More... | |
streambufT * | rdbuf () const |
Get the associated stream buffer. More... | |
streambufT * | rdbuf (streambufT *sb) |
Set the associated stream buffer. More... | |
BasicOStreamProxy & | flush () |
Flush the associated stream buffer. More... | |
std::ios_base::fmtflags | flags () const |
Get the associated format flags. More... | |
std::ios_base::fmtflags | flags (std::ios_base::fmtflags fmtfl) |
Set/get the associated format flags. More... | |
std::ios_base::fmtflags | setf (std::ios_base::fmtflags fmtfl) |
Set the associated flags. More... | |
std::ios_base::fmtflags | setf (std::ios_base::fmtflags fmtfl, std::ios_base::fmtflags mask) |
Set the associated flags. More... | |
void | unsetf (std::ios_base::fmtflags mask) |
Clear the associated flags. More... | |
std::streamsize | precision () const |
Get the associated write precision. More... | |
std::streamsize | precision (std::streamsize prec) |
Set the associated write precision. More... | |
void | reset (streamT &target) |
Reset the proxy to point to a different target . More... | |
streamT * | get () |
Rather than implement every ostream/ios/ios_base function, we'll be lazy and make esoteric uses go through a get() function. More... | |
const streamT * | get () const |
Rather than implement every ostream/ios/ios_base function, we'll be lazy and make esoteric uses go through a get() function. More... | |
std::streampos | tellp () |
Returns the position of the character in the current stream. More... | |
Private Attributes | |
streamT * | _target |
The pointer to the "real" ostream we send everything to. More... | |
This class is intended to be reseatable like a pointer-to-ostream for flexibility, but to look like a reference when used to produce less awkward user code.
It is up to the user to ensure that the target ostream remains valid.
Definition at line 42 of file ostream_proxy.h.
typedef std::basic_streambuf<charT,traits> libMesh::BasicOStreamProxy< charT, traits >::streambufT |
This class is going to be used to proxy for ostream, but other character and traits types are possible.
Definition at line 55 of file ostream_proxy.h.
typedef std::basic_ostream<charT,traits> libMesh::BasicOStreamProxy< charT, traits >::streamT |
This class is going to be used to proxy for ostream, but other character and traits types are possible.
Definition at line 49 of file ostream_proxy.h.
|
inline |
Default constructor.
Takes a reference to the target
ostream to which we pass output. The user is responsible for ensuring that this target exists for as long as the proxy does.
Definition at line 62 of file ostream_proxy.h.
|
inline |
Shallow copy constructor.
Output in the new object is passed to the same target ostream as in the old object. The user is responsible for ensuring that this target exists for as long as the proxies do.
Definition at line 70 of file ostream_proxy.h.
|
default |
Default destructor.
|
inline |
Get the associated format flags.
Definition at line 162 of file ostream_proxy.h.
References libMesh::BasicOStreamProxy< charT, traits >::_target.
Referenced by main().
|
inline |
Set/get the associated format flags.
Definition at line 168 of file ostream_proxy.h.
References libMesh::BasicOStreamProxy< charT, traits >::_target.
|
inline |
Flush the associated stream buffer.
Definition at line 157 of file ostream_proxy.h.
References libMesh::BasicOStreamProxy< charT, traits >::_target.
Referenced by assemble_ellipticdg(), and libMesh::PltLoader::read_data().
|
inline |
Rather than implement every ostream/ios/ios_base function, we'll be lazy and make esoteric uses go through a get()
function.
Definition at line 217 of file ostream_proxy.h.
References libMesh::BasicOStreamProxy< charT, traits >::_target.
Referenced by libMesh::ReferenceCounter::increment_constructor_count(), libMesh::ReferenceCounter::increment_destructor_count(), and libMesh::LibMeshInit::~LibMeshInit().
|
inline |
Rather than implement every ostream/ios/ios_base function, we'll be lazy and make esoteric uses go through a get()
function.
Definition at line 226 of file ostream_proxy.h.
References libMesh::BasicOStreamProxy< charT, traits >::_target.
|
inline |
Conversion to const ostream &, for when we get passed to a function requesting one.
Definition at line 109 of file ostream_proxy.h.
References libMesh::BasicOStreamProxy< charT, traits >::_target.
|
inline |
Conversion to ostream &, for when we get passed to a function requesting one.
Definition at line 103 of file ostream_proxy.h.
References libMesh::BasicOStreamProxy< charT, traits >::_target.
|
inline |
Redirect any output to the target.
Definition at line 115 of file ostream_proxy.h.
|
inline |
Redirect any ostream manipulators to the target.
Definition at line 123 of file ostream_proxy.h.
|
inline |
Redirect any ios manipulators to the target.
Definition at line 131 of file ostream_proxy.h.
|
inline |
Redirect any ios_base manipulators to the target.
Definition at line 139 of file ostream_proxy.h.
|
inline |
Reset the internal target to a new target
output stream.
Definition at line 75 of file ostream_proxy.h.
References libMesh::BasicOStreamProxy< charT, traits >::_target.
|
inline |
Reset the target to the same output stream as in old
.
Definition at line 84 of file ostream_proxy.h.
References libMesh::BasicOStreamProxy< charT, traits >::_target.
|
inline |
Get the associated write precision.
Definition at line 193 of file ostream_proxy.h.
References libMesh::BasicOStreamProxy< charT, traits >::_target.
Referenced by libMesh::FEMSystem::assembly(), libMesh::ContinuationSystem::continuation_solve(), main(), and libMesh::ContinuationSystem::update_solution().
|
inline |
Set the associated write precision.
Definition at line 199 of file ostream_proxy.h.
References libMesh::BasicOStreamProxy< charT, traits >::_target.
|
inline |
Get the associated stream buffer.
Definition at line 147 of file ostream_proxy.h.
References libMesh::BasicOStreamProxy< charT, traits >::_target.
Referenced by main(), StreamRedirector::StreamRedirector(), libMesh::LibMeshInit::~LibMeshInit(), and StreamRedirector::~StreamRedirector().
|
inline |
Set the associated stream buffer.
Definition at line 152 of file ostream_proxy.h.
References libMesh::BasicOStreamProxy< charT, traits >::_target.
|
inline |
Reset the proxy to point to a different target
.
Definition at line 211 of file ostream_proxy.h.
References libMesh::BasicOStreamProxy< charT, traits >::_target.
Referenced by libMesh::LibMeshInit::~LibMeshInit().
|
inline |
Set the associated flags.
Definition at line 174 of file ostream_proxy.h.
References libMesh::BasicOStreamProxy< charT, traits >::_target.
Referenced by libMesh::ContinuationSystem::continuation_solve(), and libMesh::ContinuationSystem::update_solution().
|
inline |
Set the associated flags.
Definition at line 180 of file ostream_proxy.h.
References libMesh::BasicOStreamProxy< charT, traits >::_target.
|
inline |
Returns the position of the character in the current stream.
Definition at line 234 of file ostream_proxy.h.
References libMesh::BasicOStreamProxy< charT, traits >::_target.
|
inline |
Clear the associated flags.
Definition at line 187 of file ostream_proxy.h.
References libMesh::BasicOStreamProxy< charT, traits >::_target.
Referenced by libMesh::ContinuationSystem::continuation_solve(), and libMesh::ContinuationSystem::update_solution().
|
private |
The pointer to the "real" ostream we send everything to.
Definition at line 240 of file ostream_proxy.h.
Referenced by libMesh::BasicOStreamProxy< charT, traits >::flags(), libMesh::BasicOStreamProxy< charT, traits >::flush(), libMesh::BasicOStreamProxy< charT, traits >::get(), libMesh::BasicOStreamProxy< charT, traits >::operator const streamT &(), libMesh::BasicOStreamProxy< charT, traits >::operator streamT &(), libMesh::BasicOStreamProxy< charT, traits >::operator=(), libMesh::BasicOStreamProxy< charT, traits >::precision(), libMesh::BasicOStreamProxy< charT, traits >::rdbuf(), libMesh::BasicOStreamProxy< charT, traits >::reset(), libMesh::BasicOStreamProxy< charT, traits >::setf(), libMesh::BasicOStreamProxy< charT, traits >::tellp(), and libMesh::BasicOStreamProxy< charT, traits >::unsetf().