OpendTect  6.3
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Network::ReadCache Class Reference
Inheritance diagram for Network::ReadCache:
[legend]

Public Member Functions

 ReadCache (FileSizeType knownsize=0)
 
 ~ReadCache ()
 
virtual void clearData ()
 
virtual void setMinCacheSize (FileSizeType)
 
bool isAvailable (FilePosType, FileSizeType) const
 
FileSizeType getAt (FilePosType, BufType *, FileSizeType) const
 
FileChunkSetType stillNeededDataFor (FilePosType, ChunkSizeType) const
 
bool setData (FileChunkType, const BufType *)
 if fail, memory was full; now the cache is cleared More...
 
- Public Member Functions inherited from Network::FileCache
virtual ~FileCache ()
 
FileSizeType size () const
 
bool isEmpty () const
 
BlockIdxType blockIdx (FilePosType) const
 
BlockSizeType blockSize (BlockIdxType) const
 
bool validBlockIdx (BlockIdxType bidx) const
 
bool isLiveBlock (BlockIdxType) const
 
BufTypegetBlock (BlockIdxType)
 
const BufTypegetBlock (BlockIdxType) const
 

Protected Member Functions

virtual void handleNewLiveBlock (BlockIdxType)
 
- Protected Member Functions inherited from Network::FileCache
 FileCache (FileSizeType)
 
BlockgtBlk (BlockIdxType) const
 
void dismissBlock (BlockIdxType)
 
void clearBlocks ()
 
FilePosType lastBlockPos () const
 
FilePosType lastFilePos () const
 

Protected Attributes

TypeSet< BlockIdxTypeliveblockidxs_
 
BlockIdxType maxnrliveblocks_
 
- Protected Attributes inherited from Network::FileCache
ObjectSet< Blockblocks_
 
const BlockSizeType lastblocksz_
 
const FileSizeType knownfilesize_
 

Additional Inherited Members

- Public Types inherited from Network::FileCache
typedef unsigned char BufType
 
typedef int ChunkSizeType
 
typedef od_stream_Count FileSizeType
 
typedef od_stream_Pos FilePosType
 
typedef Interval< FilePosTypeFileChunkType
 
typedef TypeSet< FileChunkTypeFileChunkSetType
 
typedef ObjectSet< Block >::size_type BlockIdxType
 
typedef Block::SizeType BlockSizeType
 
- Static Public Member Functions inherited from Network::FileCache
static FilePosType blockStart (BlockIdxType)
 

Detailed Description

Write Cache.

When writing, we need a buffer to write data to. To allow jumping around a bit, we'll have to retain the first block (so a header can be updated later), and a couple of blocks before the last block. Therefore, the cache assumes writing steadily on, with maybe going back to the first block, or one of the near previous ones. Random jumping around may lead to bad stuff.

Constructor & Destructor Documentation

Network::ReadCache::ReadCache ( FileSizeType  knownsize = 0)
Network::ReadCache::~ReadCache ( )

Member Function Documentation

virtual void Network::ReadCache::clearData ( )
virtual

Implements Network::FileCache.

FileSizeType Network::ReadCache::getAt ( FilePosType  ,
BufType ,
FileSizeType   
) const
virtual void Network::ReadCache::handleNewLiveBlock ( BlockIdxType  )
protectedvirtual

Reimplemented from Network::FileCache.

bool Network::ReadCache::isAvailable ( FilePosType  ,
FileSizeType   
) const
bool Network::ReadCache::setData ( FileChunkType  ,
const BufType  
)

if fail, memory was full; now the cache is cleared

virtual void Network::ReadCache::setMinCacheSize ( FileSizeType  )
virtual

Implements Network::FileCache.

FileChunkSetType Network::ReadCache::stillNeededDataFor ( FilePosType  ,
ChunkSizeType   
) const

Member Data Documentation

TypeSet<BlockIdxType> Network::ReadCache::liveblockidxs_
protected
BlockIdxType Network::ReadCache::maxnrliveblocks_
protected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2017