Beispiel #1
0
 Cache* CacheContainer::createCache(const Cache::CacheKey& key){
   Factory* f = Factory::instance();
   HyperGraph::HyperGraphElement* e = f->construct(key.type());
   if (!e) {
     cerr << __PRETTY_FUNCTION__ << endl;
     cerr << "fatal error in creating cache of type " << key.type() << endl;
     return nullptr;
   }
   Cache* c = dynamic_cast<Cache*>(e);
   if (! c){
     cerr << __PRETTY_FUNCTION__ << endl;
     cerr << "fatal error in creating cache of type " << key.type() << endl;
     return nullptr;
   }
   c->_container = this;
   c->_parameters = key._parameters;
   if (c->resolveDependancies()){
     insert(make_pair(key,c));
     c->update();
     return c;
   } 
   return nullptr;
 }