grk::grk_buf< T, A > Struct Template Reference

`#include <buffer.h>`

Inheritance diagram for grk::grk_buf< T, A >:

## Public Member Functions

| grk_buf (T *buffer, size_t off, size_t length, bool ownsData)
| grk_buf (T *buffer, size_t length)
| grk_buf ()
| grk_buf (T *buffer, size_t length, bool ownsData)
virtual | ~grk_buf ()
| grk_buf (const grk_buf &rhs)
grk_buf & | operator= (const grk_buf &rhs)
grk_buf & | operator= (const grk_buf *rhs)
bool | canRead (void)
T | read (void)
bool | write (T val)
bool | write (T *b, size_t size)
virtual bool | alloc (size_t length)
virtual void | dealloc ()
void | attach (T *buffer)
void | acquire (T *buffer)
void | transfer (T **buffer)
size_t | remainingLength (void)
void | incrementOffset (ptrdiff_t off)
T * | currPtr (void) const

## Public Attributes

T * | buf
size_t | offset
size_t | len
bool | owns_data

## Constructor & Destructor Documentation

## grk_buf() [1/5]

template<typename T , template< typename TT > typename A>

grk::grk_buf< T, A >::grk_buf | ( | T * | buffer,
|  | size_t | off,
|  | size_t | length,
|  | bool | ownsData
| ) |  |

inline

## grk_buf() [2/5]

template<typename T , template< typename TT > typename A>

grk::grk_buf< T, A >::grk_buf | ( | T * | buffer,
|  | size_t | length
| ) |  |

inline

## grk_buf() [3/5]

template<typename T , template< typename TT > typename A>

grk::grk_buf< T, A >::grk_buf | ( |  | ) |

inline

## grk_buf() [4/5]

template<typename T , template< typename TT > typename A>

grk::grk_buf< T, A >::grk_buf | ( | T * | buffer,
|  | size_t | length,
|  | bool | ownsData
| ) |  |

inline

## ~grk_buf()

template<typename T , template< typename TT > typename A>

virtual grk::grk_buf< T, A >::~grk_buf | ( |  | ) |

inline virtual

References grk::grk_buf< T, A >::dealloc().

## grk_buf() [5/5]

template<typename T , template< typename TT > typename A>

grk::grk_buf< T, A >::grk_buf | ( | const grk_buf< T, A > & | rhs | ) |

inline explicit

References grk::grk_buf< T, A >::operator=().

## Member Function Documentation

## acquire()

template<typename T , template< typename TT > typename A>

void grk::grk_buf< T, A >::acquire | ( | T * | buffer | ) |

inline

References grk::grk_buf< T, A >::buf, grk::grk_buf< T, A >::dealloc(), and grk::grk_buf< T, A >::owns_data.

Referenced by grk::grk_buf2d< T, A >::acquire().

## alloc()

template<typename T , template< typename TT > typename A>

virtual bool grk::grk_buf< T, A >::alloc | ( | size_t | length | ) |

inline virtual

References grk::grk_buf< T, A >::buf, grk::grk_buf< T, A >::dealloc(), grk::grk_buf< T, A >::len, grk::grk_buf< T, A >::offset, and grk::grk_buf< T, A >::owns_data.

Referenced by grk::FileFormatDecompress::read_xml().

## attach()

template<typename T , template< typename TT > typename A>

void grk::grk_buf< T, A >::attach | ( | T * | buffer | ) |

inline

References grk::grk_buf< T, A >::buf, and grk::grk_buf< T, A >::dealloc().

Referenced by grk::grk_buf2d< T, A >::attach().

## canRead()

template<typename T , template< typename TT > typename A>

bool grk::grk_buf< T, A >::canRead | ( | void |  | ) |

inline

References grk::grk_buf< T, A >::len, and grk::grk_buf< T, A >::offset.

Referenced by grk::PLMarkerMgr::pop().

## currPtr()

template<typename T , template< typename TT > typename A>

T * grk::grk_buf< T, A >::currPtr | ( | void |  | ) | const

inline

References grk::grk_buf< T, A >::buf, and grk::grk_buf< T, A >::offset.

Referenced by grk::grk_buf2d< T, A >::address(), grk::BufferedStream::flush(), grk::grk_buf2d< T, A >::getBuffer(), grk::BufferedStream::getZeroCopyPtr(), grk::BufferedStream::read(), grk::BufferedStream::read_seek(), grk::BufferedStream::write(), and grk::BufferedStream::writeBytes().

## dealloc()

template<typename T , template< typename TT > typename A>

virtual void grk::grk_buf< T, A >::dealloc | ( |  | ) |

inline virtual

Reimplemented in grk::AsocBox.

References grk::grk_buf< T, A >::buf, grk::grk_buf< T, A >::len, grk::grk_buf< T, A >::offset, and grk::grk_buf< T, A >::owns_data.

Referenced by grk::grk_buf< T, A >::acquire(), grk::grk_buf< T, A >::alloc(), grk::grk_buf2d< T, A >::attach(), grk::grk_buf< T, A >::attach(), grk::DecompressCodeblock::release(), grk::Codeblock::~Codeblock(), grk::CompressCodeblock::~CompressCodeblock(), grk::FileFormat::~FileFormat(), and grk::grk_buf< T, A >::~grk_buf().

## incrementOffset()

template<typename T , template< typename TT > typename A>

void grk::grk_buf< T, A >::incrementOffset | ( | ptrdiff_t | off | ) |

inline

References grk::grk_read(), grk::GRK_WARN(), grk::grk_buf< T, A >::len, grk::grk_buf< T, A >::offset, and SIZE_MAX.

Referenced by grk::BufferedStream::flush(), grk::BufferedStream::read(), grk::BufferedStream::read_seek(), and grk::BufferedStream::writeIncrement().

## operator=() [1/2]

template<typename T , template< typename TT > typename A>

grk_buf & grk::grk_buf< T, A >::operator= | ( | const grk_buf< T, A > & | rhs | ) |

inline

References grk::grk_read(), and grk::grk_buf< T, A >::operator=().

Referenced by grk::grk_buf< T, A >::grk_buf(), grk::grk_buf< T, A >::operator=(), and grk::grk_buf2d< T, A >::operator=().

## operator=() [2/2]

template<typename T , template< typename TT > typename A>

grk_buf & grk::grk_buf< T, A >::operator= | ( | const grk_buf< T, A > * | rhs | ) |

inline

References grk::grk_buf< T, A >::buf, grk::grk_read(), grk::grk_buf< T, A >::len, grk::grk_buf< T, A >::offset, and grk::grk_buf< T, A >::owns_data.

## read()

template<typename T , template< typename TT > typename A>

T grk::grk_buf< T, A >::read | ( | void |  | ) |

inline

References grk::grk_buf< T, A >::buf, and grk::grk_buf< T, A >::offset.

Referenced by grk::PLMarkerMgr::pop().

## remainingLength()

template<typename T , template< typename TT > typename A>

size_t grk::grk_buf< T, A >::remainingLength | ( | void |  | ) |

inline

References grk::grk_buf< T, A >::len, and grk::grk_buf< T, A >::offset.

## transfer()

template<typename T , template< typename TT > typename A>

void grk::grk_buf< T, A >::transfer | ( | T ** | buffer | ) |

inline

References grk::grk_buf< T, A >::buf, grk::grk_read(), and grk::grk_buf< T, A >::owns_data.

Referenced by grk::grk_buf2d< T, A >::transfer().

## write() [1/2]

template<typename T , template< typename TT > typename A>

bool grk::grk_buf< T, A >::write | ( | T * | b,
|  | size_t | size
| ) |  |

inline

References grk::grk_buf< T, A >::buf, grk::grk_read(), grk::grk_buf< T, A >::len, and grk::grk_buf< T, A >::offset.

## write() [2/2]

template<typename T , template< typename TT > typename A>

bool grk::grk_buf< T, A >::write | ( | T | val | ) |

inline

References grk::grk_buf< T, A >::buf, grk::grk_buf< T, A >::len, and grk::grk_buf< T, A >::offset.

Referenced by grk::PLMarkerMgr::pushPL().

## Member Data Documentation

## buf

template<typename T , template< typename TT > typename A>

T* grk::grk_buf< T, A >::buf

Referenced by grk::grk_buf< T, A >::acquire(), grk::grk_buf< T, A >::alloc(), grk::grk_buf2d< T, A >::alloc2d(), grk::CompressCodeblock::allocData(), grk::grk_buf2d< T, A >::attach(), grk::grk_buf< T, A >::attach(), grk::grk_buf2d< T, A >::copyFrom(), grk::DecompressCodeblock::copyToContiguousBuffer(), grk::grk_buf< T, A >::currPtr(), grk::grk_buf< T, A >::dealloc(), grk::BufferedStream::flush(), grk::grk_buf< T, A >::operator=(), grk::BufferedStream::read(), grk::grk_buf< T, A >::read(), grk::BufferedStream::read_seek(), grk::FileFormatDecompress::read_xml(), grk::FileFormatDecompress::readHeader(), grk::FileFormatDecompress::serializeAsoc(), grk::grk_buf2d< T, A >::simple(), grk::grk_buf2d< T, A >::simpleF(), grk::grk_buf< T, A >::transfer(), grk::grk_buf< T, A >::write(), grk::grk_buf< T, A >::write(), grk::FileFormatCompress::write_buffer(), and grk::FileFormatCompress::write_jp2h().

## len

template<typename T , template< typename TT > typename A>

size_t grk::grk_buf< T, A >::len

Referenced by grk::grk_buf< T, A >::alloc(), grk::CompressCodeblock::allocData(), grk::grk_buf2d< T, A >::attach(), grk::grk_buf< T, A >::canRead(), grk::compress_synch_with_plugin(), grk::grk_buf2d< T, A >::memcpy_from::copy(), grk::grk_buf2d< T, A >::copyFrom(), grk::grk_buf< T, A >::dealloc(), grk::grk_buf< T, A >::incrementOffset(), grk::grk_buf< T, A >::operator=(), grk::PLMarkerMgr::pop(), grk::SparseBuffer::pushBack(), grk::BufferedStream::read(), grk::FileFormatDecompress::read_xml(), grk::FileFormatDecompress::readHeader(), grk::grk_buf< T, A >::remainingLength(), grk::FileFormatDecompress::serializeAsoc(), grk::grk_buf< T, A >::write(), grk::grk_buf< T, A >::write(), grk::BufferedStream::write(), grk::FileFormatCompress::write_buffer(), grk::FileFormatCompress::write_jp2h(), and grk::BufferedStream::writeBytes().

## offset

template<typename T , template< typename TT > typename A>

size_t grk::grk_buf< T, A >::offset

Referenced by grk::grk_buf< T, A >::alloc(), grk::grk_buf< T, A >::canRead(), grk::DecompressCodeblock::copyToContiguousBuffer(), grk::grk_buf< T, A >::currPtr(), grk::grk_buf< T, A >::dealloc(), grk::BufferedStream::flush(), grk::grk_buf< T, A >::incrementOffset(), grk::BufferedStream::invalidate_buffer(), grk::grk_buf< T, A >::operator=(), grk::PLMarkerMgr::pop(), grk::grk_buf< T, A >::read(), grk::grk_buf< T, A >::remainingLength(), grk::grk_buf< T, A >::write(), grk::grk_buf< T, A >::write(), grk::BufferedStream::write_seek(), and grk::BufferedStream::writeBytes().

## owns_data

template<typename T , template< typename TT > typename A>

bool grk::grk_buf< T, A >::owns_data

Referenced by grk::grk_buf< T, A >::acquire(), grk::grk_buf< T, A >::alloc(), grk::CompressCodeblock::allocData(), grk::grk_buf2d< T, A >::attach(), grk::compress_synch_with_plugin(), grk::grk_buf< T, A >::dealloc(), grk::BufferedStream::isMemStream(), grk::grk_buf< T, A >::operator=(), and grk::grk_buf< T, A >::transfer().

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

- buffer.h