|
MrSID Decode SDK for Raster Reference Manual 9.5.5.5244
|
holds a memory buffer of variable size More...
#include <lt_ioDynamicMemStream.h>


Public Member Functions | |
Initialization functions | |
| virtual LT_STATUS | initialize (lt_uint32 size=4096, float growthRate=2) |
| Initializes the stream. More... | |
| virtual LT_STATUS | initialize (lt_uint32 size, Allocator allo, Deallocator deallo, Reallocator reallo=nullptr, float growthRate=2) |
| Initializes the stream, with custom memory management. More... | |
| virtual bool | isEOF () |
| Initializes the stream. More... | |
| virtual bool | isOpen () |
| Initializes the stream. More... | |
| virtual LT_STATUS | open () |
| Initializes the stream. More... | |
| virtual LT_STATUS | close () |
| Initializes the stream. More... | |
| virtual lt_uint32 | read (lt_uint8 *pDest, lt_uint32 numBytes) |
| Initializes the stream. More... | |
| virtual lt_uint32 | write (const lt_uint8 *pSrc, lt_uint32 numBytes) |
| Initializes the stream. More... | |
| virtual LT_STATUS | seek (lt_int64 offset, LTIOSeekDir origin) |
| Initializes the stream. More... | |
| virtual lt_int64 | tell () |
| Initializes the stream. More... | |
Public Member Functions inherited from LTIOStreamInf | |
| virtual | ~LTIOStreamInf ()=0 |
Memory Allocation and Deallocation Functions | |
| typedef void *(* | Allocator) (size_t) |
| typedef void(* | Deallocator) (void *) |
| typedef void *(* | Reallocator) (void *, size_t) |
| LTIODynamicMemStream () | |
| virtual | ~LTIODynamicMemStream () |
Memory Management | |
| lt_uint8 * | m_data |
| pointer to buffer More... | |
| lt_uint32 | m_initialSize |
| initial size of buffer More... | |
| lt_uint32 | m_bufferSize |
| size of buffer as allocated More... | |
| lt_uint32 | m_userSize |
| size of buffer as accessible by user More... | |
| lt_uint32 | m_cur |
| current position More... | |
| bool | m_isOpen |
| openness More... | |
| Allocator | m_alloc |
| allocator function More... | |
| Deallocator | m_dealloc |
| deallocator More... | |
| Reallocator | m_realloc |
| reallocator More... | |
| LT_STATUS | m_lastError |
| pointer to buffer More... | |
| bool | m_isEOF |
| pointer to buffer More... | |
| float | m_growthRate |
| the factor of growth of the memory [1-2): More... | |
| Allocator | getAllocator () const |
| Returns the allocator function pointer. More... | |
| Deallocator | getDeallocator () const |
| Returns the deallocator function pointer. More... | |
| Reallocator | getReallocator () const |
| Returns the reallocator function pointer. More... | |
| const lt_uint8 * | getData () const |
| Get the underlying buffer. More... | |
| LT_STATUS | detachAndClose (lt_uint8 *&data) |
| Detach the underlying buffer from the stream, and closes the stream. More... | |
| lt_uint64 | size () const |
| Returns the number of bytes which are in the stream. More... | |
| virtual LTIOStreamInf * | duplicate () |
| pointer to buffer More... | |
| virtual LT_STATUS | getLastError () const |
| pointer to buffer More... | |
| virtual const char * | getID () const |
| pointer to buffer More... | |
| virtual char * | readString (int delimiter) |
| pointer to buffer More... | |
| bool | grow (lt_uint32 numBytes) |
| extend size of data buffer if required More... | |
| void * | defaultRealloc (void *, size_t) |
| pointer to buffer More... | |
Unlike LTIOMemStream, which uses a fixed-size buffer, this class will grow its buffer as you write past the end of it. It is most suitable for use as an internal "temp stream". The stream is initially empty.
The stream cannot hold more than 2^32 bytes of data.
Definition at line 27 of file lt_ioDynamicMemStream.h.
| typedef void *(* LTIODynamicMemStream::Allocator) (size_t) |
Definition at line 37 of file lt_ioDynamicMemStream.h.
| typedef void(* LTIODynamicMemStream::Deallocator) (void *) |
Definition at line 38 of file lt_ioDynamicMemStream.h.
| typedef void *(* LTIODynamicMemStream::Reallocator) (void *, size_t) |
Definition at line 39 of file lt_ioDynamicMemStream.h.
| LTIODynamicMemStream::LTIODynamicMemStream | ( | ) |
|
virtual |
|
virtual |
| size | initial size of buffer in bytes |
| growthRate | factor of growth Valid Values: [1-2) |
Implements LTIOStreamInf.
|
protected |
The caller is responsible for deallocating the buffer. (Note that you must use the Deallocator method, not delete[].)
| data | receives pointer to underlying buffer |
|
virtual |
Implements LTIOStreamInf.
|
inline |
Definition at line 95 of file lt_ioDynamicMemStream.h.
References m_alloc.
|
inline |
The pointer is guaranteed to be good until the next call to write(), or close()
Definition at line 115 of file lt_ioDynamicMemStream.h.
References m_data.
|
inline |
Definition at line 100 of file lt_ioDynamicMemStream.h.
References m_dealloc.
|
virtual |
Implements LTIOStreamInf.
|
virtual |
Implements LTIOStreamInf.
|
inline |
Definition at line 105 of file lt_ioDynamicMemStream.h.
References m_realloc.
|
protected |
|
virtual |
The allocator function should return nullptr in the event of failure, as opposed to throwing an exception – that is, be like malloc() and not like new.
| size | initial size of buffer in bytes |
| allo | user-defined memory allocator |
| deallo | user-defined memory deallocator |
| reallo | user-defined memory reallocator |
| growthRate | factor of growth Valid Values: [1-2) |
|
virtual |
| size | initial size of buffer in bytes |
| growthRate | factor of growth Valid Values: [1-2) |
|
virtual |
| size | initial size of buffer in bytes |
| growthRate | factor of growth Valid Values: [1-2) |
Implements LTIOStreamInf.
|
virtual |
| size | initial size of buffer in bytes |
| growthRate | factor of growth Valid Values: [1-2) |
Implements LTIOStreamInf.
|
virtual |
| size | initial size of buffer in bytes |
| growthRate | factor of growth Valid Values: [1-2) |
Implements LTIOStreamInf.
| size | initial size of buffer in bytes |
| growthRate | factor of growth Valid Values: [1-2) |
Implements LTIOStreamInf.
|
virtual |
Reimplemented from LTIOStreamInf.
|
virtual |
| size | initial size of buffer in bytes |
| growthRate | factor of growth Valid Values: [1-2) |
Implements LTIOStreamInf.
|
inline |
This may be smaller than the amount actually allocated.
Definition at line 137 of file lt_ioDynamicMemStream.h.
References m_userSize.
|
virtual |
| size | initial size of buffer in bytes |
| growthRate | factor of growth Valid Values: [1-2) |
Implements LTIOStreamInf.
| size | initial size of buffer in bytes |
| growthRate | factor of growth Valid Values: [1-2) |
Implements LTIOStreamInf.
|
protected |
Definition at line 169 of file lt_ioDynamicMemStream.h.
Referenced by getAllocator().
|
protected |
Definition at line 157 of file lt_ioDynamicMemStream.h.
|
protected |
Definition at line 163 of file lt_ioDynamicMemStream.h.
|
protected |
Definition at line 151 of file lt_ioDynamicMemStream.h.
Referenced by getData().
|
protected |
Definition at line 172 of file lt_ioDynamicMemStream.h.
Referenced by getDeallocator().
|
protected |
Definition at line 184 of file lt_ioDynamicMemStream.h.
|
protected |
Definition at line 154 of file lt_ioDynamicMemStream.h.
|
protected |
Definition at line 181 of file lt_ioDynamicMemStream.h.
|
protected |
Definition at line 166 of file lt_ioDynamicMemStream.h.
|
protected |
Definition at line 179 of file lt_ioDynamicMemStream.h.
|
protected |
Definition at line 175 of file lt_ioDynamicMemStream.h.
Referenced by getReallocator().
|
protected |
Definition at line 160 of file lt_ioDynamicMemStream.h.
Referenced by size().
| Extensis |