grk::SparseBuffer Struct Reference

`#include <SparseBuffer.h>`

## Public Member Functions

| SparseBuffer ()
| ~SparseBuffer ()
grk_buf8 * | pushBack (uint8_t *buf, size_t len, bool ownsData)
void | incrementCurrentChunkOffset (size_t offset)
size_t | getCurrentChunkLength (void)
uint8_t * | getCurrentChunkPtr (void)
void | rewind (void)
size_t | skip (size_t numBytes)
void | increment (void)
size_t | read (void *buffer, size_t numBytes)
size_t | totalLength (void) const

## Private Member Functions

size_t | getGlobalOffset (void)
bool | copyToContiguousBuffer (uint8_t *buffer)
void | cleanup (void)
size_t | getCurrentChunkOffset (void)
void | pushBack (grk_buf8 *chunk)

## Private Attributes

size_t | dataLen
size_t | currentChunkId
std::vector< grk_buf8 * > | chunks
bool | reachedEnd_

## Constructor & Destructor Documentation

## SparseBuffer()

grk::SparseBuffer::SparseBuffer | ( |  | ) |

## ~SparseBuffer()

grk::SparseBuffer::~SparseBuffer | ( |  | ) |

References cleanup().

## Member Function Documentation

## cleanup()

void grk::SparseBuffer::cleanup | ( | void |  | ) |

private

References chunks, and grk::grk_read().

Referenced by ~SparseBuffer().

## copyToContiguousBuffer()

bool grk::SparseBuffer::copyToContiguousBuffer | ( | uint8_t * | buffer | ) |

private

References chunks, and grk::grk_read().

## getCurrentChunkLength()

size_t grk::SparseBuffer::getCurrentChunkLength | ( | void |  | ) |

References chunks, currentChunkId, and grk::grk_read().

## getCurrentChunkOffset()

size_t grk::SparseBuffer::getCurrentChunkOffset | ( | void |  | ) |

private

References chunks, currentChunkId, and grk::grk_read().

Referenced by getGlobalOffset().

## getCurrentChunkPtr()

uint8_t * grk::SparseBuffer::getCurrentChunkPtr | ( | void |  | ) |

References chunks, currentChunkId, and grk::grk_read().

## getGlobalOffset()

size_t grk::SparseBuffer::getGlobalOffset | ( | void |  | ) |

private

References chunks, currentChunkId, getCurrentChunkOffset(), and grk::grk_read().

Referenced by read(), and skip().

## increment()

void grk::SparseBuffer::increment | ( | void |  | ) |

References chunks, currentChunkId, grk::grk_read(), and reachedEnd_.

Referenced by incrementCurrentChunkOffset().

## incrementCurrentChunkOffset()

void grk::SparseBuffer::incrementCurrentChunkOffset | ( | size_t | offset | ) |

References chunks, currentChunkId, grk::delta, grk::grk_read(), increment(), and reachedEnd_.

Referenced by read(), and skip().

## pushBack() [1/2]

void grk::SparseBuffer::pushBack | ( | grk_buf8 * | chunk | ) |

private

References chunks, currentChunkId, dataLen, grk::grk_read(), and grk::grk_buf< T, A >::len.

## pushBack() [2/2]

grk_buf8 * grk::SparseBuffer::pushBack | ( | uint8_t * | buf,
|  | size_t | len,
|  | bool | ownsData
| ) |  |

References grk::grk_read(), and pushBack().

Referenced by pushBack().

## read()

size_t grk::SparseBuffer::read | ( | void * | buffer,
|  | size_t | numBytes
| ) |  |

References chunks, currentChunkId, dataLen, getGlobalOffset(), grk::grk_read(), grk::GRK_WARN(), and incrementCurrentChunkOffset().

## rewind()

void grk::SparseBuffer::rewind | ( | void |  | ) |

References chunks, currentChunkId, grk::grk_read(), and reachedEnd_.

## skip()

size_t grk::SparseBuffer::skip | ( | size_t | numBytes | ) |

References chunks, currentChunkId, dataLen, getGlobalOffset(), grk::grk_read(), grk::GRK_WARN(), and incrementCurrentChunkOffset().

## totalLength()

size_t grk::SparseBuffer::totalLength | ( | void |  | ) | const

References dataLen.

## Member Data Documentation

## chunks

std::vector<grk_buf8*> grk::SparseBuffer::chunks

private

Referenced by cleanup(), copyToContiguousBuffer(), getCurrentChunkLength(), getCurrentChunkOffset(), getCurrentChunkPtr(), getGlobalOffset(), increment(), incrementCurrentChunkOffset(), pushBack(), read(), rewind(), and skip().

## currentChunkId

size_t grk::SparseBuffer::currentChunkId

private

Referenced by getCurrentChunkLength(), getCurrentChunkOffset(), getCurrentChunkPtr(), getGlobalOffset(), increment(), incrementCurrentChunkOffset(), pushBack(), read(), rewind(), and skip().

## dataLen

size_t grk::SparseBuffer::dataLen

private

Referenced by pushBack(), read(), skip(), and totalLength().

## reachedEnd_

bool grk::SparseBuffer::reachedEnd_

private

Referenced by increment(), incrementCurrentChunkOffset(), and rewind().

The documentation for this struct was generated from the following files:

- SparseBuffer.h
- SparseBuffer.cpp