MeshLib C Docs
Loading...
Searching...
No Matches
MRChunkIterator.h File Reference
#include <MRCMisc/common.h>
#include <MRCMisc/exports.h>
#include <stdbool.h>
#include <stddef.h>

Go to the source code of this file.

Typedefs

typedef struct MR_IteratorRange_MR_ChunkIterator MR_IteratorRange_MR_ChunkIterator
 
typedef struct MR_Chunk MR_Chunk
 
typedef struct MR_ChunkIterator MR_ChunkIterator
 

Functions

MRC_API const MR_uint64_tMR_Chunk_Get_offset (const MR_Chunk *_this)
 
MRC_API void MR_Chunk_Set_offset (MR_Chunk *_this, MR_uint64_t value)
 
MRC_API MR_uint64_tMR_Chunk_GetMutable_offset (MR_Chunk *_this)
 
MRC_API const MR_uint64_tMR_Chunk_Get_size (const MR_Chunk *_this)
 
MRC_API void MR_Chunk_Set_size (MR_Chunk *_this, MR_uint64_t value)
 
MRC_API MR_uint64_tMR_Chunk_GetMutable_size (MR_Chunk *_this)
 
MRC_API MR_ChunkMR_Chunk_DefaultConstruct (void)
 
MRC_API MR_ChunkMR_Chunk_DefaultConstructArray (size_t num_elems)
 
MRC_API MR_ChunkMR_Chunk_ConstructFrom (MR_uint64_t offset, MR_uint64_t size)
 
MRC_API const MR_ChunkMR_Chunk_OffsetPtr (const MR_Chunk *ptr, ptrdiff_t i)
 Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element.
 
MRC_API MR_ChunkMR_Chunk_OffsetMutablePtr (MR_Chunk *ptr, ptrdiff_t i)
 Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element.
 
MRC_API MR_ChunkMR_Chunk_ConstructFromAnother (const MR_Chunk *_other)
 
MRC_API void MR_Chunk_Destroy (const MR_Chunk *_this)
 Destroys a heap-allocated instance of MR_Chunk. Does nothing if the pointer is null.
 
MRC_API void MR_Chunk_DestroyArray (const MR_Chunk *_this)
 Destroys a heap-allocated array of MR_Chunk. Does nothing if the pointer is null.
 
MRC_API MR_ChunkMR_Chunk_AssignFromAnother (MR_Chunk *_this, const MR_Chunk *_other)
 
MRC_API const MR_uint64_tMR_ChunkIterator_Get_totalSize (const MR_ChunkIterator *_this)
 
MRC_API void MR_ChunkIterator_Set_totalSize (MR_ChunkIterator *_this, MR_uint64_t value)
 
MRC_API MR_uint64_tMR_ChunkIterator_GetMutable_totalSize (MR_ChunkIterator *_this)
 
MRC_API const MR_uint64_tMR_ChunkIterator_Get_chunkSize (const MR_ChunkIterator *_this)
 
MRC_API void MR_ChunkIterator_Set_chunkSize (MR_ChunkIterator *_this, MR_uint64_t value)
 
MRC_API MR_uint64_tMR_ChunkIterator_GetMutable_chunkSize (MR_ChunkIterator *_this)
 
MRC_API const MR_uint64_tMR_ChunkIterator_Get_overlap (const MR_ChunkIterator *_this)
 
MRC_API void MR_ChunkIterator_Set_overlap (MR_ChunkIterator *_this, MR_uint64_t value)
 
MRC_API MR_uint64_tMR_ChunkIterator_GetMutable_overlap (MR_ChunkIterator *_this)
 
MRC_API const MR_uint64_tMR_ChunkIterator_Get_index (const MR_ChunkIterator *_this)
 
MRC_API void MR_ChunkIterator_Set_index (MR_ChunkIterator *_this, MR_uint64_t value)
 
MRC_API MR_uint64_tMR_ChunkIterator_GetMutable_index (MR_ChunkIterator *_this)
 
MRC_API MR_ChunkIteratorMR_ChunkIterator_DefaultConstruct (void)
 
MRC_API MR_ChunkIteratorMR_ChunkIterator_DefaultConstructArray (size_t num_elems)
 
MRC_API MR_ChunkIteratorMR_ChunkIterator_ConstructFrom (MR_uint64_t totalSize, MR_uint64_t chunkSize, MR_uint64_t overlap, MR_uint64_t index)
 
MRC_API const MR_ChunkIteratorMR_ChunkIterator_OffsetPtr (const MR_ChunkIterator *ptr, ptrdiff_t i)
 Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element.
 
MRC_API MR_ChunkIteratorMR_ChunkIterator_OffsetMutablePtr (MR_ChunkIterator *ptr, ptrdiff_t i)
 Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element.
 
MRC_API MR_ChunkIteratorMR_ChunkIterator_ConstructFromAnother (const MR_ChunkIterator *_other)
 
MRC_API void MR_ChunkIterator_Destroy (const MR_ChunkIterator *_this)
 Destroys a heap-allocated instance of MR_ChunkIterator. Does nothing if the pointer is null.
 
MRC_API void MR_ChunkIterator_DestroyArray (const MR_ChunkIterator *_this)
 Destroys a heap-allocated array of MR_ChunkIterator. Does nothing if the pointer is null.
 
MRC_API MR_ChunkIteratorMR_ChunkIterator_AssignFromAnother (MR_ChunkIterator *_this, const MR_ChunkIterator *_other)
 
MRC_API bool MR_equal_MR_ChunkIterator (const MR_ChunkIterator *_this, const MR_ChunkIterator *other)
 
MRC_API MR_ChunkIteratorMR_incr_MR_ChunkIterator (MR_ChunkIterator *_this)
 
MRC_API MR_ChunkIteratorMR_post_incr_MR_ChunkIterator (MR_ChunkIterator *_this)
 
MRC_API MR_ChunkMR_deref_MR_ChunkIterator (const MR_ChunkIterator *_this)
 
MRC_API MR_ChunkMR_ChunkIterator_arrow (const MR_ChunkIterator *_this)
 
MRC_API MR_uint64_t MR_chunkCount (MR_uint64_t totalSize, MR_uint64_t chunkSize, const MR_uint64_t *overlap)
 
MRC_API MR_IteratorRange_MR_ChunkIteratorMR_splitByChunks (MR_uint64_t totalSize, MR_uint64_t chunkSize, const MR_uint64_t *overlap)
 

Typedef Documentation

◆ MR_Chunk

typedef struct MR_Chunk MR_Chunk

array chunk representation Generated from class MR::Chunk.

◆ MR_ChunkIterator

iterator class for array chunks Generated from class MR::ChunkIterator.

◆ MR_IteratorRange_MR_ChunkIterator

Function Documentation

◆ MR_Chunk_AssignFromAnother()

MRC_API MR_Chunk * MR_Chunk_AssignFromAnother ( MR_Chunk * _this,
const MR_Chunk * _other )

Generated from a method of class MR::Chunk named operator=. Parameter _this can not be null. It is a single object. Parameter _other can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_Chunk_ConstructFrom()

MRC_API MR_Chunk * MR_Chunk_ConstructFrom ( MR_uint64_t offset,
MR_uint64_t size )

Constructs MR::Chunk elementwise. Never returns null. Returns an instance allocated on the heap! Must call MR_Chunk_Destroy() to free it when you're done using it.

◆ MR_Chunk_ConstructFromAnother()

MRC_API MR_Chunk * MR_Chunk_ConstructFromAnother ( const MR_Chunk * _other)

Generated from a constructor of class MR::Chunk. Parameter _other can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_Chunk_Destroy() to free it when you're done using it.

◆ MR_Chunk_DefaultConstruct()

MRC_API MR_Chunk * MR_Chunk_DefaultConstruct ( void )

Constructs an empty (default-constructed) instance. Never returns null. Returns an instance allocated on the heap! Must call MR_Chunk_Destroy() to free it when you're done using it.

◆ MR_Chunk_DefaultConstructArray()

MRC_API MR_Chunk * MR_Chunk_DefaultConstructArray ( size_t num_elems)

Constructs an array of empty (default-constructed) instances, of the specified size. Will never return null. The array must be destroyed using MR_Chunk_DestroyArray(). Use MR_Chunk_OffsetMutablePtr() and MR_Chunk_OffsetPtr() to access the array elements.

◆ MR_Chunk_Destroy()

MRC_API void MR_Chunk_Destroy ( const MR_Chunk * _this)

Destroys a heap-allocated instance of MR_Chunk. Does nothing if the pointer is null.

◆ MR_Chunk_DestroyArray()

MRC_API void MR_Chunk_DestroyArray ( const MR_Chunk * _this)

Destroys a heap-allocated array of MR_Chunk. Does nothing if the pointer is null.

◆ MR_Chunk_Get_offset()

MRC_API const MR_uint64_t * MR_Chunk_Get_offset ( const MR_Chunk * _this)

chunk offset Returns a pointer to a member variable of class MR::Chunk named offset. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_Chunk_Get_size()

MRC_API const MR_uint64_t * MR_Chunk_Get_size ( const MR_Chunk * _this)

chunk size; the last chunk's size may be smaller than other chunk's ones Returns a pointer to a member variable of class MR::Chunk named size. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_Chunk_GetMutable_offset()

MRC_API MR_uint64_t * MR_Chunk_GetMutable_offset ( MR_Chunk * _this)

chunk offset Returns a mutable pointer to a member variable of class MR::Chunk named offset. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_Chunk_GetMutable_size()

MRC_API MR_uint64_t * MR_Chunk_GetMutable_size ( MR_Chunk * _this)

chunk size; the last chunk's size may be smaller than other chunk's ones Returns a mutable pointer to a member variable of class MR::Chunk named size. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_Chunk_OffsetMutablePtr()

MRC_API MR_Chunk * MR_Chunk_OffsetMutablePtr ( MR_Chunk * ptr,
ptrdiff_t i )

Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element.

◆ MR_Chunk_OffsetPtr()

MRC_API const MR_Chunk * MR_Chunk_OffsetPtr ( const MR_Chunk * ptr,
ptrdiff_t i )

Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element.

◆ MR_Chunk_Set_offset()

MRC_API void MR_Chunk_Set_offset ( MR_Chunk * _this,
MR_uint64_t value )

chunk offset Modifies a member variable of class MR::Chunk named offset. Parameter _this can not be null. It is a single object.

◆ MR_Chunk_Set_size()

MRC_API void MR_Chunk_Set_size ( MR_Chunk * _this,
MR_uint64_t value )

chunk size; the last chunk's size may be smaller than other chunk's ones Modifies a member variable of class MR::Chunk named size. Parameter _this can not be null. It is a single object.

◆ MR_chunkCount()

MRC_API MR_uint64_t MR_chunkCount ( MR_uint64_t totalSize,
MR_uint64_t chunkSize,
const MR_uint64_t * overlap )

returns the amount of chunks of given size required to cover the full array Generated from function MR::chunkCount. Parameter overlap has a default argument: 0, pass a null pointer to use it.

◆ MR_ChunkIterator_arrow()

MRC_API MR_Chunk * MR_ChunkIterator_arrow ( const MR_ChunkIterator * _this)

Generated from a method of class MR::ChunkIterator named operator->. Parameter _this can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_Chunk_Destroy() to free it when you're done using it.

◆ MR_ChunkIterator_AssignFromAnother()

MRC_API MR_ChunkIterator * MR_ChunkIterator_AssignFromAnother ( MR_ChunkIterator * _this,
const MR_ChunkIterator * _other )

Generated from a method of class MR::ChunkIterator named operator=. Parameter _this can not be null. It is a single object. Parameter _other can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_ChunkIterator_ConstructFrom()

MRC_API MR_ChunkIterator * MR_ChunkIterator_ConstructFrom ( MR_uint64_t totalSize,
MR_uint64_t chunkSize,
MR_uint64_t overlap,
MR_uint64_t index )

Constructs MR::ChunkIterator elementwise. Never returns null. Returns an instance allocated on the heap! Must call MR_ChunkIterator_Destroy() to free it when you're done using it.

◆ MR_ChunkIterator_ConstructFromAnother()

MRC_API MR_ChunkIterator * MR_ChunkIterator_ConstructFromAnother ( const MR_ChunkIterator * _other)

Generated from a constructor of class MR::ChunkIterator. Parameter _other can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_ChunkIterator_Destroy() to free it when you're done using it.

◆ MR_ChunkIterator_DefaultConstruct()

MRC_API MR_ChunkIterator * MR_ChunkIterator_DefaultConstruct ( void )

Constructs an empty (default-constructed) instance. Never returns null. Returns an instance allocated on the heap! Must call MR_ChunkIterator_Destroy() to free it when you're done using it.

◆ MR_ChunkIterator_DefaultConstructArray()

MRC_API MR_ChunkIterator * MR_ChunkIterator_DefaultConstructArray ( size_t num_elems)

Constructs an array of empty (default-constructed) instances, of the specified size. Will never return null. The array must be destroyed using MR_ChunkIterator_DestroyArray(). Use MR_ChunkIterator_OffsetMutablePtr() and MR_ChunkIterator_OffsetPtr() to access the array elements.

◆ MR_ChunkIterator_Destroy()

MRC_API void MR_ChunkIterator_Destroy ( const MR_ChunkIterator * _this)

Destroys a heap-allocated instance of MR_ChunkIterator. Does nothing if the pointer is null.

◆ MR_ChunkIterator_DestroyArray()

MRC_API void MR_ChunkIterator_DestroyArray ( const MR_ChunkIterator * _this)

Destroys a heap-allocated array of MR_ChunkIterator. Does nothing if the pointer is null.

◆ MR_ChunkIterator_Get_chunkSize()

MRC_API const MR_uint64_t * MR_ChunkIterator_Get_chunkSize ( const MR_ChunkIterator * _this)

Returns a pointer to a member variable of class MR::ChunkIterator named chunkSize. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_ChunkIterator_Get_index()

MRC_API const MR_uint64_t * MR_ChunkIterator_Get_index ( const MR_ChunkIterator * _this)

Returns a pointer to a member variable of class MR::ChunkIterator named index. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_ChunkIterator_Get_overlap()

MRC_API const MR_uint64_t * MR_ChunkIterator_Get_overlap ( const MR_ChunkIterator * _this)

Returns a pointer to a member variable of class MR::ChunkIterator named overlap. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_ChunkIterator_Get_totalSize()

MRC_API const MR_uint64_t * MR_ChunkIterator_Get_totalSize ( const MR_ChunkIterator * _this)

Returns a pointer to a member variable of class MR::ChunkIterator named totalSize. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_ChunkIterator_GetMutable_chunkSize()

MRC_API MR_uint64_t * MR_ChunkIterator_GetMutable_chunkSize ( MR_ChunkIterator * _this)

Returns a mutable pointer to a member variable of class MR::ChunkIterator named chunkSize. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_ChunkIterator_GetMutable_index()

MRC_API MR_uint64_t * MR_ChunkIterator_GetMutable_index ( MR_ChunkIterator * _this)

Returns a mutable pointer to a member variable of class MR::ChunkIterator named index. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_ChunkIterator_GetMutable_overlap()

MRC_API MR_uint64_t * MR_ChunkIterator_GetMutable_overlap ( MR_ChunkIterator * _this)

Returns a mutable pointer to a member variable of class MR::ChunkIterator named overlap. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_ChunkIterator_GetMutable_totalSize()

MRC_API MR_uint64_t * MR_ChunkIterator_GetMutable_totalSize ( MR_ChunkIterator * _this)

Returns a mutable pointer to a member variable of class MR::ChunkIterator named totalSize. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_ChunkIterator_OffsetMutablePtr()

MRC_API MR_ChunkIterator * MR_ChunkIterator_OffsetMutablePtr ( MR_ChunkIterator * ptr,
ptrdiff_t i )

Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element.

◆ MR_ChunkIterator_OffsetPtr()

MRC_API const MR_ChunkIterator * MR_ChunkIterator_OffsetPtr ( const MR_ChunkIterator * ptr,
ptrdiff_t i )

Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element.

◆ MR_ChunkIterator_Set_chunkSize()

MRC_API void MR_ChunkIterator_Set_chunkSize ( MR_ChunkIterator * _this,
MR_uint64_t value )

Modifies a member variable of class MR::ChunkIterator named chunkSize. Parameter _this can not be null. It is a single object.

◆ MR_ChunkIterator_Set_index()

MRC_API void MR_ChunkIterator_Set_index ( MR_ChunkIterator * _this,
MR_uint64_t value )

Modifies a member variable of class MR::ChunkIterator named index. Parameter _this can not be null. It is a single object.

◆ MR_ChunkIterator_Set_overlap()

MRC_API void MR_ChunkIterator_Set_overlap ( MR_ChunkIterator * _this,
MR_uint64_t value )

Modifies a member variable of class MR::ChunkIterator named overlap. Parameter _this can not be null. It is a single object.

◆ MR_ChunkIterator_Set_totalSize()

MRC_API void MR_ChunkIterator_Set_totalSize ( MR_ChunkIterator * _this,
MR_uint64_t value )

Modifies a member variable of class MR::ChunkIterator named totalSize. Parameter _this can not be null. It is a single object.

◆ MR_deref_MR_ChunkIterator()

MRC_API MR_Chunk * MR_deref_MR_ChunkIterator ( const MR_ChunkIterator * _this)

Generated from a method of class MR::ChunkIterator named operator*. Parameter _this can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_Chunk_Destroy() to free it when you're done using it.

◆ MR_equal_MR_ChunkIterator()

MRC_API bool MR_equal_MR_ChunkIterator ( const MR_ChunkIterator * _this,
const MR_ChunkIterator * other )

Generated from a method of class MR::ChunkIterator named operator==. Parameter _this can not be null. It is a single object. Parameter other can not be null. It is a single object.

◆ MR_incr_MR_ChunkIterator()

MRC_API MR_ChunkIterator * MR_incr_MR_ChunkIterator ( MR_ChunkIterator * _this)

Generated from a method of class MR::ChunkIterator named operator++. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_post_incr_MR_ChunkIterator()

MRC_API MR_ChunkIterator * MR_post_incr_MR_ChunkIterator ( MR_ChunkIterator * _this)

Generated from a method of class MR::ChunkIterator named operator++. Parameter _this can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_ChunkIterator_Destroy() to free it when you're done using it.

◆ MR_splitByChunks()

MRC_API MR_IteratorRange_MR_ChunkIterator * MR_splitByChunks ( MR_uint64_t totalSize,
MR_uint64_t chunkSize,
const MR_uint64_t * overlap )

returns a pair of iterators for chunks covering the array of given size Generated from function MR::splitByChunks. Parameter overlap has a default argument: 0, pass a null pointer to use it. Never returns null. Returns an instance allocated on the heap! Must call MR_IteratorRange_MR_ChunkIterator_Destroy() to free it when you're done using it.