Public Member Functions | Private Attributes | List of all members
gtsam::RedirectCout Struct Reference

#include <utilities.h>

Public Member Functions

 RedirectCout ()
 constructor – redirect stdout buffer to a stringstream buffer More...
 
std::string str () const
 return the string More...
 
 ~RedirectCout ()
 destructor – redirect stdout buffer to its original buffer More...
 

Private Attributes

std::streambuf * coutBuffer_
 
std::stringstream ssBuffer_
 

Detailed Description

For Python str(). Redirect std cout to a string stream so we can return a string representation of an object when it prints to cout. https://stackoverflow.com/questions/5419356/redirect-stdout-stderr-to-a-string

Definition at line 269 of file nonlinear/utilities.h.

Constructor & Destructor Documentation

gtsam::RedirectCout::RedirectCout ( )
inline

constructor – redirect stdout buffer to a stringstream buffer

Definition at line 271 of file nonlinear/utilities.h.

gtsam::RedirectCout::~RedirectCout ( )
inline

destructor – redirect stdout buffer to its original buffer

Definition at line 279 of file nonlinear/utilities.h.

Member Function Documentation

std::string gtsam::RedirectCout::str ( ) const
inline

return the string

Definition at line 274 of file nonlinear/utilities.h.

Member Data Documentation

std::streambuf* gtsam::RedirectCout::coutBuffer_
private

Definition at line 285 of file nonlinear/utilities.h.

std::stringstream gtsam::RedirectCout::ssBuffer_
private

Definition at line 284 of file nonlinear/utilities.h.


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


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:58:26