#ifndef __JLANG__JSTREAMOBJECTITERATOR__ #define __JLANG__JSTREAMOBJECTITERATOR__ #include #include "JLang/JAbstractObjectIterator.hh" /** * \author mdejong */ namespace JLANG {} namespace JPP { using namespace JLANG; } namespace JLANG { /** * Stream object iterator. * * This class implements the JAbstractObjectIterator interface. */ template class JStreamObjectIterator : public JAbstractObjectIterator { public: /** * Constructor. * * \param in input stream */ JStreamObjectIterator(std::istream& in) : __in(in) {} /** * Set object. * * \param object reference to object to be set * \return true if set; else false */ virtual bool setObject(T& object) override { return (bool) (__in && __in >> object); } protected: std::istream& __in; }; } #endif