#ifndef __JSUPPORT__JMULTIPLEFILESAMPLER__ #define __JSUPPORT__JMULTIPLEFILESAMPLER__ #include "JLang/JSampler.hh" #include "JLang/JObjectSampler.hh" #include "JSupport/JMultipleFileScanner.hh" /** * \author mdejong */ namespace JSUPPORT {} namespace JPP { using namespace JSUPPORT; } namespace JSUPPORT { using JLANG::JSampler; using JLANG::JObjectSampler; /** * Auxiliary base class to sample from a list of files. */ template struct JMultipleFileSampler_t { /** * Smart pointer operator. * * \return pointer to scanner */ const JMultipleFileScanner* const operator->() const { return &scanner; } /** * Smart pointer operator. * * \return pointer to scanner */ JMultipleFileScanner* operator->() { return &scanner; } protected: JMultipleFileScanner scanner; }; /** * Auxiliary class to sample from a list of files. */ template class JSampler_t = JSampler> struct JMultipleFileSampler : public JMultipleFileSampler_t, public JObjectSampler { typedef JSampler_t sampler_type; /** * Constructor. * * \param sampler sampler */ JMultipleFileSampler(const sampler_type& sampler = sampler_type()) : JMultipleFileSampler_t(), JObjectSampler(this->scanner, sampler) {} }; } #endif