io.joynr.generator.cpp.proxy.ProxyGenerator Maven / Gradle / Ivy
package io.joynr.generator.cpp.proxy;
import com.google.inject.Inject;
import io.joynr.generator.cpp.proxy.IInterfaceConnectorHTemplate;
import io.joynr.generator.cpp.proxy.InterfaceAsyncProxyCppTemplate;
import io.joynr.generator.cpp.proxy.InterfaceAsyncProxyHTemplate;
import io.joynr.generator.cpp.proxy.InterfaceProxyBaseCppTemplate;
import io.joynr.generator.cpp.proxy.InterfaceProxyBaseHTemplate;
import io.joynr.generator.cpp.proxy.InterfaceProxyCppTemplate;
import io.joynr.generator.cpp.proxy.InterfaceProxyHTemplate;
import io.joynr.generator.cpp.proxy.InterfaceSyncProxyCppTemplate;
import io.joynr.generator.cpp.proxy.InterfaceSyncProxyHTemplate;
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 ProxyGenerator {
@Inject
@Extension
private JoynrCppGeneratorExtensions _joynrCppGeneratorExtensions;
@Inject
private IInterfaceConnectorHTemplate iInterfaceConnectorHTemplate;
@Inject
private InterfaceProxyBaseCppTemplate interfaceProxyBaseCpp;
@Inject
private InterfaceProxyBaseHTemplate interfaceProxyBaseH;
@Inject
private InterfaceProxyCppTemplate interfaceProxyCpp;
@Inject
private InterfaceProxyHTemplate interfaceProxyH;
@Inject
private InterfaceSyncProxyCppTemplate interfaceSyncProxyCpp;
@Inject
private InterfaceSyncProxyHTemplate interfaceSyncProxyH;
@Inject
private InterfaceAsyncProxyCppTemplate interfaceAsyncProxyCpp;
@Inject
private InterfaceAsyncProxyHTemplate interfaceAsyncProxyH;
public void doGenerate(final FModel model, final IFileSystemAccess sourceFileSystem, final IFileSystemAccess headerFileSystem, final String sourceContainerPath, final String headerContainerPath) {
EList _interfaces = model.getInterfaces();
for (final FInterface fInterface : _interfaces) {
{
String _packageSourceDirectory = this._joynrCppGeneratorExtensions.getPackageSourceDirectory(fInterface);
String _plus = (sourceContainerPath + _packageSourceDirectory);
final String sourcePath = (_plus + File.separator);
String _packagePathWithJoynrPrefix = this._joynrCppGeneratorExtensions.getPackagePathWithJoynrPrefix(fInterface, File.separator);
String _plus_1 = (headerContainerPath + _packagePathWithJoynrPrefix);
final String headerPath = (_plus_1 + File.separator);
String serviceName = this._joynrCppGeneratorExtensions.joynrName(fInterface);
this._joynrCppGeneratorExtensions.generateFile(headerFileSystem,
(((headerPath + "I") + serviceName) + "Connector.h"),
this.iInterfaceConnectorHTemplate, fInterface);
this._joynrCppGeneratorExtensions.generateFile(headerFileSystem,
((headerPath + serviceName) + "ProxyBase.h"),
this.interfaceProxyBaseH, fInterface);
this._joynrCppGeneratorExtensions.generateFile(sourceFileSystem,
((sourcePath + serviceName) + "ProxyBase.cpp"),
this.interfaceProxyBaseCpp, fInterface);
this._joynrCppGeneratorExtensions.generateFile(headerFileSystem,
((headerPath + serviceName) + "Proxy.h"),
this.interfaceProxyH, fInterface);
this._joynrCppGeneratorExtensions.generateFile(sourceFileSystem,
((sourcePath + serviceName) + "Proxy.cpp"),
this.interfaceProxyCpp, fInterface);
this._joynrCppGeneratorExtensions.generateFile(headerFileSystem,
((headerPath + serviceName) + "SyncProxy.h"),
this.interfaceSyncProxyH, fInterface);
this._joynrCppGeneratorExtensions.generateFile(sourceFileSystem,
((sourcePath + serviceName) + "SyncProxy.cpp"),
this.interfaceSyncProxyCpp, fInterface);
this._joynrCppGeneratorExtensions.generateFile(headerFileSystem,
((headerPath + serviceName) + "AsyncProxy.h"),
this.interfaceAsyncProxyH, fInterface);
this._joynrCppGeneratorExtensions.generateFile(sourceFileSystem,
((sourcePath + serviceName) + "AsyncProxy.cpp"),
this.interfaceAsyncProxyCpp, fInterface);
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy