class ObjectFactory
!!!165296.cpp!!!	~ObjectFactory()
    for(ClassEntryList::iterator it = classEntries.begin(), itEnd = classEntries.end();
        it != itEnd; ++it)
    {
        delete *it;
    }
!!!165424.cpp!!!	getEntry(in classname : std::string) : ClassEntry
    ClassEntry*& p = registry[classname];
    if (p == NULL)
    {
        p = new ClassEntry;
        p->className = classname;
        classEntries.push_back(p);
    }
    return p;
!!!165552.cpp!!!	hasCreator(in classname : std::string) : bool
    ClassEntryMap::iterator it = registry.find(classname);
    if (it == registry.end())
        return false;
    ClassEntry* entry = it->second;
    return (!entry->creatorMap.empty());
!!!165680.cpp!!!	getAllEntries(inout result : std::vector<ClassEntry*>) : void
      result.clear();
      for (ClassEntryMap::iterator it = registry.begin(), itend = registry.end(); it != itend; ++it)
        {
          ClassEntry* entry = it->second;
          if (entry->className != it->first) continue;
          result.push_back(entry);
        }
!!!165808.cpp!!!	addAlias(in name : std::string, in result : std::string, in force : bool = false, inout previous : ClassEntry = NULL) : bool
      ClassEntry*& p = registry[name];
      if (previous)
        *previous = p;
      ClassEntryMap::iterator it = registry.find(result);
      if (it == registry.end())
        {
          std::cerr << "ERROR: ObjectFactory: cannot create alias "<<name<<" to unknown class " << result << ".\n";
          return false;
        }
      ClassEntry* entry = it->second;
      if (p!=NULL && !force)
        {
          std::cerr << "ERROR: ObjectFactory: cannot create alias "<<name<<" as a class with this name already exists.\n";
          return false;
        }
      else
        {
          if (p!=NULL)
            {
              p->aliases.erase(name);
            }
          p = entry;
          entry->aliases.insert(name);
          return true;
        }
!!!165936.cpp!!!	resetAlias(in name : std::string, inout previous : ClassEntry) : void
      ClassEntry*& p = registry[name];
      p = previous;
!!!166064.cpp!!!	createObject(inout context : BaseContext, inout arg : BaseObjectDescription) : BaseObject
      objectmodel::BaseObject* object = NULL;
      std::vector< std::pair<std::string, Creator*> > creators;
      std::string classname = arg->getAttribute( "type", "");
      std::string templatename = arg->getAttribute( "template", "");
      ClassEntryMap::iterator it = registry.find(classname);
      if (it == registry.end())
        {
          //std::cout << "ObjectFactory: class "<<classname<<" NOT FOUND."<<std::endl;
        }
      else
        {
//        std::cout << "ObjectFactory: class "<<classname<<" FOUND."<<std::endl;
          ClassEntry* entry = it->second;
          if(templatename.empty()) templatename = entry->defaultTemplate;
          CreatorMap::iterator it2 = entry->creatorMap.find(templatename);
          if (it2 != entry->creatorMap.end())
            {
//            std::cout << "ObjectFactory: template "<<templatename<<" FOUND."<<std::endl;
              Creator* c = it2->second;
              if (c->canCreate(context, arg))
                creators.push_back(*it2);
            }
          else
            {
//            std::cout << "ObjectFactory: template "<<templatename<<" NOT FOUND."<<std::endl;
              CreatorList::iterator it3;
              for (it3 = entry->creatorList.begin(); it3 != entry->creatorList.end(); ++it3)
                {
                  Creator* c = it3->second;
                  if (c->canCreate(context, arg))
                    creators.push_back(*it3);
                }
            }
        }
      if (creators.empty())
        {
//        std::cerr<<"ERROR: ObjectFactory: Object type "<<classname<<"<"<<templatename<<"> creation failed."<<std::endl;
          arg->logWarning("Object type " + classname + std::string("<") + templatename + std::string("> creation failed"));
        }
      else
        {
//          std::cout << "Create Instance : " << arg->getFullName() << "\n";
          object = creators[0].second->createInstance(context, arg);
          if (creators.size()>1)
            {
//                 std::cerr<<"WARNING: ObjectFactory: Several possibilities found for type "<<classname<<"<"<<templatename<<">:\n"; //<<std::endl;
                std::string w= "Template Unknown: <"+templatename+std::string("> : default used: <")+object->getTemplateName()+std::string("> in the list: ");
                for(unsigned int i=0;i<creators.size();++i)
                {
                    w += std::string("\n\t* ") + creators[i].first; //creatorsobjectmodel::Base::decodeTemplateName(creators[i]->type());
                }
                object->serr<<w<<object->sendl;
            }
        }
      return object;
!!!166192.cpp!!!	getInstance() : ObjectFactory
      static ObjectFactory instance;
      return &instance;
!!!166832.cpp!!!	dump(inout out : std::ostream = std::cout) : void
      for (ClassEntryMap::iterator it = registry.begin(), itend = registry.end(); it != itend; ++it)
        {
          ClassEntry* entry = it->second;
          if (entry->className != it->first) continue;
          out << "class " << entry->className <<" :\n";
          if (!entry->aliases.empty())
            {
              out << "  aliases :";
              for (std::set<std::string>::iterator it = entry->aliases.begin(), itend = entry->aliases.end(); it != itend; ++it)
                out << " " << *it;
              out << "\n";
            }
          if (!entry->baseClasses.empty())
            {
              out << "  base classes :";
              for (std::set<std::string>::iterator it = entry->baseClasses.begin(), itend = entry->baseClasses.end(); it != itend; ++it)
                out << " " << *it;
              out << "\n";
            }
          if (!entry->description.empty())
            out << entry->description;
          if (!entry->authors.empty())
            out << "  authors : " << entry->authors << "\n";
          if (!entry->license.empty())
            out << "  license : " << entry->license << "\n";
          for (CreatorList::iterator itc = entry->creatorList.begin(), itcend = entry->creatorList.end(); itc != itcend; ++itc)
            {
              out << "  template instance : " << itc->first << "\n";
            }
        }
!!!166960.cpp!!!	dumpXML(inout out : std::ostream = std::cout) : void
      for (ClassEntryMap::iterator it = registry.begin(), itend = registry.end(); it != itend; ++it)
        {
          ClassEntry* entry = it->second;
          if (entry->className != it->first) continue;
          out << "<class name=\"" << xmlencode(entry->className) <<"\">\n";
          for (std::set<std::string>::iterator it = entry->aliases.begin(), itend = entry->aliases.end(); it != itend; ++it)
            out << "<alias>" << xmlencode(*it) << "</alias>\n";
          for (std::set<std::string>::iterator it = entry->baseClasses.begin(), itend = entry->baseClasses.end(); it != itend; ++it)
            out << "<base>" << *it << "</base>\n";
          if (!entry->description.empty())
            out << "<description>"<<entry->description<<"</description>\n";
          if (!entry->authors.empty())
            out << "<authors>"<<entry->authors<<"</authors>\n";
          if (!entry->license.empty())
            out << "<license>"<<entry->license<<"</license>\n";
          for (CreatorList::iterator itc = entry->creatorList.begin(), itcend = entry->creatorList.end(); itc != itcend; ++itc)
            {
              out << "<creator";
              if (!itc->first.empty()) out << " template=\"" << xmlencode(itc->first) << "\"";
              out << "/>\n";
            }
          out << "</class>\n";
        }
!!!167088.cpp!!!	dumpHTML(inout out : std::ostream = std::cout) : void
      out << "<ul>\n";
      for (ClassEntryMap::iterator it = registry.begin(), itend = registry.end(); it != itend; ++it)
        {
          ClassEntry* entry = it->second;
          if (entry->className != it->first) continue;
          out << "<li><b>" << xmlencode(entry->className) <<"</b>\n";
          if (!entry->description.empty())
            out << "<br/>"<<entry->description<<"\n";
          out << "<ul>\n";
          if (!entry->aliases.empty())
            {
              out << "<li>Aliases:<i>";
              for (std::set<std::string>::iterator it = entry->aliases.begin(), itend = entry->aliases.end(); it != itend; ++it)
                out << " " << xmlencode(*it);
              out << "</i></li>\n";
            }
          if (!entry->baseClasses.empty())
            {
              out << "<li>Base Classes:<b>";
              for (std::set<std::string>::iterator it = entry->baseClasses.begin(), itend = entry->baseClasses.end(); it != itend; ++it)
                out << " " << xmlencode(*it);
              out << "</b></li>\n";
            }
          if (!entry->authors.empty())
            out << "<li>Authors: <i>"<<entry->authors<<"</i></li>\n";
          if (!entry->license.empty())
            out << "<li>License: <i>"<<entry->license<<"</i></li>\n";
          if (entry->creatorList.size()>2 || (entry->creatorList.size()==1 && !entry->creatorList.begin()->first.empty()))
            {
              out << "<li>Template instances:<i>";
              for (CreatorList::iterator itc = entry->creatorList.begin(), itcend = entry->creatorList.end(); itc != itcend; ++itc)
                {
                  if (itc->first == entry->defaultTemplate)
                    out << " <b>" << xmlencode(itc->first) << "</b>";
                  else
                    out << " " << xmlencode(itc->first);
                }
              out << "</i></li>\n";
            }
          out << "</ul>\n";
          out << "</li>\n";
        }
      out << "</ul>\n";
