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

1.1       parser      1: /** @file
                      2:        Parser: Stylesheet manager decl.
                      3: 
1.15    ! 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    ! paf        13: static const char* IDENT_STYLESHEET_MANAGER_H="$Date: 2002/08/01 11:41:16 $";
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.10      paf        25: class Stylesheet_connection_ptr;
1.1       parser     26: 
                     27: /** XSLT stylesheet driver manager
                     28:                maintains 
                     29:                stylesheet cache expiring unused stylesheets
                     30: */
1.7       paf        31: class Stylesheet_manager : public Cache_manager {
1.2       paf        32:        friend class Stylesheet_connection;
1.1       parser     33: public:
                     34: 
1.4       paf        35:        Stylesheet_manager(Pool& apool);
1.8       paf        36:        virtual ~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.10      paf        41:        Stylesheet_connection_ptr get_connection(const String& file_spec);
1.1       parser     42: 
                     43: private: // cache
                     44: 
                     45:        Stylesheet_connection *get_connection_from_cache(const String& file_spec);
                     46:        void put_connection_to_cache(const String& file_spec, Stylesheet_connection& connection);
                     47: private:
                     48:        time_t prev_expiration_pass_time;
                     49: 
                     50: private: // for stylesheet
                     51: 
                     52:        /// caches connection
                     53:        void close_connection(const String& file_spec, Stylesheet_connection& connection);
                     54: 
                     55: private:
                     56: 
                     57:        Hash connection_cache;
1.3       paf        58: 
1.6       paf        59: public: // Cache_manager
1.3       paf        60: 
                     61:        virtual Value& get_status(Pool& pool, const String *source);
1.6       paf        62:        virtual void maybe_expire_cache();
1.3       paf        63: 
1.1       parser     64: };
                     65: 
                     66: /// global
                     67: extern Stylesheet_manager *stylesheet_manager;
                     68: 
                     69: #endif

E-mail: