Annotation of parser3/src/include/pa_stylesheet_manager.h, revision 1.9
1.1 parser 1: /** @file
2: Parser: Stylesheet manager decl.
3:
4: Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
1.5 paf 5: Author: Alexander Petrosyan <paf@design.ru> (http://paf.design.ru)
1.1 parser 6:
1.9 ! paf 7: $Id: pa_stylesheet_manager.h,v 1.8 2001/12/13 11:09:46 paf 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_pool.h"
17: #include "pa_hash.h"
18: #include "pa_table.h"
1.6 paf 19: #include "pa_cache_managers.h"
1.1 parser 20:
21: // defines
22:
23: // forwards
24:
25: class Stylesheet_connection;
26:
27: /** XSLT stylesheet driver manager
28: maintains
29: stylesheet cache expiring unused stylesheets
30: */
1.7 paf 31: class Stylesheet_manager : public Cache_manager {
1.2 paf 32: friend class Stylesheet_connection;
1.1 parser 33: public:
34:
1.4 paf 35: Stylesheet_manager(Pool& apool);
1.8 paf 36: virtual ~Stylesheet_manager();
1.1 parser 37: /**
38: check for disk update of "{file_spec}" or "{file_spec}.stamp",
39: if not updated return cached version[if any] otherwise load/compile/return
40: */
41: Stylesheet_connection& get_connection(const String& file_spec);
42:
43: private: // cache
44:
45: Stylesheet_connection *get_connection_from_cache(const String& file_spec);
46: void put_connection_to_cache(const String& file_spec, Stylesheet_connection& connection);
47: private:
48: time_t prev_expiration_pass_time;
49:
50: private: // for stylesheet
51:
52: /// caches connection
53: void close_connection(const String& file_spec, Stylesheet_connection& connection);
54:
55: private:
56:
57: Hash connection_cache;
1.3 paf 58:
1.6 paf 59: public: // Cache_manager
1.3 paf 60:
61: virtual Value& get_status(Pool& pool, const String *source);
1.6 paf 62: virtual void maybe_expire_cache();
1.3 paf 63:
1.1 parser 64: };
65:
66: /// global
67: extern Stylesheet_manager *stylesheet_manager;
68:
69: #endif
E-mail: