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

Auxiliary class to assign a sequence of Comma Separated Values (CSV). More...

#include <JCSV.hh>

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

Classes

struct  JCSV
 Auxiliary class to assign the remainder of a sequence of Comma Separated Values. More...
 

Public Types

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

Public Member Functions

 JAssignSequence (const JSTDObjectWriter< T > &out)
 Constructor.
 
JCSV operator= (argument_type value)
 Assignment operator.
 
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) override
 Object output.
 
virtual JObjectOutput< T > * getHelper () const override
 Get helper.
 

Protected Types

typedef JClass< T >::argument_type argument_type
 

Detailed Description

template<class T>
class JLANG::JAssignSequence< T >

Auxiliary class to assign a sequence of Comma Separated Values (CSV).

Definition at line 40 of file JCSV.hh.

Member Typedef Documentation

◆ argument_type

template<class T >
JClass<T>::argument_type JLANG::JAssignSequence< T >::argument_type
protected

Definition at line 45 of file JCSV.hh.

◆ 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

◆ JAssignSequence()

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

Constructor.

Parameters
outoutput iterator

Definition at line 84 of file JCSV.hh.

84 :
86 {}
JSTDObjectWriter()
Default constructor.

Member Function Documentation

◆ operator=()

template<class T >
JCSV JLANG::JAssignSequence< T >::operator= ( argument_type value)
inline

Assignment operator.

This operator assigns the first of a sequence of Comma Separated Values and returns the corresponding object to assign the remainder of this sequence.

Parameters
valuevalue
Returns
value parser

Definition at line 98 of file JCSV.hh.

99 {
100 this->put(value);
101
102 return JCSV(*this);
103 }
virtual bool put(const T &object)=0
Object output.

◆ set() [1/2]

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

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)
inlineinherited

Set output.

Parameters
outoutput

Definition at line 78 of file JSTDObjectWriter.hh.

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

◆ put()

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.

◆ 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 }

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