Jpp 21.0.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JIO::JWriterObjectOutput< T > Class Template Reference

Implementation of object output using JIO::JWriter for single data type. More...

#include <JWriterObjectOutput.hh>

Inheritance diagram for JIO::JWriterObjectOutput< T >:
JLANG::JObjectOutput< T > JIO::JBinaryWriterObjectOutput< T, true > JSUPPORT::JDAQWriterObjectOutput< T, true >

Public Member Functions

 JWriterObjectOutput (JWriter &writer)
 Constructor.
 
virtual bool put (const T &object) override
 Object output.
 

Private Member Functions

bool put (const T &object, std::true_type)
 
bool put (const T &object, std::false_type)
 

Private Attributes

JWriterout
 

Detailed Description

template<class T>
class JIO::JWriterObjectOutput< T >

Implementation of object output using JIO::JWriter for single data type.

This class implements the JLANG::JObjectOutput interface.

Definition at line 34 of file JWriterObjectOutput.hh.

Constructor & Destructor Documentation

◆ JWriterObjectOutput()

template<class T >
JIO::JWriterObjectOutput< T >::JWriterObjectOutput ( JWriter & writer)
inline

Constructor.

Parameters
writerwriter output

Definition at line 43 of file JWriterObjectOutput.hh.

43 :
44 out(writer)
45 {}

Member Function Documentation

◆ put() [1/3]

template<class T >
virtual bool JIO::JWriterObjectOutput< T >::put ( const T & object)
inlineoverridevirtual

Object output.

Parameters
objectobject
Returns
true if OK; else false

Implements JLANG::JObjectOutput< T >.

Definition at line 54 of file JWriterObjectOutput.hh.

55 {
56 return put(object, std::bool_constant<JLANG::JConversion<T,JSerialisable>::is_derived>());
57 }
virtual bool put(const T &object) override
Object output.
Template class test for polymorphism.

◆ put() [2/3]

template<class T >
bool JIO::JWriterObjectOutput< T >::put ( const T & object,
std::true_type  )
inlineprivate

Definition at line 60 of file JWriterObjectOutput.hh.

60{ return (bool) object.write(out); }

◆ put() [3/3]

template<class T >
bool JIO::JWriterObjectOutput< T >::put ( const T & object,
std::false_type  )
inlineprivate

Definition at line 61 of file JWriterObjectOutput.hh.

61{ return (bool) (out << object); }

Member Data Documentation

◆ out

template<class T >
JWriter& JIO::JWriterObjectOutput< T >::out
private

Definition at line 63 of file JWriterObjectOutput.hh.


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