Jpp  19.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | List of all members
JLANG::JStreamObjectOutput< T > Class Template Reference

Template implementation of stream output for single data type. More...

#include <JStreamObjectOutput.hh>

Inheritance diagram for JLANG::JStreamObjectOutput< T >:
JLANG::JObjectOutput< T > JLANG::JASCIIFileWriter< T > JLANG::JGZFileWriter< T > JSUPPORT::JMonteCarloStreamObjectOutput< Evt > JSUPPORT::JMonteCarloStreamObjectOutput< Head >

Public Member Functions

 JStreamObjectOutput (std::ostream &out, const std::string &sep="")
 Constructor. More...
 
virtual bool put (const T &object) override
 Object output. More...
 
const std::string & getSeparator () const
 Get token separator. More...
 
void setSeparator (const std::string &sep)
 Set token separator. More...
 

Private Attributes

std::ostream & __out
 
std::string __sep
 

Detailed Description

template<class T>
class JLANG::JStreamObjectOutput< T >

Template implementation of stream output for single data type.

This class implements the JLANG::JObjectOutput interface.

Definition at line 28 of file JStreamObjectOutput.hh.

Constructor & Destructor Documentation

template<class T>
JLANG::JStreamObjectOutput< T >::JStreamObjectOutput ( std::ostream &  out,
const std::string &  sep = "" 
)
inline

Constructor.

Parameters
outoutput stream
septoken separator

Definition at line 38 of file JStreamObjectOutput.hh.

39  :
40  __out(out),
41  __sep(sep)
42  {}

Member Function Documentation

template<class T>
virtual bool JLANG::JStreamObjectOutput< T >::put ( const T object)
inlineoverridevirtual

Object output.

Parameters
objectobject
Returns
true if OK; else false

Implements JLANG::JObjectOutput< T >.

Definition at line 51 of file JStreamObjectOutput.hh.

52  {
53  __out << object << __sep;
54 
55  return (bool) __out;
56  }
template<class T>
const std::string& JLANG::JStreamObjectOutput< T >::getSeparator ( ) const
inline

Get token separator.

Returns
separator

Definition at line 64 of file JStreamObjectOutput.hh.

65  {
66  return this->__sep;
67  }
template<class T>
void JLANG::JStreamObjectOutput< T >::setSeparator ( const std::string &  sep)
inline

Set token separator.

Parameters
sepseparator

Definition at line 75 of file JStreamObjectOutput.hh.

76  {
77  this->__sep = sep;
78  }

Member Data Documentation

template<class T>
std::ostream& JLANG::JStreamObjectOutput< T >::__out
private

Definition at line 81 of file JStreamObjectOutput.hh.

template<class T>
std::string JLANG::JStreamObjectOutput< T >::__sep
private

Definition at line 82 of file JStreamObjectOutput.hh.


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