CacheRemovalAlgorithm Struct Reference

DownloadCache support structure. Implements the cache removal algorithm. When the cache fills up, files with lower priority will be discarded first (see CacheEntry::Priority); for files of equal priority we compare the time stamps. More...

#include <camnet.h>

List of all members.

Public Member Functions

BOOL operator() (const CacheEntry &first, const CacheEntry &second) const


Detailed Description

DownloadCache support structure. Implements the cache removal algorithm. When the cache fills up, files with lower priority will be discarded first (see CacheEntry::Priority); for files of equal priority we compare the time stamps.

Author:
Adrian_Stoicar (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/06/97

Definition at line 450 of file camnet.h.


Member Function Documentation

BOOL CacheRemovalAlgorithm::operator() const CacheEntry first,
const CacheEntry second
const [inline]
 

Definition at line 452 of file camnet.h.

00453     {
00454         INT32 nFirstEntryPriority = first.GetPriority(), nSecondEntryPriority = second.GetPriority();
00455         if (nFirstEntryPriority > nSecondEntryPriority)
00456             return TRUE;
00457         else if (nFirstEntryPriority < nSecondEntryPriority)
00458             return FALSE;
00459         else // entries are of the same priority, use time stamps
00460             return first.m_FileStat.st_ctime >= second.m_FileStat.st_ctime ? TRUE : FALSE;
00461     }


The documentation for this struct was generated from the following file:
Generated on Sat Nov 10 03:51:43 2007 for Camelot by  doxygen 1.4.4