OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
|
This is the BlockStreamBuffer class and derives from stream buf. More...
#include <BlockStreamBuffer.h>
Public Member Functions | |
BlockStreamBuffer (ossim::istream *adaptStream=0, ossim_uint64 blockSize=0) | |
virtual | ~BlockStreamBuffer () |
Protected Member Functions | |
virtual std::streambuf * | setbuf (char *s, std::streamsize n) |
This is a virtual method that can be overriden. More... | |
void | setgPtrs () |
setgPtrs calls setg and sets the eback egptr and gptr. More... | |
void | loadBlock () |
loadBlock will load data into the current block and call the setgPtrs to adjust the internal pointers tha the base streambuf may use More... | |
virtual pos_type | seekoff (off_type offset, std::ios_base::seekdir dir, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out) |
this is a protected method overriden from streambuf base. More... | |
virtual pos_type | seekpos (pos_type pos, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out) |
seekpos is overriden from the base streambuf class. More... | |
virtual std::streamsize | xsgetn (char_type *s, std::streamsize n) |
xsgetn is a protected virtual method that we override from the base streambuf. More... | |
virtual int | underflow () |
underflow is overriden from the base streambuf. More... | |
void | syncCurrentPosition () |
syncCurrentPosition is a utility method that we call internally in the overriden protected methods that will sync the location of the gptr to the absolute byte offset variable we are using internally. More... | |
Protected Attributes | |
std::vector< char > | m_blockBuffer |
The block buffer that we set the buf pointers to. More... | |
ossim_int64 | m_currentPosValue |
holds the current absolute byte position More... | |
BlockBufInfo | m_blockInfo |
Holds the information about the block. More... | |
ossim::istream * | m_adaptStream |
The stream we are adapting. More... | |
This is the BlockStreamBuffer class and derives from stream buf.
This class
Definition at line 168 of file BlockStreamBuffer.h.
ossim::BlockStreamBuffer::BlockStreamBuffer | ( | ossim::istream * | adaptStream = 0 , |
ossim_uint64 | blockSize = 0 |
||
) |
Definition at line 7 of file BlockStreamBuffer.cpp.
References m_blockBuffer, ossim::BlockBufInfo::m_blockBufferPtr, m_blockInfo, and ossim::BlockBufInfo::m_blockSize.
|
inlinevirtual |
Definition at line 171 of file BlockStreamBuffer.h.
|
protected |
loadBlock will load data into the current block and call the setgPtrs to adjust the internal pointers tha the base streambuf may use
Definition at line 49 of file BlockStreamBuffer.cpp.
|
protectedvirtual |
this is a protected method overriden from streambuf base.
we will convert the offset byte to an absolute if we can and then call the seek pos for the absolute seek
Definition at line 79 of file BlockStreamBuffer.cpp.
|
protectedvirtual |
seekpos is overriden from the base streambuf class.
This is the seek of the aboslute position. We will check to see if the new position resides in the block and if so we just update our pointers and return the pos. If bnot then we use the adapted stream call to seek to the position and update our internal pointers.
pos | The absolute position to seek to the mode used. Should be in |
Definition at line 126 of file BlockStreamBuffer.cpp.
|
protectedvirtual |
This is a virtual method that can be overriden.
pubsetbuf can be called and calls this protected method to set a buffer.
s | The starting address of a byte buffer |
n | The size of the buffer |
Definition at line 22 of file BlockStreamBuffer.cpp.
References n.
|
protected |
setgPtrs calls setg and sets the eback egptr and gptr.
to the managed buffer's valid window
Definition at line 34 of file BlockStreamBuffer.cpp.
|
protected |
syncCurrentPosition is a utility method that we call internally in the overriden protected methods that will sync the location of the gptr to the absolute byte offset variable we are using internally.
The problem is, when things like ignore(...) peek(...) and other options are used on an input stream the base might adjust the gptr location. When this is adjusted outside our control the offsets might get out of sync this is called to ensure this does not happen
Definition at line 261 of file BlockStreamBuffer.cpp.
|
protectedvirtual |
underflow is overriden from the base streambuf.
It check to see if the current block is loaded and if not load the block. The method returns what is currently pointed to by the absolute offset or basically return *gptr().
Definition at line 231 of file BlockStreamBuffer.cpp.
|
protectedvirtual |
xsgetn is a protected virtual method that we override from the base streambuf.
The method will load blocks of data to service the requested buffer to fill. If the request covers several block it will iterate and load each block of data until the request is satisfied.
s | The destination buffer large enough to hold the characters being requested |
n | The number of characters to request from the input stream |
Definition at line 165 of file BlockStreamBuffer.cpp.
|
protected |
The stream we are adapting.
Definition at line 195 of file BlockStreamBuffer.h.
|
protected |
The block buffer that we set the buf pointers to.
Definition at line 178 of file BlockStreamBuffer.h.
Referenced by BlockStreamBuffer().
|
protected |
Holds the information about the block.
It tells us if the block is currently loaded and what the valid size is
Definition at line 190 of file BlockStreamBuffer.h.
Referenced by BlockStreamBuffer().
|
protected |
holds the current absolute byte position
Definition at line 183 of file BlockStreamBuffer.h.