Annotation of parser3/src/include/pa_stylesheet_manager.h, revision 1.4
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.4 ! paf 7: $Id: pa_stylesheet_manager.h,v 1.3 2001/11/05 10:21:27 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.3 paf 20: #include "pa_status_provider.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.3 paf 32: class Stylesheet_manager : public Pooled, public Status_provider {
1.2 paf 33: friend class Stylesheet_connection;
1.1 parser 34: public:
35:
1.4 ! paf 36: Stylesheet_manager(Pool& apool);
1.1 parser 37: ~Stylesheet_manager();
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: void maybe_expire_connection_cache();
49: private:
50: time_t prev_expiration_pass_time;
51:
52: private: // for stylesheet
53:
54: /// caches connection
55: void close_connection(const String& file_spec, Stylesheet_connection& connection);
56:
57: private:
58:
59: Hash connection_cache;
1.3 paf 60:
61: public: // Status_provider
62:
63: virtual Value& get_status(Pool& pool, const String *source);
64:
1.1 parser 65: };
66:
67: /// global
68: extern Stylesheet_manager *stylesheet_manager;
69:
70: #endif
E-mail: