Coda Distributed File System
Public Member Functions | List of all members
CacheChunkList Class Reference

#include <fso_cachefile.h>

Inheritance diagram for CacheChunkList:
Inheritance graph
[legend]
Collaboration diagram for CacheChunkList:
Collaboration graph
[legend]

Public Member Functions

 CacheChunkList ()
 
 ~CacheChunkList ()
 
void AddChunk (uint64_t start, int64_t len)
 
bool ReverseCheck (uint64_t start, int64_t len)
 
void ReverseRemove (uint64_t start, int64_t len)
 
void ForEach (void(*foreachcb)(uint64_t start, int64_t len, void *usr_data_cb), void *usr_data=NULL)
 
void ReadLock ()
 
void ReadUnlock ()
 
void WriteLock ()
 
void WriteUnlock ()
 
CacheChunk pop ()
 
uint Length ()
 

Constructor & Destructor Documentation

◆ CacheChunkList()

CacheChunkList::CacheChunkList ( )

Constructor

◆ ~CacheChunkList()

CacheChunkList::~CacheChunkList ( )

Destructor

Member Function Documentation

◆ AddChunk()

void CacheChunkList::AddChunk ( uint64_t  start,
int64_t  len 
)

Add a chunk to the list

Parameters
startchunk's start
lenchunk's length

◆ ForEach()

void CacheChunkList::ForEach ( void(*)(uint64_t start, int64_t len, void *usr_data_cb)  foreachcb,
void *  usr_data = NULL 
)

For each function

Parameters
foreachcbfor each callback
usr_datauser closure to be passed to the callback

◆ Length()

uint CacheChunkList::Length ( )
inline

Get the number of list elements

Returns
number of list elements

◆ pop()

CacheChunk CacheChunkList::pop ( )

Pop the last element of the list

Returns
the last added element

◆ ReadLock()

void CacheChunkList::ReadLock ( )

Acquire the lock object's for reading

◆ ReadUnlock()

void CacheChunkList::ReadUnlock ( )

Release the lock object's (acquired for reading)

◆ ReverseCheck()

bool CacheChunkList::ReverseCheck ( uint64_t  start,
int64_t  len 
)

Check if a chunk is in the list given its start and length

Parameters
startchunk's start
lenchunk's length
Returns
true if the chunk is contained in the list and false otherwise

◆ ReverseRemove()

void CacheChunkList::ReverseRemove ( uint64_t  start,
int64_t  len 
)

Remove the corresponding element (searched from last to first)

Parameters
startchunk's start
lenchunk's length

◆ WriteLock()

void CacheChunkList::WriteLock ( )

Acquire the lock object's for writing

◆ WriteUnlock()

void CacheChunkList::WriteUnlock ( )

Release the lock object's (acquired for writing)


The documentation for this class was generated from the following files: