1 #ifndef __UNIT_CONST_CACHE_H
2 #define __UNIT_CONST_CACHE_H
21 return fac == b.fac && key == b.key;
29 operator size_t()
const {
34 #if !defined (_WIN32) && __GNUC__ != 2
41 return vsHash< T > () ( key );
45 return vsHash< std::string > () ( key.key )^vsHash< size_t > () ( (
size_t) key.fac );
50 template <
class Typ,
class Key >
53 #if !defined (_WIN32) && __GNUC__ != 2
54 static vsUMap< Key, Typ*, ConstHasher >unit_cache;
56 static vsUMap< Key, Typ* >unit_cache;
65 #if !defined (_WIN32) && __GNUC__ != 2
66 typename vsUMap< Key, Typ*, ConstHasher >::iterator
i = unit_cache.find( k );
68 typename vsUMap< Key, Typ* >::iterator i = unit_cache.find( k );
70 if ( i != unit_cache.end() )
76 unit_cache.insert( std::pair< Key, Typ* > ( k, un ) );
85 typename vsUMap< Key, Typ*, ConstHasher >::iterator
i = unit_cache.begin();
86 for (; i != unit_cache.end(); ++i)
87 (*Kill)( (*i).second );
92 #if (defined (__GNUC__) && ( ( __GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ > 3 ) )
93 template <
class Typ,
class Key >