This class provides a copyable interface to a std::ostream or std::ostream like object that may not support being copied.
More...
#include <StreamHandler.hpp>
|
| StreamHandler () |
| Default constructor intended for use by containers that need an empty constructor.
|
|
| StreamHandler (std::shared_ptr< std::ostream > s) |
| Create a Stream Handler given a pointer to a ostream object and the seperator to be used in serialization.
|
|
| StreamHandler (StreamHandler &src) |
| Copy constructor for a StreamHandler.
|
|
| StreamHandler (StreamHandler &&src) |
| Move constructor for a StreamHandler.
|
|
| ~StreamHandler () |
| Deconstructor for a StreamHandler.
|
|
StreamHandler & | operator= (StreamHandler &&other) noexcept |
| Move Assignment operator for a StreamHandler.
|
|
template<class DataType > |
void | put (const DataType &val) |
| Serialize data onto the stored stream.
|
|
template<class IndexType , class DataType > |
void | put_indexed (IndexType idx, const DataType &val) |
| Serialize data onto the stream in the form of "<index><sep><val>\n".
|
|
template<class IndexType , class DataType > |
void | put_var (IndexType idx, std::string var, const DataType &val) |
| Serialize data onto the stream in the form of "<index><sep><var><sep><val>\n".
|
|
template<class DataType > |
std::ostream & | operator<< (const DataType &val) |
| stream write operator that allows a StreamHandler to be used as a stream object
|
|
|
std::shared_ptr< std::ostream > | output_stream |
| The shared pointer to the managed stream object.
|
|
std::string | sep |
| The seperator string to be used in serialization.
|
|
This class provides a copyable interface to a std::ostream or std::ostream like object that may not support being copied.
◆ StreamHandler() [1/4]
utils::StreamHandler::StreamHandler |
( |
| ) |
|
|
inline |
Default constructor intended for use by containers that need an empty constructor.
◆ StreamHandler() [2/4]
utils::StreamHandler::StreamHandler |
( |
std::shared_ptr< std::ostream > | s | ) |
|
|
inline |
Create a Stream Handler given a pointer to a ostream object and the seperator to be used in serialization.
References output_stream.
◆ StreamHandler() [3/4]
◆ StreamHandler() [4/4]
◆ ~StreamHandler()
utils::StreamHandler::~StreamHandler |
( |
| ) |
|
|
inline |
◆ operator<<()
template<class DataType >
std::ostream & utils::StreamHandler::operator<< |
( |
const DataType & | val | ) |
|
|
inline |
◆ operator=()
◆ put()
template<class DataType >
void utils::StreamHandler::put |
( |
const DataType & | val | ) |
|
|
inline |
Serialize data onto the stored stream.
This function does not preform any formating.
References output_stream.
Referenced by operator<<().
◆ put_indexed()
template<class IndexType , class DataType >
void utils::StreamHandler::put_indexed |
( |
IndexType | idx, |
|
|
const DataType & | val ) |
|
inline |
Serialize data onto the stream in the form of "<index><sep><val>\n".
References output_stream, and sep.
◆ put_var()
template<class IndexType , class DataType >
void utils::StreamHandler::put_var |
( |
IndexType | idx, |
|
|
std::string | var, |
|
|
const DataType & | val ) |
|
inline |
Serialize data onto the stream in the form of "<index><sep><var><sep><val>\n".
References output_stream, and sep.
◆ output_stream
std::shared_ptr<std::ostream> utils::StreamHandler::output_stream |
|
protected |
◆ sep
std::string utils::StreamHandler::sep |
|
protected |
The documentation for this class was generated from the following file: