--- parser3/src/include/pa_hash.h 2010/08/11 16:17:27 1.83 +++ parser3/src/include/pa_hash.h 2013/08/21 12:11:14 1.85 @@ -1,7 +1,7 @@ /** @file Parser: hash class decl. - Copyright (c) 2001-2009 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ @@ -17,7 +17,7 @@ #ifndef PA_HASH_H #define PA_HASH_H -static const char * const IDENT_HASH_H="$Date: 2010/08/11 16:17:27 $"; +#define IDENT_PA_HASH_H "$Id: pa_hash.h,v 1.85 2013/08/21 12:11:14 moko Exp $" #include "pa_memory.h" #include "pa_types.h" @@ -623,20 +623,21 @@ template class HASH_STRING: #ifndef HASH_ORDER /// Auto-object used to temporarily substituting/removing string hash values -template +template class Temp_hash_value { - HashString &fhash; - K fname; + H *fhash; + String::Body fname; V saved_value; public: - Temp_hash_value(HashString& ahash, K aname, V avalue) : - fhash(ahash), - fname(aname), - saved_value(ahash.get(aname)) { - fhash.put(aname, avalue); + Temp_hash_value(H *ahash, String::Body aname, V avalue) : fhash(ahash), fname(aname) { + if(fhash){ + saved_value=fhash->get(aname); + fhash->put(aname, avalue); + } } - ~Temp_hash_value() { - fhash.put(fname, saved_value); + ~Temp_hash_value() { + if(fhash) + fhash->put(fname, saved_value); } }; #endif