]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/RemovalPolicy.h
4 * SQUID Web Proxy Cache http://www.squid-cache.org/
5 * ----------------------------------------------------------
7 * Squid is the result of efforts by numerous individuals from
8 * the Internet community; see the CONTRIBUTORS file for full
9 * details. Many organizations have provided support for Squid's
10 * development; see the SPONSORS file for full details. Squid is
11 * Copyrighted (C) 2001 by the Regents of the University of
12 * California; see the COPYRIGHT file for full details. Squid
13 * incorporates software developed and/or copyrighted by other
14 * sources; see the CREDITS file for full details.
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
30 * Copyright (c) 2003, Robert Collins <robertc@squid-cache.org>
33 #ifndef SQUID_REMOVALPOLICY_H
34 #define SQUID_REMOVALPOLICY_H
38 class RemovalPolicyWalker
;
39 class RemovalPurgeWalker
;
41 class RemovalPolicySettings
45 RemovalPolicySettings() : type(NULL
), args(NULL
) {};
51 class RemovalPolicyNode
55 RemovalPolicyNode() : data(NULL
) {}
65 void (*Free
) (RemovalPolicy
* policy
);
66 void (*Add
) (RemovalPolicy
* policy
, StoreEntry
* entry
, RemovalPolicyNode
* node
);
67 void (*Remove
) (RemovalPolicy
* policy
, StoreEntry
* entry
, RemovalPolicyNode
* node
);
68 void (*Referenced
) (RemovalPolicy
* policy
, const StoreEntry
* entry
, RemovalPolicyNode
* node
);
69 void (*Dereferenced
) (RemovalPolicy
* policy
, const StoreEntry
* entry
, RemovalPolicyNode
* node
);
70 RemovalPolicyWalker
*(*WalkInit
) (RemovalPolicy
* policy
);
71 RemovalPurgeWalker
*(*PurgeInit
) (RemovalPolicy
* policy
, int max_scan
);
72 void (*Stats
) (RemovalPolicy
* policy
, StoreEntry
* entry
);
74 CBDATA_CLASS2(RemovalPolicy
);
77 class RemovalPolicyWalker
80 RemovalPolicy
*_policy
;
82 const StoreEntry
*(*Next
) (RemovalPolicyWalker
* walker
);
83 void (*Done
) (RemovalPolicyWalker
* walker
);
85 CBDATA_CLASS2(RemovalPolicyWalker
);
88 class RemovalPurgeWalker
91 RemovalPolicy
*_policy
;
93 int scanned
, max_scan
, locked
;
94 StoreEntry
*(*Next
) (RemovalPurgeWalker
* walker
);
95 void (*Done
) (RemovalPurgeWalker
* walker
);
97 CBDATA_CLASS2(RemovalPurgeWalker
);
100 extern RemovalPolicy
*createRemovalPolicy(RemovalPolicySettings
* settings
);
102 typedef RemovalPolicy
*REMOVALPOLICYCREATE(wordlist
* args
);
104 #endif /* SQUID_REMOVALPOLICY_H */