1 #ifndef GENESIS_POPULATION_FORMAT_SIMPLE_PILEUP_INPUT_STREAM_H_
2 #define GENESIS_POPULATION_FORMAT_SIMPLE_PILEUP_INPUT_STREAM_H_
41 namespace population {
78 template<
class T = SimplePileupReader::Record>
109 std::shared_ptr< utils::BaseInputSource > source,
112 : input_stream_( std::make_shared<utils::InputStream>( source ))
146 std::shared_ptr< utils::BaseInputSource > source,
147 std::vector<bool>
const& sample_filter,
150 : input_stream_( std::make_shared<utils::InputStream>( source ))
152 , sample_filter_( sample_filter )
153 , use_sample_filter_(
true )
174 explicit operator bool()
const
246 return good_ == it.good_;
251 return !(*
this == it);
270 std::shared_ptr<utils::InputStream> input_stream_;
274 size_t sample_size_ = 0;
278 std::vector<bool> sample_filter_;
279 bool use_sample_filter_ =
false;
287 inline void SimplePileupInputStream<SimplePileupReader::Record>::increment_()
292 record_.samples.resize( sample_size_ );
293 if( use_sample_filter_ ) {
296 good_ = reader_.parse_line_record( *input_stream_, record_ );
298 sample_size_ = record_.samples.size();
302 inline void SimplePileupInputStream<Variant>::increment_()
305 record_.samples.resize( sample_size_ );
306 if( use_sample_filter_ ) {
307 good_ = reader_.parse_line_variant( *input_stream_, record_, sample_filter_ );
309 good_ = reader_.parse_line_variant( *input_stream_, record_ );
311 sample_size_ = record_.samples.size();
317 #endif // include guard