| 333 | |
| 334 | template <typename T> |
| 335 | int PrivateQueueDataFeed<T>::Next() { |
| 336 | #ifdef _LINUX |
| 337 | CheckStart(); |
| 338 | int index = 0; |
| 339 | T ins_vec; |
| 340 | while (index < default_batch_size_) { |
| 341 | T instance; |
| 342 | if (!queue_->Get(instance)) { |
| 343 | break; |
| 344 | } |
| 345 | AddInstanceToInsVec(&ins_vec, instance, index++); |
| 346 | } |
| 347 | batch_size_ = index; |
| 348 | if (batch_size_ != 0) { |
| 349 | PutToFeedVec(ins_vec); |
| 350 | } |
| 351 | return batch_size_; |
| 352 | #else |
| 353 | return 0; |
| 354 | #endif |
| 355 | } |
| 356 | |
| 357 | // explicit instantiation |
| 358 | template class PrivateQueueDataFeed<std::vector<MultiSlotType>>; |