Annotation of parser3/src/include/pa_xslt_stylesheet_manager.h, revision 1.2
1.1 parser 1: /** @file
2: Parser: sql driver manager decl.
3:
4: Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
5: Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
6:
1.2 ! parser 7: $Id: pa_xslt_stylesheet_manager.h,v 1.1 2001/09/14 15:41:59 parser Exp $
1.1 parser 8:
9:
10: global sql driver manager, must be thread-safe
11: */
12:
13: #ifndef PA_XSLT_STYLESHEET_MANAGER_H
14: #define PA_XSLT_STYLESHEET_MANAGER_H
15:
16: #include "pa_config_includes.h"
17: #include "pa_pool.h"
18: #include "pa_hash.h"
19: #include "pa_stack.h"
20: #include "pa_table.h"
21:
22:
23: // defines
24:
25:
26: // forwards
27:
28: class Stylesheet_connection;
29:
30: /** XSLT stylesheet driver manager
31: maintains
32: stylesheet cache expiring unused stylesheets
33: */
34: class XSLT_Stylesheet_manager : public Pooled {
35: friend Stylesheet_connection;
36: public:
37:
38: XSLT_Stylesheet_manager(Pool& pool) : Pooled(pool),
39: connection_cache(pool),
40: prev_expiration_pass_time(0) {
41: }
42:
43: /**
44: check for disk update of "{file_spec}" or "{file_spec}.stamp",
45: if not updated return cached version[if any] otherwise load/compile/return
46: */
47: Stylesheet_connection& get_connection(const String& file_spec);
48:
49: private: // stylesheet cache
50:
51: Stylesheet_connection *get_connection_from_cache(const String& file_spec);
52: void put_connection_to_cache(const String& file_spec, Stylesheet_connection& stylesheet);
53: void maybe_expire_connection_cache();
54: private:
55: time_t prev_expiration_pass_time;
56:
57: private: // for stylesheet
58:
59: /// caches connection
60: void close_connection(const String& file_spec, Stylesheet_connection& stylesheet);
61:
62: private:
63:
64: Hash connection_cache;
65: };
66:
67: /// global
68: extern XSLT_Stylesheet_manager *XSLT_stylesheet_manager;
69:
70: #endif
E-mail: