OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Public Attributes | List of all members
ossim::BlockIStream Class Reference

Allows one to adapt any input stream to be block aligned for any read it will internally read overlapping blocks filling the request. More...

#include <BlockIStream.h>

Inheritance diagram for ossim::BlockIStream:

Public Member Functions

 BlockIStream (std::shared_ptr< ossim::istream > adaptStream, ossim_uint64 blockSize=4096)
 Constructor must be initialized with an inputstream. More...
 
virtual ~BlockIStream ()
 Destructor will set any shared pointer to 0. More...
 
 BlockIStream (std::shared_ptr< ossim::istream > adaptStream, ossim_uint64 blockSize=4096)
 Constructor must be initialized with an inputstream. More...
 
virtual ~BlockIStream ()
 Destructor will set any shared pointer to 0. More...
 

Public Attributes

std::shared_ptr< ossim::istreamm_adaptStream
 Maintain a shared pointer to the stream we are adapting to be block aligned. More...
 
BlockStreamBuffer m_blockStreamBuffer
 The buffer where all the block align implementation resides. More...
 

Detailed Description

Allows one to adapt any input stream to be block aligned for any read it will internally read overlapping blocks filling the request.

Example:

ossim_uint64 blockSize = 4096
std::shared_ptr<ossim::BlockReader> reader = std::make_shared<ossim::BlockReader>(streamToAdapt, blockSize)
reader->seekg(10);
reader->read(buf, 100);

This will read a block of data from 0-4095 and then fill the buffer with 100 bytes of data.

if another call to: reader->read(buf, 10) it will not reload the block but instead read from memory

Definition at line 29 of file BlockIStream.h.

Constructor & Destructor Documentation

◆ BlockIStream() [1/2]

ossim::BlockIStream::BlockIStream ( std::shared_ptr< ossim::istream adaptStream,
ossim_uint64  blockSize = 4096 
)
inline

Constructor must be initialized with an inputstream.

Parameters
adaptStreamCurrenlty a required parameter and is initialized on construction. Takes an input istream to force block aligned requests
blockSizeSpecify the block size to use

Definition at line 40 of file BlockIStream.h.

41  :
43  m_adaptStream(adaptStream),
44  m_blockStreamBuffer(adaptStream.get(), blockSize)
45  {
46  }
std::shared_ptr< ossim::istream > m_adaptStream
Maintain a shared pointer to the stream we are adapting to be block aligned.
Definition: BlockIStream.h:59
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
BlockStreamBuffer m_blockStreamBuffer
The buffer where all the block align implementation resides.
Definition: BlockIStream.h:66

◆ ~BlockIStream() [1/2]

virtual ossim::BlockIStream::~BlockIStream ( )
inlinevirtual

Destructor will set any shared pointer to 0.

Definition at line 51 of file BlockIStream.h.

References m_adaptStream.

51  {
52  m_adaptStream = 0;
53  }
std::shared_ptr< ossim::istream > m_adaptStream
Maintain a shared pointer to the stream we are adapting to be block aligned.
Definition: BlockIStream.h:59

◆ BlockIStream() [2/2]

ossim::BlockIStream::BlockIStream ( std::shared_ptr< ossim::istream adaptStream,
ossim_uint64  blockSize = 4096 
)
inline

Constructor must be initialized with an inputstream.

Parameters
adaptStreamCurrenlty a required parameter and is initialized on construction. Takes an input istream to force block aligned requests
blockSizeSpecify the block size to use

Definition at line 40 of file ossimBlockIStream.h.

41  :
43  m_adaptStream(adaptStream),
44  m_blockStreamBuffer(adaptStream.get(), blockSize)
45  {
46  }
std::shared_ptr< ossim::istream > m_adaptStream
Maintain a shared pointer to the stream we are adapting to be block aligned.
Definition: BlockIStream.h:59
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
BlockStreamBuffer m_blockStreamBuffer
The buffer where all the block align implementation resides.
Definition: BlockIStream.h:66

◆ ~BlockIStream() [2/2]

virtual ossim::BlockIStream::~BlockIStream ( )
inlinevirtual

Destructor will set any shared pointer to 0.

Definition at line 51 of file ossimBlockIStream.h.

References m_adaptStream.

51  {
52  m_adaptStream = 0;
53  }
std::shared_ptr< ossim::istream > m_adaptStream
Maintain a shared pointer to the stream we are adapting to be block aligned.
Definition: BlockIStream.h:59

Member Data Documentation

◆ m_adaptStream

std::shared_ptr< ossim::istream > ossim::BlockIStream::m_adaptStream

Maintain a shared pointer to the stream we are adapting to be block aligned.

Definition at line 59 of file BlockIStream.h.

Referenced by ~BlockIStream().

◆ m_blockStreamBuffer

BlockStreamBuffer ossim::BlockIStream::m_blockStreamBuffer

The buffer where all the block align implementation resides.

Definition at line 66 of file BlockIStream.h.


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