| OpendTect 8.0

Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Network::FileCache Class Referenceabstract
Network

`#include <netfilecache.h>`

Inheritance diagram for Network::FileCache:
[legend]

## 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_

## Detailed Description

< 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.

## Member Typedef Documentation

## ◆ block_idx_type

typedef ObjectSet<Block>::size_type Network::FileCache::block_idx_type

## ◆ BlockSizeType

typedef Block::SizeType Network::FileCache::BlockSizeType

## ◆ BufType

typedef unsigned char Network::FileCache::BufType

## ◆ ChunkSizeType

typedef int Network::FileCache::ChunkSizeType

## ◆ file_size_type

typedef od_stream_Count Network::FileCache::file_size_type

## ◆ FileChunkSetType

typedef TypeSet<FileChunkType> Network::FileCache::FileChunkSetType

## ◆ FileChunkType

typedef Interval<FilePosType> Network::FileCache::FileChunkType

## ◆ FilePosType

typedef od_stream_Pos Network::FileCache::FilePosType

## Constructor & Destructor Documentation

## ◆ ~FileCache()

virtual Network::FileCache::~FileCache | ( |  | ) |
| virtual

## ◆ FileCache()

Network::FileCache::FileCache | ( | file_size_type |  | ) |
| protected

## Member Function Documentation

## ◆ blockIdx()

block_idx_type Network::FileCache::blockIdx | ( | FilePosType |  | ) | const

## ◆ blockSize()

BlockSizeType Network::FileCache::blockSize | ( | block_idx_type |  | ) | const

## ◆ blockStart()

static FilePosType Network::FileCache::blockStart | ( | block_idx_type |  | ) |
| static

## ◆ clearBlocks()

void Network::FileCache::clearBlocks | ( |  | ) |
| protected

## ◆ clearData()

virtual void Network::FileCache::clearData | ( |  | ) |
| pure virtual

Implemented in Network::ReadCache, and Network::WriteCache.

## ◆ dismissBlock()

void Network::FileCache::dismissBlock | ( | block_idx_type |  | ) |
| protected

## ◆ getBlock() [1/2]

BufType * Network::FileCache::getBlock | ( | block_idx_type |  | ) |

## ◆ getBlock() [2/2]

const BufType * Network::FileCache::getBlock | ( | block_idx_type |  | ) | const

## ◆ gtBlk()

Block * Network::FileCache::gtBlk | ( | block_idx_type |  | ) | const
| protected

## ◆ handleNewLiveBlock()

virtual void Network::FileCache::handleNewLiveBlock | ( | block_idx_type |  | ) |
| inline protected virtual

Reimplemented in Network::ReadCache, and Network::WriteCache.

## ◆ isEmpty()

bool Network::FileCache::isEmpty | ( |  | ) | const
| inline

## ◆ isLiveBlock()

bool Network::FileCache::isLiveBlock | ( | block_idx_type |  | ) | const

## ◆ lastBlockPos()

FilePosType Network::FileCache::lastBlockPos | ( |  | ) | const
| inline protected

## ◆ lastFilePos()

FilePosType Network::FileCache::lastFilePos | ( |  | ) | const
| inline protected

## ◆ setMinCacheSize()

virtual void Network::FileCache::setMinCacheSize | ( | file_size_type |  | ) |
| pure virtual

Implemented in Network::ReadCache, and Network::WriteCache.

## ◆ size()

file_size_type Network::FileCache::size | ( |  | ) | const

## ◆ validBlockIdx()

bool Network::FileCache::validBlockIdx | ( | block_idx_type | bidx | ) | const
| inline

## Member Data Documentation

## ◆ blocks_

ObjectSet<Block> Network::FileCache::blocks_
| protected

## ◆ knownfilesize_

const file_size_type Network::FileCache::knownfilesize_
| protected

## ◆ lastblocksz_

const BlockSizeType Network::FileCache::lastblocksz_
| protected

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