OpendTect  7.0
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 (file_size_type knownsize=0)
 
 ~ReadCache ()
 
void clearData () override
 
file_size_type getAt (FilePosType, BufType *, file_size_type) const
 
bool isAvailable (FilePosType, file_size_type) const
 
bool setData (FileChunkType, const BufType *)
 if fail, memory was full; now the cache is cleared More...
 
void setMinCacheSize (file_size_type) override
 
FileChunkSetType stillNeededDataFor (FilePosType, ChunkSizeType) const
 
- Public Member Functions inherited from Network::FileCache
virtual ~FileCache ()
 
block_idx_type blockIdx (FilePosType) const
 
BlockSizeType blockSize (block_idx_type) const
 
BufTypegetBlock (block_idx_type)
 
const BufTypegetBlock (block_idx_type) const
 
bool isEmpty () const
 
bool isLiveBlock (block_idx_type) const
 
file_size_type size () const
 
bool validBlockIdx (block_idx_type bidx) const
 

Protected Member Functions

void handleNewLiveBlock (block_idx_type) override
 
- Protected Member Functions inherited from Network::FileCache
 FileCache (file_size_type)
 
void clearBlocks ()
 
void dismissBlock (block_idx_type)
 
BlockgtBlk (block_idx_type) const
 
FilePosType lastBlockPos () const
 
FilePosType lastFilePos () const
 

Protected Attributes

TypeSet< block_idx_typeliveblockidxs_
 
block_idx_type maxnrliveblocks_
 
- Protected Attributes inherited from Network::FileCache
ObjectSet< Blockblocks_
 
const file_size_type knownfilesize_
 
const BlockSizeType lastblocksz_
 

Additional Inherited Members

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

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

◆ ReadCache()

Network::ReadCache::ReadCache ( file_size_type  knownsize = 0)

◆ ~ReadCache()

Network::ReadCache::~ReadCache ( )

Member Function Documentation

◆ clearData()

void Network::ReadCache::clearData ( )
overridevirtual

Implements Network::FileCache.

◆ getAt()

file_size_type Network::ReadCache::getAt ( FilePosType  ,
BufType ,
file_size_type   
) const

◆ handleNewLiveBlock()

void Network::ReadCache::handleNewLiveBlock ( block_idx_type  )
overrideprotectedvirtual

Reimplemented from Network::FileCache.

◆ isAvailable()

bool Network::ReadCache::isAvailable ( FilePosType  ,
file_size_type   
) const

◆ setData()

bool Network::ReadCache::setData ( FileChunkType  ,
const BufType  
)

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

◆ setMinCacheSize()

void Network::ReadCache::setMinCacheSize ( file_size_type  )
overridevirtual

Implements Network::FileCache.

◆ stillNeededDataFor()

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

Member Data Documentation

◆ liveblockidxs_

TypeSet<block_idx_type> Network::ReadCache::liveblockidxs_
protected

◆ maxnrliveblocks_

block_idx_type Network::ReadCache::maxnrliveblocks_
protected

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