]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/RemovalPolicy.h
2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 #ifndef SQUID_REMOVALPOLICY_H
10 #define SQUID_REMOVALPOLICY_H
14 class RemovalPolicyWalker
;
15 class RemovalPurgeWalker
;
17 class RemovalPolicySettings
21 RemovalPolicySettings() : type(NULL
), args(NULL
) {};
27 class RemovalPolicyNode
31 RemovalPolicyNode() : data(NULL
) {}
38 CBDATA_CLASS(RemovalPolicy
);
43 void (*Free
) (RemovalPolicy
* policy
);
44 void (*Add
) (RemovalPolicy
* policy
, StoreEntry
* entry
, RemovalPolicyNode
* node
);
45 void (*Remove
) (RemovalPolicy
* policy
, StoreEntry
* entry
, RemovalPolicyNode
* node
);
46 void (*Referenced
) (RemovalPolicy
* policy
, const StoreEntry
* entry
, RemovalPolicyNode
* node
);
47 void (*Dereferenced
) (RemovalPolicy
* policy
, const StoreEntry
* entry
, RemovalPolicyNode
* node
);
48 RemovalPolicyWalker
*(*WalkInit
) (RemovalPolicy
* policy
);
49 RemovalPurgeWalker
*(*PurgeInit
) (RemovalPolicy
* policy
, int max_scan
);
50 void (*Stats
) (RemovalPolicy
* policy
, StoreEntry
* entry
);
53 class RemovalPolicyWalker
55 CBDATA_CLASS(RemovalPolicyWalker
);
58 RemovalPolicy
*_policy
;
60 const StoreEntry
*(*Next
) (RemovalPolicyWalker
* walker
);
61 void (*Done
) (RemovalPolicyWalker
* walker
);
64 class RemovalPurgeWalker
66 CBDATA_CLASS(RemovalPurgeWalker
);
69 RemovalPolicy
*_policy
;
71 int scanned
, max_scan
, locked
;
72 StoreEntry
*(*Next
) (RemovalPurgeWalker
* walker
);
73 void (*Done
) (RemovalPurgeWalker
* walker
);
76 RemovalPolicy
*createRemovalPolicy(RemovalPolicySettings
* settings
);
78 typedef RemovalPolicy
*REMOVALPOLICYCREATE(wordlist
* args
);
80 #endif /* SQUID_REMOVALPOLICY_H */