Annotation of parser3/src/include/pa_xslt_stylesheet_manager.h, revision 1.1
1.1 ! parser 1: /** @file
! 2: Parser: sql driver manager decl.
! 3:
! 4: Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
! 5:
! 6: Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
! 7:
! 8: $Id: pa_sql_driver_manager.h,v 1.8 2001/09/05 09:02:52 parser Exp $
! 9:
! 10:
! 11: global sql driver manager, must be thread-safe
! 12: */
! 13:
! 14: #ifndef PA_XSLT_STYLESHEET_MANAGER_H
! 15: #define PA_XSLT_STYLESHEET_MANAGER_H
! 16:
! 17: #include "pa_config_includes.h"
! 18: #include "pa_pool.h"
! 19: #include "pa_hash.h"
! 20: #include "pa_stack.h"
! 21: #include "pa_table.h"
! 22:
! 23:
! 24: // defines
! 25:
! 26:
! 27: // forwards
! 28:
! 29: class Stylesheet_connection;
! 30:
! 31: /** XSLT stylesheet driver manager
! 32: maintains
! 33: stylesheet cache expiring unused stylesheets
! 34: */
! 35: class XSLT_Stylesheet_manager : public Pooled {
! 36: friend Stylesheet_connection;
! 37: public:
! 38:
! 39: XSLT_Stylesheet_manager(Pool& pool) : Pooled(pool),
! 40: connection_cache(pool),
! 41: prev_expiration_pass_time(0) {
! 42: }
! 43:
! 44: /**
! 45: check for disk update of "{file_spec}" or "{file_spec}.stamp",
! 46: if not updated return cached version[if any] otherwise load/compile/return
! 47: */
! 48: Stylesheet_connection& get_connection(const String& file_spec);
! 49:
! 50: private: // stylesheet cache
! 51:
! 52: Stylesheet_connection *get_connection_from_cache(const String& file_spec);
! 53: void put_connection_to_cache(const String& file_spec, Stylesheet_connection& stylesheet);
! 54: void maybe_expire_connection_cache();
! 55: private:
! 56: time_t prev_expiration_pass_time;
! 57:
! 58: private: // for stylesheet
! 59:
! 60: /// caches connection
! 61: void close_connection(const String& file_spec, Stylesheet_connection& stylesheet);
! 62:
! 63: private:
! 64:
! 65: Hash connection_cache;
! 66: };
! 67:
! 68: /// global
! 69: extern XSLT_Stylesheet_manager *XSLT_stylesheet_manager;
! 70:
! 71: #endif
E-mail: