void ModelBuilder :: BuildGenerator( Model * model, const ALib::XMLElement * e ) { Generator * g = TagDictionary::Instance()->CreateGen( e ); if ( (! ALib::IsEmpty( g->Name() )) && model->FindGen( g->Name() )) { throw XMLError( "duplicate name " + ALib::SQuote( g->Name() ), e ); } model->AddGen( g ); }
Generator * Model :: FindGen( const std::string & name ) const { for ( unsigned int i = 0; i < EntryCount() ; i++ ) { Generator * gp = GenAt( i ); if ( gp && gp->Name() == name ) { return gp; } } return 0; }