Medial Code Documentation
Loading...
Searching...
No Matches
External
xgboost
src
data
simple_batch_iterator.h
1
4
#ifndef XGBOOST_DATA_SIMPLE_BATCH_ITERATOR_H_
5
#define XGBOOST_DATA_SIMPLE_BATCH_ITERATOR_H_
6
7
#include <memory>
8
#include <utility>
9
10
#include "
xgboost/data.h
"
11
12
namespace
xgboost
{
13
namespace
data {
14
15
template
<
typename
T>
16
class
SimpleBatchIteratorImpl
:
public
BatchIteratorImpl
<T> {
17
public
:
18
explicit
SimpleBatchIteratorImpl
(std::shared_ptr<T const> page) : page_(std::move(page)) {}
19
const
T& operator*()
const override
{
20
CHECK(page_ !=
nullptr
);
21
return
*page_;
22
}
23
SimpleBatchIteratorImpl
&operator++()
override
{
24
page_ =
nullptr
;
25
return
*
this
;
26
}
27
bool
AtEnd()
const override
{
return
page_ ==
nullptr
; }
28
29
std::shared_ptr<T const> Page()
const override
{
return
page_; }
30
31
private
:
32
std::shared_ptr<T const> page_{
nullptr
};
33
};
34
35
}
// namespace data
36
}
// namespace xgboost
37
#endif
// XGBOOST_DATA_SIMPLE_BATCH_ITERATOR_H_
xgboost::BatchIteratorImpl
Definition
data.h:447
xgboost.data::SimpleBatchIteratorImpl
Definition
simple_batch_iterator.h:16
data.h
Copyright 2015-2023 by XGBoost Contributors.
xgboost
namespace of xgboost
Definition
base.h:90
Generated on Mon Sep 15 2025 12:12:20 for Medial Code Documentation by
1.9.8