--- parser3/src/main/pa_stylesheet_manager.C 2001/11/05 10:42:59 1.3 +++ parser3/src/main/pa_stylesheet_manager.C 2001/11/12 10:00:32 1.7 @@ -2,9 +2,9 @@ Parser: sql driver manager implementation. Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexander Petrosyan (http://design.ru/paf) + Author: Alexander Petrosyan (http://paf.design.ru) - $Id: pa_stylesheet_manager.C,v 1.3 2001/11/05 10:42:59 paf Exp $ + $Id: pa_stylesheet_manager.C,v 1.7 2001/11/12 10:00:32 paf Exp $ */ #include "pa_config_includes.h" #ifdef XML @@ -45,12 +45,10 @@ static void expire_connections(const Has // Stylesheet_manager -Stylesheet_manager::Stylesheet_manager(Pool& apool) : Pooled(apool), +Stylesheet_manager::Stylesheet_manager(Pool& apool) : Cache_manager(apool), connection_cache(apool), prev_expiration_pass_time(0) { - - status_providers->put(*NEW String(pool(), "stylesheet"), this); -} + } Stylesheet_manager::~Stylesheet_manager() { connection_cache.for_each(expire_connections, reinterpret_cast((time_t)0/*=in past=expire all*/)); @@ -92,8 +90,6 @@ void Stylesheet_manager::close_connectio Stylesheet_connection *Stylesheet_manager::get_connection_from_cache(const String& file_spec) { SYNCHRONIZED; - maybe_expire_connection_cache(); - if(Stack *connections=static_cast(connection_cache.get(file_spec))) while(connections->top_index()>=0) { // there are cached stylesheets to that 'file_spec' Stylesheet_connection *result=static_cast(connections->pop()); @@ -116,7 +112,7 @@ void Stylesheet_manager::put_connection_ connections->push(&connection); } -void Stylesheet_manager::maybe_expire_connection_cache() { +void Stylesheet_manager::maybe_expire_cache() { time_t now=time(0); if(prev_expiration_pass_time=0; ) add_connection_to_status_cache_table(iter.next(), info); } - Value& Stylesheet_manager::get_status(Pool& pool, const String *source) { VHash& result=*new(pool) VHash(pool); // cache { - Array& columns=*new(pool) Array(pool, 3); + Array& columns=*new(pool) Array(pool); columns+=new(pool) String(pool, "file"); columns+=new(pool) String(pool, "time"); Table& table=*new(pool) Table(pool, 0, &columns, connection_cache.size());