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