GenImpls: made Generators exchangeable

parent dbdf1ae9
......@@ -15,15 +15,22 @@ import java.util.List;
//TODO: make GeneratorCpp implement GeneratorImpl directly!
public class CPPGenImpl implements GeneratorImpl {
private String generationTargetPath;
private GeneratorCPP generatorCPP;
public CPPGenImpl(){
generatorCPP = new GeneratorCPP();
generatorCPP.useArmadilloBackend();
}
public void setGeneratorCPP(GeneratorCPP generatorCPP){
this.generatorCPP = generatorCPP;
}
@Override
public List<File> generate(ExpandedComponentInstanceSymbol componentInstanceSymbol, TaggingResolver taggingResolver) throws IOException {
List<File> files = new ArrayList<>();
GeneratorCPP generatorCPP = new GeneratorCPP();
generatorCPP.setGenerationTargetPath(generationTargetPath);
generatorCPP.useArmadilloBackend();
files.add(generatorCPP.generateFile(generateCMake(componentInstanceSymbol)));
files.addAll(generatorCPP.generateFiles(componentInstanceSymbol, taggingResolver));
......
......@@ -12,11 +12,19 @@ import java.util.List;
//TODO: make GeneratorRosCpp implement GeneratorImpl
public class RosCppGenImpl implements GeneratorImpl {
private String generationTargetPath;
private GeneratorRosCpp generatorRosCpp;
public RosCppGenImpl(){
generatorRosCpp = new GeneratorRosCpp();
generatorRosCpp.setGenerateCMake(true);
}
public void setGeneratorRosCpp(GeneratorRosCpp generatorRosCpp) {
this.generatorRosCpp = generatorRosCpp;
}
@Override
public List<File> generate(ExpandedComponentInstanceSymbol componentInstanceSymbol, TaggingResolver taggingResolver) throws IOException {
GeneratorRosCpp generatorRosCpp = new GeneratorRosCpp();
generatorRosCpp.setGenerateCMake(true);
generatorRosCpp.setGenerationTargetPath(generationTargetPath);
return generatorRosCpp.generateFiles(componentInstanceSymbol, taggingResolver);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment