LevelS C++ support library  3.83
Public Member Functions | List of all members
chunkMaker Class Reference

#include <share_utils.h>

Public Member Functions

 chunkMaker (uint64 s_full_, uint64 s_chunk_)
 
uint64 nchunks () const
 
bool getNext (uint64 &start, uint64 &size)
 

Detailed Description

Helper class for dividing a range of work items into chunks of specified size.

Definition at line 61 of file share_utils.h.

Constructor & Destructor Documentation

◆ chunkMaker()

chunkMaker::chunkMaker ( uint64  s_full_,
uint64  s_chunk_ 
)
inline

Creates an object that produces chunk information for s_full_ work items and a desired chunk size of s_chunk_.

Note
Both s_chunk_ and s_full_ must be larger than 0.

Definition at line 70 of file share_utils.h.

Member Function Documentation

◆ nchunks()

uint64 chunkMaker::nchunks ( ) const
inline

Returns the total number of chunks.

Definition at line 74 of file share_utils.h.

◆ getNext()

bool chunkMaker::getNext ( uint64 &  start,
uint64 &  size 
)
inline

Returns the start index of the next chunk in start, and its size in size. If all chunks have been processed already, the return value is false, else true.

Definition at line 80 of file share_utils.h.


The documentation for this class was generated from the following file:

Generated on Wed Nov 13 2024 12:18:16 for LevelS C++ support library