OpendTect
7.0
|
Classes | |
class | Block |
Public Types | |
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< FileChunkType > | FileChunkSetType |
typedef Interval< FilePosType > | FileChunkType |
typedef od_stream_Pos | FilePosType |
Public Member Functions | |
virtual | ~FileCache () |
block_idx_type | blockIdx (FilePosType) const |
BlockSizeType | blockSize (block_idx_type) const |
virtual void | clearData ()=0 |
BufType * | getBlock (block_idx_type) |
const BufType * | getBlock (block_idx_type) const |
bool | isEmpty () const |
bool | isLiveBlock (block_idx_type) const |
virtual void | setMinCacheSize (file_size_type)=0 |
file_size_type | size () const |
bool | validBlockIdx (block_idx_type bidx) const |
Static Public Member Functions | |
static FilePosType | blockStart (block_idx_type) |
Protected Member Functions | |
FileCache (file_size_type) | |
void | clearBlocks () |
void | dismissBlock (block_idx_type) |
Block * | gtBlk (block_idx_type) const |
virtual void | handleNewLiveBlock (block_idx_type) |
FilePosType | lastBlockPos () const |
FilePosType | lastFilePos () const |
Protected Attributes | |
ObjectSet< Block > | blocks_ |
const file_size_type | knownfilesize_ |
const BlockSizeType | lastblocksz_ |
< Cache for files in blocks of a couple of MBs. Not MT protected.
<>Read Cache.
When reading, we need some buffering to avoid lots of HTTP requests. The idea if to stuff data into blocks, and keep track of the 'oldest' blocks so we can dump them as we go (we'll haveto, otherwise we end up holding the entire file in memory). As headers and trailers are often revisited, we will always keep the first and last block.
typedef ObjectSet<Block>::size_type Network::FileCache::block_idx_type |
typedef unsigned char Network::FileCache::BufType |
typedef int Network::FileCache::ChunkSizeType |
typedef od_stream_Count Network::FileCache::file_size_type |
typedef od_stream_Pos Network::FileCache::FilePosType |
|
virtual |
|
protected |
block_idx_type Network::FileCache::blockIdx | ( | FilePosType | ) | const |
BlockSizeType Network::FileCache::blockSize | ( | block_idx_type | ) | const |
|
static |
|
protected |
|
pure virtual |
Implemented in Network::WriteCache, and Network::ReadCache.
|
protected |
BufType* Network::FileCache::getBlock | ( | block_idx_type | ) |
const BufType* Network::FileCache::getBlock | ( | block_idx_type | ) | const |
|
protected |
|
inlineprotectedvirtual |
Reimplemented in Network::WriteCache, and Network::ReadCache.
|
inline |
bool Network::FileCache::isLiveBlock | ( | block_idx_type | ) | const |
|
inlineprotected |
|
inlineprotected |
|
pure virtual |
Implemented in Network::WriteCache, and Network::ReadCache.
file_size_type Network::FileCache::size | ( | ) | const |
|
inline |
|
protected |
|
protected |
Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2024