CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::ValueDataStream< T, Promoter > Class Template Reference

#include <DataStream.hh>

+ Inheritance diagram for CASM::ValueDataStream< T, Promoter >:

Detailed Description

template<typename T, typename Promoter = DataStream_impl::DataStreamPromoter<T>>
class CASM::ValueDataStream< T, Promoter >

Definition at line 227 of file DataStream.hh.

Public Types

enum  DataStreamTraits { none = 0 , skipfail = (1u << 0) , failbit = (1u << 1) }
 

Public Member Functions

 ValueDataStream (DataStreamTraits _traits=none)
 
DataStreamoperator<< (const std::string &val) override
 
DataStreamoperator<< (long val) override
 
DataStreamoperator<< (double val) override
 
DataStreamoperator<< (bool val) override
 
DataStreamoperator<< (char val) override
 
const T & value () const
 
virtual DataStreamoperator<< (jsonParser const &)
 
DataStreamoperator<< (DataStream &(*F)(DataStream &))
 
DataStreamoperator<< (const std::function< DataStream &(DataStream &)> &F)
 
DataStreamoperator<< (DataStreamTraits set_bits)
 
virtual DataStreamnewline ()
 
bool fail () const
 
void clear_fail ()
 
std::string const & err_msg () const
 

Static Public Member Functions

static DataStreamendl (DataStream &_strm)
 
static std::function< DataStream &(DataStream &_strm)> failure (std::string const &_msg)
 

Protected Member Functions

void _set_err_msg (std::string const &_msg)
 
bool _skipfail ()
 

Private Attributes

m_value
 
int m_traits
 
std::string m_err_msg
 

Member Enumeration Documentation

◆ DataStreamTraits

Enumerator
none 
skipfail 
failbit 

Definition at line 15 of file DataStream.hh.

Constructor & Destructor Documentation

◆ ValueDataStream()

template<typename T , typename Promoter = DataStream_impl::DataStreamPromoter<T>>
CASM::ValueDataStream< T, Promoter >::ValueDataStream ( DataStreamTraits  _traits = none)
inline

Definition at line 229 of file DataStream.hh.

Member Function Documentation

◆ _set_err_msg()

void CASM::DataStream::_set_err_msg ( std::string const &  _msg)
inlineprotectedinherited

Definition at line 70 of file DataStream.hh.

◆ _skipfail()

bool CASM::DataStream::_skipfail ( )
inlineprotectedinherited

Definition at line 72 of file DataStream.hh.

◆ clear_fail()

void CASM::DataStream::clear_fail ( )
inlineinherited

Definition at line 62 of file DataStream.hh.

◆ endl()

static DataStream& CASM::DataStream::endl ( DataStream _strm)
inlinestaticinherited

Definition at line 17 of file DataStream.hh.

◆ err_msg()

std::string const& CASM::DataStream::err_msg ( ) const
inlineinherited

Definition at line 67 of file DataStream.hh.

◆ fail()

bool CASM::DataStream::fail ( ) const
inlineinherited

Definition at line 60 of file DataStream.hh.

◆ failure()

std::function< DataStream &(DataStream &_strm)> CASM::DataStream::failure ( std::string const &  _msg)
inlinestaticinherited

Definition at line 114 of file DataStream.hh.

◆ newline()

virtual DataStream& CASM::DataStream::newline ( )
inlinevirtualinherited

◆ operator<<() [1/9]

template<typename T , typename Promoter = DataStream_impl::DataStreamPromoter<T>>
DataStream& CASM::ValueDataStream< T, Promoter >::operator<< ( bool  val)
inlineoverridevirtual

Reimplemented from CASM::DataStream.

Definition at line 246 of file DataStream.hh.

◆ operator<<() [2/9]

template<typename T , typename Promoter = DataStream_impl::DataStreamPromoter<T>>
DataStream& CASM::ValueDataStream< T, Promoter >::operator<< ( char  val)
inlineoverridevirtual

Reimplemented from CASM::DataStream.

Definition at line 251 of file DataStream.hh.

◆ operator<<() [3/9]

DataStream& CASM::DataStream::operator<< ( const std::function< DataStream &(DataStream &)> &  F)
inlineinherited

Definition at line 49 of file DataStream.hh.

◆ operator<<() [4/9]

template<typename T , typename Promoter = DataStream_impl::DataStreamPromoter<T>>
DataStream& CASM::ValueDataStream< T, Promoter >::operator<< ( const std::string &  val)
inlineoverridevirtual

Reimplemented from CASM::DataStream.

Definition at line 231 of file DataStream.hh.

◆ operator<<() [5/9]

DataStream& CASM::DataStream::operator<< ( DataStream &(*)(DataStream &)  F)
inlineinherited

Definition at line 47 of file DataStream.hh.

◆ operator<<() [6/9]

DataStream& CASM::DataStream::operator<< ( DataStreamTraits  set_bits)
inlineinherited

Definition at line 55 of file DataStream.hh.

◆ operator<<() [7/9]

template<typename T , typename Promoter = DataStream_impl::DataStreamPromoter<T>>
DataStream& CASM::ValueDataStream< T, Promoter >::operator<< ( double  val)
inlineoverridevirtual

Reimplemented from CASM::DataStream.

Definition at line 241 of file DataStream.hh.

◆ operator<<() [8/9]

virtual DataStream& CASM::DataStream::operator<< ( jsonParser const &  )
inlinevirtualinherited

Definition at line 42 of file DataStream.hh.

◆ operator<<() [9/9]

template<typename T , typename Promoter = DataStream_impl::DataStreamPromoter<T>>
DataStream& CASM::ValueDataStream< T, Promoter >::operator<< ( long  val)
inlineoverridevirtual

Reimplemented from CASM::DataStream.

Definition at line 236 of file DataStream.hh.

◆ value()

template<typename T , typename Promoter = DataStream_impl::DataStreamPromoter<T>>
const T& CASM::ValueDataStream< T, Promoter >::value ( ) const
inline

Definition at line 256 of file DataStream.hh.

Member Data Documentation

◆ m_err_msg

std::string CASM::DataStream::m_err_msg
privateinherited

Definition at line 76 of file DataStream.hh.

◆ m_traits

int CASM::DataStream::m_traits
privateinherited

Definition at line 75 of file DataStream.hh.

◆ m_value

template<typename T , typename Promoter = DataStream_impl::DataStreamPromoter<T>>
T CASM::ValueDataStream< T, Promoter >::m_value
private

Definition at line 259 of file DataStream.hh.


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