File: pa_cache_managers.C

package info (click to toggle)
parser 3.4.5-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 7,552 kB
  • sloc: cpp: 32,375; sh: 11,487; ansic: 10,849; yacc: 1,361; makefile: 248; awk: 5
file content (44 lines) | stat: -rw-r--r-- 1,124 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/** @file
	Parser: status press center implementation.

	Copyright (c) 2001-2017 Art. Lebedev Studio (http://www.artlebedev.com)
	Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
*/

#include "pa_cache_managers.h"

volatile const char * IDENT_PA_CACHE_MANAGERS_C="$Id: pa_cache_managers.C,v 1.20 2017/02/07 22:00:41 moko Exp $" IDENT_PA_CACHE_MANAGERS_H;

#include "pa_sql_driver_manager.h"
#ifdef XML
#include "pa_stylesheet_manager.h"
#endif

// globals

Cache_managers* cache_managers=0;

Cache_managers::Cache_managers() {
	put("sql", (SQL_driver_manager=new SQL_Driver_manager));
#ifdef XML
	put("stylesheet", (stylesheet_manager=new Stylesheet_manager));
#endif
}

static void delete_one(Cache_managers::key_type /*akey*/, Cache_managers::value_type avalue, 
						int) {
	delete avalue;
}
Cache_managers::~Cache_managers() {
	for_each<int>(delete_one, 0);
}

// methods

static void maybe_expire_one(Cache_managers::key_type /*akey*/, Cache_managers::value_type avalue, 
										  int) {
	avalue->maybe_expire_cache();
}
void Cache_managers::maybe_expire() {
	for_each<int>(maybe_expire_one, 0);
}