]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/RemovalPolicy.h
2 * Copyright (C) 1996-2016 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
;
19 class RemovalPolicySettings
23 RemovalPolicySettings() : type(NULL
), args(NULL
) {};
29 class RemovalPolicyNode
33 RemovalPolicyNode() : data(NULL
) {}
40 CBDATA_CLASS(RemovalPolicy
);
45 void (*Free
) (RemovalPolicy
* policy
);
46 void (*Add
) (RemovalPolicy
* policy
, StoreEntry
* entry
, RemovalPolicyNode
* node
);
47 void (*Remove
) (RemovalPolicy
* policy
, StoreEntry
* entry
, RemovalPolicyNode
* node
);
48 void (*Referenced
) (RemovalPolicy
* policy
, const StoreEntry
* entry
, RemovalPolicyNode
* node
);
49 void (*Dereferenced
) (RemovalPolicy
* policy
, const StoreEntry
* entry
, RemovalPolicyNode
* node
);
50 RemovalPolicyWalker
*(*WalkInit
) (RemovalPolicy
* policy
);
51 RemovalPurgeWalker
*(*PurgeInit
) (RemovalPolicy
* policy
, int max_scan
);
52 void (*Stats
) (RemovalPolicy
* policy
, StoreEntry
* entry
);
55 class RemovalPolicyWalker
57 CBDATA_CLASS(RemovalPolicyWalker
);
60 RemovalPolicy
*_policy
;
62 const StoreEntry
*(*Next
) (RemovalPolicyWalker
* walker
);
63 void (*Done
) (RemovalPolicyWalker
* walker
);
66 class RemovalPurgeWalker
68 CBDATA_CLASS(RemovalPurgeWalker
);
71 RemovalPolicy
*_policy
;
73 int scanned
, max_scan
, locked
;
74 StoreEntry
*(*Next
) (RemovalPurgeWalker
* walker
);
75 void (*Done
) (RemovalPurgeWalker
* walker
);
78 RemovalPolicy
*createRemovalPolicy(RemovalPolicySettings
* settings
);
80 typedef RemovalPolicy
*REMOVALPOLICYCREATE(wordlist
* args
);
82 #endif /* SQUID_REMOVALPOLICY_H */