Annotation of parser3/src/include/pa_stylesheet_manager.h, revision 1.15.2.5.2.2
1.1 parser 1: /** @file
2: Parser: Stylesheet manager decl.
3:
1.15.2.1 paf 4: Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com)
1.12 paf 5: Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
1.1 parser 6:
7: global sql driver manager, must be thread-safe
8: */
9:
10: #ifndef PA_STYLESHEET_MANAGER_H
11: #define PA_STYLESHEET_MANAGER_H
1.13 paf 12:
1.15.2.5.2.2! paf 13: static const char* IDENT_STYLESHEET_MANAGER_H="$Date: 2003/03/18 15:14:17 $";
1.15.2.5.2.1 paf 14:
1.1 parser 15:
16: #include "pa_hash.h"
17: #include "pa_table.h"
1.6 paf 18: #include "pa_cache_managers.h"
1.15.2.4 paf 19: #include "pa_stack.h"
1.1 parser 20:
21: // forwards
22:
23: class Stylesheet_connection;
1.15.2.3 paf 24: DECLARE_OBJECT_PTR(Stylesheet_connection);
1.1 parser 25:
26: /** XSLT stylesheet driver manager
27: maintains
28: stylesheet cache expiring unused stylesheets
29: */
1.15.2.2 paf 30: class Stylesheet_manager: public Cache_manager {
1.2 paf 31: friend class Stylesheet_connection;
1.1 parser 32: public:
33:
1.15.2.3 paf 34: Stylesheet_manager();
35: override ~Stylesheet_manager();
1.1 parser 36: /**
37: check for disk update of "{file_spec}" or "{file_spec}.stamp",
38: if not updated return cached version[if any] otherwise load/compile/return
39: */
1.15.2.5.2.1 paf 40: Stylesheet_connectionPtr get_connection(const String& file_spec);
1.1 parser 41:
42: private: // cache
43:
1.15.2.5.2.1 paf 44: Stylesheet_connectionPtr get_connection_from_cache(const String& file_spec);
45: void put_connection_to_cache(const String& file_spec, Stylesheet_connectionPtr connection);
1.1 parser 46: private:
47: time_t prev_expiration_pass_time;
48:
49: private: // for stylesheet
50:
51: /// caches connection
1.15.2.5.2.1 paf 52: void close_connection(const String& file_spec, Stylesheet_connection& connection);
1.1 parser 53:
1.15.2.5 paf 54: public:
1.15.2.5.2.1 paf 55: typedef Hash<String* , object_ptr<Stack<Stylesheet_connectionPtr> > > connection_cache_type;
1.15.2.5 paf 56: private:
1.15.2.4 paf 57: connection_cache_type connection_cache;
1.3 paf 58:
1.6 paf 59: public: // Cache_manager
1.3 paf 60:
1.15.2.5.2.2! paf 61: override Value* get_status(const String* source);
1.15.2.3 paf 62: override void maybe_expire_cache();
1.3 paf 63:
1.1 parser 64: };
65:
66: /// global
1.15.2.3 paf 67: extern Stylesheet_manager stylesheet_manager;
1.1 parser 68:
69: #endif
E-mail: