Jpp 21.0.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JLANG::JSTDObjectWriter< T > Class Template Referenceabstract

Implementation of object output from STD container. More...

#include <JSTDObjectWriter.hh>

Inheritance diagram for JLANG::JSTDObjectWriter< T >:
JLANG::JObjectOutput< T > JLANG::JObjectWriter< T > JLANG::JObjectOutput< T > JLANG::JAbstractObjectWriter< T > JLANG::JObjectOutput< T > JLANG::JAssignSequence< T > JLANG::JAssignSequence< T >::JCSV

Public Types

typedef std::shared_ptr< JObjectOutput< T > > helper_type
 

Public Member Functions

 JSTDObjectWriter ()
 Default constructor.
 
template<class JOutput_t >
 JSTDObjectWriter (const JOutput_t &out)
 Constructor.
 
template<class JOutput_t >
 JSTDObjectWriter (JOutput_t &out)
 Constructor.
 
template<class JOutput_t >
void set (const JOutput_t &out)
 Set output.
 
template<class JOutput_t >
void set (JOutput_t &out)
 Set output.
 
virtual bool put (const T &object)=0
 Object output.
 
virtual JObjectOutput< T > * getHelper () const override
 Get helper.
 
virtual bool put (const T &object) override
 Object output.
 

Detailed Description

template<class T>
class JLANG::JSTDObjectWriter< T >

Implementation of object output from STD container.

This class implements the JObjectOutput interface.

Definition at line 24 of file JSTDObjectWriter.hh.

Member Typedef Documentation

◆ helper_type

template<class T >
std::shared_ptr< JObjectOutput<T> > JLANG::JObjectWriter< T >::helper_type
inherited

Definition at line 32 of file JObjectWriter.hh.

Constructor & Destructor Documentation

◆ JSTDObjectWriter() [1/3]

template<class T >
JLANG::JSTDObjectWriter< T >::JSTDObjectWriter ( )
inline

Default constructor.

Definition at line 32 of file JSTDObjectWriter.hh.

33 {}

◆ JSTDObjectWriter() [2/3]

template<class T >
template<class JOutput_t >
JLANG::JSTDObjectWriter< T >::JSTDObjectWriter ( const JOutput_t & out)
inline

Constructor.

Parameters
outoutput

Definition at line 42 of file JSTDObjectWriter.hh.

43 {
44 this->set(out);
45 }
void set(const JOutput_t &out)
Set output.

◆ JSTDObjectWriter() [3/3]

template<class T >
template<class JOutput_t >
JLANG::JSTDObjectWriter< T >::JSTDObjectWriter ( JOutput_t & out)
inline

Constructor.

Parameters
outoutput

Definition at line 54 of file JSTDObjectWriter.hh.

55 {
56 this->set(out);
57 }

Member Function Documentation

◆ set() [1/2]

template<class T >
template<class JOutput_t >
void JLANG::JSTDObjectWriter< T >::set ( const JOutput_t & out)
inline

Set output.

Parameters
outoutput

Definition at line 66 of file JSTDObjectWriter.hh.

67 {
68 this->reset(getSTDObjectOutput(out));
69 }
JSTDObjectOutput< T > * getSTDObjectOutput(const JSTDObjectOutput< T > &out)
Helper method to create STD compatible object output.
void reset(T &value)
Reset value.

◆ set() [2/2]

template<class T >
template<class JOutput_t >
void JLANG::JSTDObjectWriter< T >::set ( JOutput_t & out)
inline

Set output.

Parameters
outoutput

Definition at line 78 of file JSTDObjectWriter.hh.

79 {
80 this->reset(getSTDObjectOutput(out));
81 }

◆ put() [1/2]

◆ getHelper()

template<class T >
virtual JObjectOutput< T > * JLANG::JObjectWriter< T >::getHelper ( ) const
inlineoverridevirtualinherited

Get helper.

Returns
helper

Implements JLANG::JAbstractObjectWriter< T >.

Definition at line 46 of file JObjectWriter.hh.

47 {
48 return this->get();
49 }

◆ put() [2/2]

template<class T >
virtual bool JLANG::JAbstractObjectWriter< T >::put ( const T & object)
inlineoverridevirtualinherited

Object output.

Parameters
objectobject
Returns
true if OK; else false

Implements JLANG::JObjectOutput< T >.

Definition at line 43 of file JAbstractObjectWriter.hh.

44 {
45 return (this->getHelper() != NULL && this->getHelper()->put(object));
46 }
virtual JObjectOutput< T > * getHelper() const =0
Get helper.
virtual bool put(const T &object) override
Object output.

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