All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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);
        String _plus_2 = (headerPath + "I");
        String _plus_3 = (_plus_2 + serviceName);
        String _plus_4 = (_plus_3 + "Connector.h");
        CharSequence _generate = this.iInterfaceConnectorHTemplate.generate(fInterface);
        String _string = _generate.toString();
        headerFileSystem.generateFile(_plus_4, _string);
        String _plus_5 = (headerPath + serviceName);
        String _plus_6 = (_plus_5 + "ProxyBase.h");
        CharSequence _generate_1 = this.interfaceProxyBaseH.generate(fInterface);
        String _string_1 = _generate_1.toString();
        headerFileSystem.generateFile(_plus_6, _string_1);
        String _plus_7 = (sourcePath + serviceName);
        String _plus_8 = (_plus_7 + "ProxyBase.cpp");
        CharSequence _generate_2 = this.interfaceProxyBaseCpp.generate(fInterface);
        String _string_2 = _generate_2.toString();
        sourceFileSystem.generateFile(_plus_8, _string_2);
        String _plus_9 = (headerPath + serviceName);
        String _plus_10 = (_plus_9 + "Proxy.h");
        CharSequence _generate_3 = this.interfaceProxyH.generate(fInterface);
        String _string_3 = _generate_3.toString();
        headerFileSystem.generateFile(_plus_10, _string_3);
        String _plus_11 = (sourcePath + serviceName);
        String _plus_12 = (_plus_11 + "Proxy.cpp");
        CharSequence _generate_4 = this.interfaceProxyCpp.generate(fInterface);
        String _string_4 = _generate_4.toString();
        sourceFileSystem.generateFile(_plus_12, _string_4);
        String _plus_13 = (headerPath + serviceName);
        String _plus_14 = (_plus_13 + "SyncProxy.h");
        CharSequence _generate_5 = this.interfaceSyncProxyH.generate(fInterface);
        String _string_5 = _generate_5.toString();
        headerFileSystem.generateFile(_plus_14, _string_5);
        String _plus_15 = (sourcePath + serviceName);
        String _plus_16 = (_plus_15 + "SyncProxy.cpp");
        CharSequence _generate_6 = this.interfaceSyncProxyCpp.generate(fInterface);
        String _string_6 = _generate_6.toString();
        sourceFileSystem.generateFile(_plus_16, _string_6);
        String _plus_17 = (headerPath + serviceName);
        String _plus_18 = (_plus_17 + "AsyncProxy.h");
        CharSequence _generate_7 = this.interfaceAsyncProxyH.generate(fInterface);
        String _string_7 = _generate_7.toString();
        headerFileSystem.generateFile(_plus_18, _string_7);
        String _plus_19 = (sourcePath + serviceName);
        String _plus_20 = (_plus_19 + "AsyncProxy.cpp");
        CharSequence _generate_8 = this.interfaceAsyncProxyCpp.generate(fInterface);
        String _string_8 = _generate_8.toString();
        sourceFileSystem.generateFile(_plus_20, _string_8);
      }
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy