OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
BlockIStream.h
Go to the documentation of this file.
1 #ifndef ossimBlockStream_HEADER
2 #define ossimBlockStream_HEADER 1
4 
5 namespace ossim {
30  {
31  public:
40  BlockIStream(std::shared_ptr<ossim::istream> adaptStream,
41  ossim_uint64 blockSize=4096):
43  m_adaptStream(adaptStream),
44  m_blockStreamBuffer(adaptStream.get(), blockSize)
45  {
46  }
47 
51  virtual ~BlockIStream(){
52  m_adaptStream = 0;
53  }
54 
59  std::shared_ptr<ossim::istream> m_adaptStream;
60 
67  };
68 }
69 
70 #endif
virtual ~BlockIStream()
Destructor will set any shared pointer to 0.
Definition: BlockIStream.h:51
This code was derived from https://gist.github.com/mshockwave.
Definition: Barrier.h:8
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(std::shared_ptr< ossim::istream > adaptStream, ossim_uint64 blockSize=4096)
Constructor must be initialized with an inputstream.
Definition: BlockIStream.h:40
unsigned long long ossim_uint64
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
Allows one to adapt any input stream to be block aligned for any read it will internally read overlap...
Definition: BlockIStream.h:29
BlockStreamBuffer m_blockStreamBuffer
The buffer where all the block align implementation resides.
Definition: BlockIStream.h:66
This is the BlockStreamBuffer class and derives from stream buf.