Implementation of the Iterable interface as a file.
More...
#include <IteratorFile.hpp>
template<class Item>
class gatb::core::tools::collections::impl::IterableFile< Item >
Implementation of the Iterable interface as a file.
This implementation uses a file as the source of the items that can be iterated.
IterableFile |
( |
const std::string & |
filename, |
|
|
size_t |
cacheItemsNb = 10000 |
|
) |
| |
|
inline |
Constructor
- Parameters
-
[in] | filename | : name of the file to be iterated. |
[in] | cacheItemsNb | : number of items in the cache memory |
int64_t estimateNbItems |
( |
| ) |
|
|
inlinevirtual |
Return the (approximate) number of items. If a specific implementation doesn't know the value, it should return -1 by convention.
- Returns
- the number of items if known, -1 otherwise.
Implements Iterable< Item >.
Item* getItems |
( |
Item *& |
buffer | ) |
|
|
inlinevirtual |
Return a buffer of items.
- Parameters
-
- Returns
- the buffer
Reimplemented from Iterable< Item >.
size_t getItems |
( |
Item *& |
buffer, |
|
|
size_t |
start, |
|
|
size_t |
nb |
|
) |
| |
|
inlinevirtual |
Return a buffer of items.
- Parameters
-
[out] | buffer | : the buffer |
[in] | start | : index where to start in the buffer |
[in] | nb | : number of items to be retrieved |
- Returns
- the number of items retrieved
Reimplemented from Iterable< Item >.
Return the number of items. If a specific implementation doesn't know the value, it should return -1 by convention.
- Returns
- the number of items if known, -1 otherwise.
Implements Iterable< Item >.
The documentation for this class was generated from the following file:
- /builds/workspace/publish-doc-api-gitlab/gatb-core/src/gatb/tools/collections/impl/IteratorFile.hpp