! * \brief constructor * \param base an base object to define how to read data */
| 27 | * \param base an base object to define how to read data |
| 28 | */ |
| 29 | explicit ThreadedInputSplit(InputSplitBase *base, const size_t batch_size) |
| 30 | : buffer_size_(InputSplitBase::kBufferSize), |
| 31 | batch_size_(batch_size), |
| 32 | base_(base), tmp_chunk_(NULL) { |
| 33 | iter_.set_max_capacity(2); |
| 34 | // initalize the iterator |
| 35 | iter_.Init([this](InputSplitBase::Chunk **dptr) { |
| 36 | if (*dptr == NULL) { |
| 37 | *dptr = new InputSplitBase::Chunk(buffer_size_); |
| 38 | } |
| 39 | return base_->NextBatchEx(*dptr, batch_size_); |
| 40 | }, |
| 41 | [base]() { base->BeforeFirst(); }); |
| 42 | } |
| 43 | // destructor |
| 44 | virtual ~ThreadedInputSplit(void) { |
| 45 | iter_.Destroy(); |
nothing calls this directly
no test coverage detected