2 #ifndef __ST_HYPERCACHEFACTORY_H
3 #define __ST_HYPERCACHEFACTORY_H
8 #include "StHyperCacheI.h"
9 #include "StHyperSingleton.h"
12 typedef std::map< std::string, StHyperCacheInstantiator > StHyperCacheInstantiatorMap;
25 if (!m_InstantiatorMap) {
26 m_InstantiatorMap =
new StHyperCacheInstantiatorMap();
28 StHyperCacheInstantiatorMap::iterator iter = (*m_InstantiatorMap).find(
id);
29 if( iter != (*m_InstantiatorMap).end() ) {
30 return (iter->second)();
36 static bool registerStHyperCacheInstantiator(std::string
id, StHyperCacheInstantiator func) {
37 if (!m_InstantiatorMap) {
38 m_InstantiatorMap =
new StHyperCacheInstantiatorMap();
40 (*m_InstantiatorMap).insert( std::make_pair(
id, func ) );
45 static StHyperCacheInstantiatorMap* m_InstantiatorMap;
48 #endif // __ST_HYPERCACHEFACTORY_H