13 #include "networkmod.h" 37 FileSizeType size()
const;
38 bool isEmpty()
const {
return size() < 1; }
39 virtual void clearData() = 0;
41 virtual void setMinCacheSize(FileSizeType) = 0;
45 FileCache(FileSizeType);
70 BlockIdxType blockIdx(FilePosType)
const;
71 static FilePosType blockStart(BlockIdxType);
72 BlockSizeType blockSize(BlockIdxType)
const;
74 {
return blocks_.validIdx(bidx); }
76 bool isLiveBlock(BlockIdxType)
const;
77 BufType* getBlock(BlockIdxType);
78 const BufType* getBlock(BlockIdxType)
const;
86 Block* gtBlk(BlockIdxType)
const;
87 void dismissBlock(BlockIdxType);
90 {
return blockStart(blocks_.
size()-1); }
92 {
return lastBlockPos() + lastblocksz_ - 1; }
116 virtual void clearData();
156 virtual void clearData();
#define mExpClass(module)
Definition: commondefs.h:157
TypeSet< BlockIdxType > liveblockidxs_
Definition: netfilecache.h:131
FilePosType lastFilePos() const
Definition: netfilecache.h:91
SizeType PosType
Definition: netfilecache.h:52
Definition: jobcommunic.h:22
BlockIdxType maxnrliveblocks_
Definition: netfilecache.h:132
ChunkSizeType SizeType
Definition: netfilecache.h:51
Definition: netfilecache.h:47
Definition: netfilecache.h:24
od_int64 od_stream_Pos
Definition: od_iosfwd.h:19
Definition: netfilecache.h:149
int size_type
Definition: objectset.h:37
static const SizeType cFullSize
Definition: netfilecache.h:53
bool validBlockIdx(BlockIdxType bidx) const
Definition: netfilecache.h:73
od_uint64 od_stream_Count
Definition: od_iosfwd.h:16
Interval of values.
Definition: commontypes.h:27
BufType * buf_
Definition: netfilecache.h:58
size_type size() const
Definition: objectset.h:48
Set of pointers to objects.
Definition: commontypes.h:28
Set of (small) copyable elements.
Definition: commontypes.h:26
unsigned char BufType
Definition: netfilecache.h:28
SizeType bufsz_
Definition: netfilecache.h:59
od_stream_Count FileSizeType
Definition: netfilecache.h:30
Definition: netfilecache.h:109
const BlockSizeType lastblocksz_
Definition: netfilecache.h:83
ObjectSet< Block >::size_type BlockIdxType
Definition: netfilecache.h:67
Block::SizeType BlockSizeType
Definition: netfilecache.h:68
bool isEmpty() const
Definition: netfilecache.h:38
virtual void handleNewLiveBlock(BlockIdxType)
Definition: netfilecache.h:94
int ChunkSizeType
Definition: netfilecache.h:29
const FileSizeType knownfilesize_
Definition: netfilecache.h:84
TypeSet< FileChunkType > FileChunkSetType
Definition: netfilecache.h:33
od_stream_Pos FilePosType
Definition: netfilecache.h:31
FilePosType lastBlockPos() const
Definition: netfilecache.h:89
BlockIdxType nrblocksmem_
Definition: netfilecache.h:162
Interval< FilePosType > FileChunkType
Definition: netfilecache.h:32
ObjectSet< Block > blocks_
Definition: netfilecache.h:82