io.joynr.generator.cpp.defaultProvider.DefaultInterfaceProviderGenerator Maven / Gradle / Ivy
package io.joynr.generator.cpp.defaultProvider;
import com.google.inject.Inject;
import io.joynr.generator.cpp.defaultProvider.DefaultInterfaceProviderCppTemplate;
import io.joynr.generator.cpp.defaultProvider.DefaultInterfaceProviderHTemplate;
import io.joynr.generator.cpp.util.JoynrCppGeneratorExtensions;
import java.io.File;
import org.eclipse.emf.common.util.EList;
import org.eclipse.xtext.generator.IFileSystemAccess;
import org.eclipse.xtext.xbase.lib.Extension;
import org.franca.core.franca.FInterface;
import org.franca.core.franca.FModel;
@SuppressWarnings("all")
public class DefaultInterfaceProviderGenerator {
@Inject
@Extension
private JoynrCppGeneratorExtensions _joynrCppGeneratorExtensions;
@Inject
private DefaultInterfaceProviderHTemplate defaultProviderHTemplate;
@Inject
private DefaultInterfaceProviderCppTemplate defaultProviderCppTemplate;
public void doGenerate(final FModel fModel, final IFileSystemAccess sourceFileSystem, final IFileSystemAccess headerFileSystem, final String sourceContainerPath, final String headerContainerPath) {
EList _interfaces = fModel.getInterfaces();
for (final FInterface serviceInterface : _interfaces) {
{
String _packageSourceDirectory = this._joynrCppGeneratorExtensions.getPackageSourceDirectory(serviceInterface);
String _plus = (sourceContainerPath + _packageSourceDirectory);
final String sourcepath = (_plus + File.separator);
String _packagePathWithJoynrPrefix = this._joynrCppGeneratorExtensions.getPackagePathWithJoynrPrefix(serviceInterface, File.separator);
String _plus_1 = (headerContainerPath + _packagePathWithJoynrPrefix);
final String headerpath = (_plus_1 + File.separator);
final String serviceName = this._joynrCppGeneratorExtensions.joynrName(serviceInterface);
this._joynrCppGeneratorExtensions.generateFile(headerFileSystem,
(((headerpath + "Default") + serviceName) + "Provider.h"),
this.defaultProviderHTemplate, serviceInterface);
this._joynrCppGeneratorExtensions.generateFile(sourceFileSystem,
(((sourcepath + "Default") + serviceName) + "Provider.cpp"),
this.defaultProviderCppTemplate, serviceInterface);
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy