Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JLANG::JObjectDemultiplexer< JBase_t, JDerived_t > Struct Template Reference

Auxiliary class for demultiplexing object outputs. More...

#include <JObjectDemultiplexer.hh>

Inheritance diagram for JLANG::JObjectDemultiplexer< JBase_t, JDerived_t >:
JLANG::JObjectOutput< JBase_t >

Public Member Functions

 JObjectDemultiplexer (JObjectOutput< JDerived_t > &output)
 Constructor.
 
virtual bool put (const JBase_t &object) override
 Object output.
 

Private Attributes

JObjectOutput< JDerived_t > & out
 

Friends

void operator| (JObjectIterator< JBase_t > &in, JObjectDemultiplexer &out)
 Pipe operator.
 

Detailed Description

template<class JBase_t, class JDerived_t>
struct JLANG::JObjectDemultiplexer< JBase_t, JDerived_t >

Auxiliary class for demultiplexing object outputs.

The template argument JDerived_t refers to a list of multiple object outputs which are processed in parallel.
The template argument JBase_t refers to a single object output which provides for a common interface to the multiple object outputs.

This class implements the JLANG::JObjectOutput interface.

Definition at line 30 of file JObjectDemultiplexer.hh.

Constructor & Destructor Documentation

◆ JObjectDemultiplexer()

template<class JBase_t , class JDerived_t >
JLANG::JObjectDemultiplexer< JBase_t, JDerived_t >::JObjectDemultiplexer ( JObjectOutput< JDerived_t > & output)
inline

Constructor.

Parameters
outputobject output

Definition at line 38 of file JObjectDemultiplexer.hh.

38 :
39 out(output)
40 {}
JObjectOutput< JDerived_t > & out

Member Function Documentation

◆ put()

template<class JBase_t , class JDerived_t >
virtual bool JLANG::JObjectDemultiplexer< JBase_t, JDerived_t >::put ( const JBase_t & object)
inlineoverridevirtual

Object output.

Parameters
objectobject
Returns
true if OK; else false

Implements JLANG::JObjectOutput< JBase_t >.

Reimplemented in JLANG::JObjectDemultiplexer< JBase_t, JTypeList< JHead_t, JTail_t > >.

Definition at line 49 of file JObjectDemultiplexer.hh.

50 {
51 const JDerived_t* p = dynamic_cast<const JDerived_t*>(&object);
52
53 if (p != NULL)
54 return out.put(*p);
55 else
56 return false;
57 }
virtual bool put(const T &object)=0
Object output.

Friends And Related Symbol Documentation

◆ operator|

template<class JBase_t , class JDerived_t >
void operator| ( JObjectIterator< JBase_t > & in,
JObjectDemultiplexer< JBase_t, JDerived_t > & out )
friend

Pipe operator.

Parameters
inobject demultiplexer
outobject output

Definition at line 66 of file JObjectDemultiplexer.hh.

67 {
68 while (in.hasNext() && out.put(*in.next())) {}
69 }

Member Data Documentation

◆ out

template<class JBase_t , class JDerived_t >
JObjectOutput<JDerived_t>& JLANG::JObjectDemultiplexer< JBase_t, JDerived_t >::out
private

Definition at line 72 of file JObjectDemultiplexer.hh.


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