static std::vector<Record*> recoverRecords(const char * path) { std::vector< std::vector<std::string> > inputRecords = InputParser::recoverField(path); if (inputRecords.size() == 0) throw new FileErrorException("Empty File", 0); std::vector<Record*> records; int dimensions = inputRecords[0].size(); srand(time(NULL)); for (unsigned i = 0; i < inputRecords.size(); i++) { std::vector<std::string> set = inputRecords[i]; ID* id = new ID(dimensions); id->addKey(LINEA, KeyFactory::getKey(LINEA, set[0])); //id->addKey(FRANJA, KeyFactory::getKey(FRANJA, set[0]); id->addKey(new FranjaHoraria(atoi(set[4].c_str()))); id->addKey(FALLA, KeyFactory::getKey(FALLA, set[1])); id->addKey(ACCIDENTE, KeyFactory::getKey(ACCIDENTE, set[2])); id->addKey(FORMACION, KeyFactory::getKey(FORMACION, set[3])); /* id->addKey(new Linea(set[0])); id->addKey(new FranjaHoraria(atoi(set[4].c_str()))); id->addKey(new Falla(set[1])); id->addKey(new Accidente(set[2])); id->addKey(new Formacion(atoi(set[3].c_str()))); */ records.push_back( new Record(id)); } return records; }