Annotation of parser3/src/include/pa_stylesheet_manager.h, revision 1.19
1.1 parser 1: /** @file
2: Parser: Stylesheet manager decl.
3:
1.16 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.19 ! paf 13: static const char * const IDENT_STYLESHEET_MANAGER_H="$Date: 2003/11/20 16:34:25 $";
1.16 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.16 paf 19: #include "pa_stack.h"
20: #include "pa_stylesheet_connection.h"
1.1 parser 21:
22: /** XSLT stylesheet driver manager
23: maintains
24: stylesheet cache expiring unused stylesheets
25: */
1.16 paf 26: class Stylesheet_manager: public Cache_manager {
1.2 paf 27: friend class Stylesheet_connection;
1.1 parser 28: public:
29:
1.16 paf 30: Stylesheet_manager();
31: override ~Stylesheet_manager();
1.1 parser 32: /**
33: check for disk update of "{file_spec}" or "{file_spec}.stamp",
34: if not updated return cached version[if any] otherwise load/compile/return
35: */
1.19 ! paf 36: Stylesheet_connection_ptr get_connection(String::Body file_spec);
1.1 parser 37:
38: private: // cache
39:
1.19 ! paf 40: Stylesheet_connection* get_connection_from_cache(String::Body file_spec);
! 41: void put_connection_to_cache(String::Body file_spec, Stylesheet_connection& connection);
1.1 parser 42: private:
43: time_t prev_expiration_pass_time;
44:
45: private: // for stylesheet
46:
47: /// caches connection
1.19 ! paf 48: void close_connection(String::Body file_spec, Stylesheet_connection& connection);
1.1 parser 49:
1.16 paf 50: public:
51: typedef Stack<Stylesheet_connection*> connection_cache_value_type;
1.17 paf 52: typedef Hash<const String::Body, connection_cache_value_type*> connection_cache_type;
1.1 parser 53: private:
1.16 paf 54: connection_cache_type connection_cache;
1.3 paf 55:
1.6 paf 56: public: // Cache_manager
1.3 paf 57:
1.16 paf 58: override Value* get_status();
59: override void maybe_expire_cache();
1.3 paf 60:
1.1 parser 61: };
62:
63: /// global
1.16 paf 64: extern Stylesheet_manager stylesheet_manager;
1.1 parser 65:
66: #endif
E-mail: