NGen
Loading...
Searching...
No Matches
utils::FileStreamHandler Class Reference

#include <FileStreamHandler.hpp>

+ Inheritance diagram for utils::FileStreamHandler:
+ Collaboration diagram for utils::FileStreamHandler:

Public Member Functions

 FileStreamHandler (const char *path)
 
virtual ~FileStreamHandler ()
 
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
 

Protected Attributes

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.
 

Constructor & Destructor Documentation

◆ FileStreamHandler()

utils::FileStreamHandler::FileStreamHandler ( const char * path)
inline

◆ ~FileStreamHandler()

virtual utils::FileStreamHandler::~FileStreamHandler ( )
inlinevirtual

Member Function Documentation

◆ operator<<()

template<class DataType >
std::ostream & utils::StreamHandler::operator<< ( const DataType & val)
inlineinherited

stream write operator that allows a StreamHandler to be used as a stream object

References utils::StreamHandler::output_stream, and utils::StreamHandler::put().

◆ put()

template<class DataType >
void utils::StreamHandler::put ( const DataType & val)
inlineinherited

Serialize data onto the stored stream.

This function does not preform any formating.

References utils::StreamHandler::output_stream.

Referenced by utils::StreamHandler::operator<<().

◆ put_indexed()

template<class IndexType , class DataType >
void utils::StreamHandler::put_indexed ( IndexType idx,
const DataType & val )
inlineinherited

Serialize data onto the stream in the form of "<index><sep><val>\n".

References utils::StreamHandler::output_stream, and utils::StreamHandler::sep.

◆ put_var()

template<class IndexType , class DataType >
void utils::StreamHandler::put_var ( IndexType idx,
std::string var,
const DataType & val )
inlineinherited

Serialize data onto the stream in the form of "<index><sep><var><sep><val>\n".

References utils::StreamHandler::output_stream, and utils::StreamHandler::sep.

Member Data Documentation

◆ output_stream

std::shared_ptr<std::ostream> utils::StreamHandler::output_stream
protectedinherited

◆ sep

std::string utils::StreamHandler::sep
protectedinherited

The seperator string to be used in serialization.

Referenced by utils::StreamHandler::operator=(), utils::StreamHandler::put_indexed(), and utils::StreamHandler::put_var().


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