--- parser3/src/main/pa_cache_managers.C 2001/12/13 11:09:46 1.2 +++ parser3/src/main/pa_cache_managers.C 2004/02/11 15:33:15 1.13 @@ -1,32 +1,33 @@ /** @file Parser: status press center implementation. - Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexander Petrosyan (http://paf.design.ru) - - $Id: pa_cache_managers.C,v 1.2 2001/12/13 11:09:46 paf Exp $ + Copyright (c) 2001-2004 ArtLebedev Group (http://www.artlebedev.com) + Author: Alexandr Petrosian (http://paf.design.ru) */ +static const char * const IDENT_CACHE_MANAGERS_C="$Date: 2004/02/11 15:33:15 $"; + #include "pa_cache_managers.h" -// globals +#include "pa_sql_driver_manager.h" +#include "pa_stylesheet_manager.h" -Cache_managers *cache_managers; +// globals -// methods +Cache_managers* cache_managers=0; -static void destroy_one(const Hash::Key& akey, Hash::Val *avalue, - void *) { - static_cast(avalue)->~Cache_manager(); -} -Cache_managers::~Cache_managers() { - for_each(destroy_one); +Cache_managers::Cache_managers() { + put("sql", (SQL_driver_manager=new SQL_Driver_manager)); + put("stylesheet", (stylesheet_manager=new Stylesheet_manager)); } -static void maybe_expire_one(const Hash::Key& akey, Hash::Val *avalue, - void *) { - static_cast(avalue)->maybe_expire_cache(); + +// methods + +static void maybe_expire_one(Cache_managers::key_type /*akey*/, Cache_managers::value_type avalue, + int) { + avalue->maybe_expire_cache(); } void Cache_managers::maybe_expire() { - for_each(maybe_expire_one); + for_each(maybe_expire_one, 0); }