Annotation of parser3/src/include/pa_stylesheet_manager.h, revision 1.15.2.3

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.3! paf        13: static const char* IDENT_STYLESHEET_MANAGER_H="$Date: 2003/02/17 17:05:03 $";
1.1       parser     14: 
                     15: #include "pa_pool.h"
                     16: #include "pa_hash.h"
                     17: #include "pa_table.h"
1.6       paf        18: #include "pa_cache_managers.h"
1.1       parser     19: 
                     20: // defines
                     21: 
                     22: // forwards
                     23: 
                     24: class Stylesheet_connection;
1.15.2.3! paf        25: DECLARE_OBJECT_PTR(Stylesheet_connection);
1.1       parser     26: 
                     27: /** XSLT stylesheet driver manager
                     28:                maintains 
                     29:                stylesheet cache expiring unused stylesheets
                     30: */
1.15.2.2  paf        31: class Stylesheet_manager: public Cache_manager {
1.2       paf        32:        friend class Stylesheet_connection;
1.1       parser     33: public:
                     34: 
1.15.2.3! paf        35:        Stylesheet_manager();
        !            36:        override ~Stylesheet_manager();
1.1       parser     37:        /** 
                     38:                check for disk update of "{file_spec}" or "{file_spec}.stamp",
                     39:                if not updated return cached version[if any] otherwise load/compile/return
                     40:        */
1.15.2.3! paf        41:        Stylesheet_connectionPtr get_connection(StringPtr file_spec);
1.1       parser     42: 
                     43: private: // cache
                     44: 
1.15.2.3! paf        45:        Stylesheet_connectionPtr get_connection_from_cache(StringPtr file_spec);
        !            46:        void put_connection_to_cache(StringPtr file_spec, Stylesheet_connectionPtr connection);
1.1       parser     47: private:
                     48:        time_t prev_expiration_pass_time;
                     49: 
                     50: private: // for stylesheet
                     51: 
                     52:        /// caches connection
1.15.2.3! paf        53:        void close_connection(StringPtr file_spec, Stylesheet_connection& connection);
1.1       parser     54: 
                     55: private:
                     56: 
1.15.2.3! paf        57:        Hash<StringPtr, Stylesheet_connectionPtr> connection_cache;
1.3       paf        58: 
1.6       paf        59: public: // Cache_manager
1.3       paf        60: 
1.15.2.3! paf        61:        override ValuePtr get_status(Pool& pool, StringPtr source);
        !            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: