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