myArgs(const char *argv0) :
        CommandLineParameters(argv0) {

        addParser("-Wp,.*",
                  parseGenericCppOptions, (void *)this,
                  Parse_This, Value_String, true, true, NULL);
        addParser("-[DUI]..*",
                  parseSpecificCppOptions, (void *)this,
                  Parse_This, Value_String, true, true, NULL);

        addParser("-Wl,.*",
                  parseGenericLinkerOptions, (void *)this,
                  Parse_This, Value_String, true, true, NULL);
        addParser("-[Ll]..*",
                  parseSpecificLinkerOptions, (void *)this,
                  Parse_This, Value_String, true, true, NULL);

    }
Exemple #2
0
bool HmcModule::doLoad()
{

    if(!fileExists(_modelPath))
    {
        Log::error("HMC model file not found");
        return false;
    }

    std::ifstream modelFile(_modelPath);
    CSVReader modelReader(modelFile);

    for(unsigned int i = 0;modelReader.hasNextLine();++i)
    {
        std::vector<std::string> modelLine;
        modelReader.readNextLine(modelLine);

        if(modelLine.size()<2)
            break;

        std::string name = modelLine[0];
        name[0]= toupper(name[0]);
        std::string type  = modelLine[1];

        addParser(name);
        const ObjectTypeTemplate& typeTemplate = newTemplate(name);
        setSpecification(EbmlModule::EBMLElement(i), typeTemplate());

        for(int j =0;j<EbmlModule::numberOfTypeElements;++j)
        {
            if(type == EbmlModule::typeElementAtributes[j])
            {
                setExtension(typeTemplate, getTemplate(EbmlModule::typeElements[j])());
                break;
            }
        }
    }
    return true;
}
// ---------------------------------------------------------------------------
// loader methods
// ---------------------------------------------------------------------------
NIImporter_VISUM::NIImporter_VISUM(NBNetBuilder& nb,
                                   const std::string& file,
                                   NBCapacity2Lanes capacity2Lanes,
                                   bool useVisumPrio)
    : myNetBuilder(nb), myFileName(file),
      myCapacity2Lanes(capacity2Lanes), myUseVisumPrio(useVisumPrio) {
    // the order of process is important!
    // set1
    addParser("VSYS", &NIImporter_VISUM::parse_VSysTypes);
    addParser("STRECKENTYP", &NIImporter_VISUM::parse_Types);
    addParser("KNOTEN", &NIImporter_VISUM::parse_Nodes);
    addParser("BEZIRK", &NIImporter_VISUM::parse_Districts);
    addParser("PUNKT", &NIImporter_VISUM::parse_Point);

    // set2
    // two types of "strecke"
    addParser("STRECKE", &NIImporter_VISUM::parse_Edges);
    addParser("STRECKEN", &NIImporter_VISUM::parse_Edges);
    addParser("KANTE", &NIImporter_VISUM::parse_Kante);

    // set3
    addParser("ANBINDUNG", &NIImporter_VISUM::parse_Connectors);
    // two types of "abbieger"
    addParser("ABBIEGEBEZIEHUNG", &NIImporter_VISUM::parse_Turns);
    addParser("ABBIEGER", &NIImporter_VISUM::parse_Turns);

    addParser("STRECKENPOLY", &NIImporter_VISUM::parse_EdgePolys);
    addParser("FAHRSTREIFEN", &NIImporter_VISUM::parse_Lanes);
    addParser("FLAECHENELEMENT", &NIImporter_VISUM::parse_PartOfArea);

    // set4
    // two types of lsa
    addParser("LSA", &NIImporter_VISUM::parse_TrafficLights);
    addParser("SIGNALANLAGE", &NIImporter_VISUM::parse_TrafficLights);
    // two types of knotenzulsa
    addParser("KNOTENZULSA", &NIImporter_VISUM::parse_NodesToTrafficLights);
    addParser("LSAZUKNOTEN", &NIImporter_VISUM::parse_NodesToTrafficLights);
    addParser("SIGNALANLAGEZUKNOTEN", &NIImporter_VISUM::parse_NodesToTrafficLights);
    // two types of signalgruppe
    addParser("LSASIGNALGRUPPE", &NIImporter_VISUM::parse_SignalGroups);
    addParser("SIGNALGRUPPE", &NIImporter_VISUM::parse_SignalGroups);
    // three types of ABBZULSASIGNALGRUPPE
    addParser("ABBZULSASIGNALGRUPPE", &NIImporter_VISUM::parse_TurnsToSignalGroups);
    addParser("SIGNALGRUPPEZUABBIEGER", &NIImporter_VISUM::parse_TurnsToSignalGroups);
    addParser("SIGNALGRUPPEZUFSABBIEGER", &NIImporter_VISUM::parse_TurnsToSignalGroups);

    addParser("TEILFLAECHENELEMENT", &NIImporter_VISUM::parse_AreaSubPartElement);

    // two types of LSAPHASE
    addParser("LSAPHASE", &NIImporter_VISUM::parse_Phases);
    addParser("PHASE", &NIImporter_VISUM::parse_Phases);

    addParser("LSASIGNALGRUPPEZULSAPHASE", &NIImporter_VISUM::parse_SignalGroupsToPhases);
    addParser("FAHRSTREIFENABBIEGER", &NIImporter_VISUM::parse_LanesConnections);
}