io.joynr.generator.cpp.joynrmessaging.JoynrMessagingGenerator Maven / Gradle / Ivy
package io.joynr.generator.cpp.joynrmessaging;
import com.google.inject.Inject;
import io.joynr.generator.cpp.joynrmessaging.InterfaceJoynrMessagingConnectorCppTemplate;
import io.joynr.generator.cpp.joynrmessaging.InterfaceJoynrMessagingConnectorHTemplate;
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 JoynrMessagingGenerator {
@Inject
@Extension
private JoynrCppGeneratorExtensions _joynrCppGeneratorExtensions;
@Inject
private InterfaceJoynrMessagingConnectorHTemplate interfaceJoynrMessagingConnectorH;
@Inject
private InterfaceJoynrMessagingConnectorCppTemplate interfaceJoynrMessagingConnectorCpp;
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 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 + serviceName) + "JoynrMessagingConnector.h"),
this.interfaceJoynrMessagingConnectorH, serviceInterface);
this._joynrCppGeneratorExtensions.generateFile(sourceFileSystem,
((sourcePath + serviceName) + "JoynrMessagingConnector.cpp"),
this.interfaceJoynrMessagingConnectorCpp, serviceInterface);
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy