io.joynr.generator.cpp.proxy.InterfaceProxyCppTemplate Maven / Gradle / Ivy
package io.joynr.generator.cpp.proxy;
import com.google.inject.Inject;
import io.joynr.generator.cpp.util.JoynrCppGeneratorExtensions;
import io.joynr.generator.cpp.util.TemplateBase;
import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.xbase.lib.Extension;
import org.franca.core.franca.FInterface;
@SuppressWarnings("all")
public class InterfaceProxyCppTemplate {
@Inject
@Extension
private JoynrCppGeneratorExtensions _joynrCppGeneratorExtensions;
@Inject
@Extension
private TemplateBase _templateBase;
public CharSequence generate(final FInterface fInterface) {
CharSequence _xblockexpression = null;
{
final String interfaceName = this._joynrCppGeneratorExtensions.joynrName(fInterface);
final String className = (interfaceName + "Proxy");
final String asyncClassName = (interfaceName + "AsyncProxy");
final String syncClassName = (interfaceName + "SyncProxy");
StringConcatenation _builder = new StringConcatenation();
CharSequence _warning = this._templateBase.warning();
_builder.append(_warning, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
_builder.append("#include \"");
String _packagePathWithJoynrPrefix = this._joynrCppGeneratorExtensions.getPackagePathWithJoynrPrefix(fInterface, "/");
_builder.append(_packagePathWithJoynrPrefix, "");
_builder.append("/");
_builder.append(className, "");
_builder.append(".h\"");
_builder.newLineIfNotEmpty();
_builder.newLine();
String _namespaceStarter = this._joynrCppGeneratorExtensions.getNamespaceStarter(fInterface);
_builder.append(_namespaceStarter, "");
_builder.append(" ");
_builder.newLineIfNotEmpty();
_builder.append(className, "");
_builder.append("::");
_builder.append(className, "");
_builder.append("(");
_builder.newLineIfNotEmpty();
_builder.append(" ");
_builder.append("QSharedPointer messagingAddress,");
_builder.newLine();
_builder.append(" ");
_builder.append("joynr::ConnectorFactory* connectorFactory,");
_builder.newLine();
_builder.append(" ");
_builder.append("joynr::IClientCache *cache,");
_builder.newLine();
_builder.append(" ");
_builder.append("const QString &domain,");
_builder.newLine();
_builder.append(" ");
_builder.append("const joynr::ProxyQos& proxyQos,");
_builder.newLine();
_builder.append(" ");
_builder.append("const joynr::MessagingQos &qosSettings,");
_builder.newLine();
_builder.append(" ");
_builder.append("bool cached");
_builder.newLine();
_builder.append(") :");
_builder.newLine();
_builder.append(" ");
_builder.append("joynr::ProxyBase(connectorFactory, cache, domain, getInterfaceName(), proxyQos, qosSettings, cached),");
_builder.newLine();
_builder.append(" ");
_builder.append(className, " ");
_builder.append("Base(messagingAddress, connectorFactory, cache, domain, proxyQos, qosSettings, cached),");
_builder.newLineIfNotEmpty();
_builder.append(" ");
_builder.append(syncClassName, " ");
_builder.append("(messagingAddress, connectorFactory, cache, domain, proxyQos, qosSettings, cached),");
_builder.newLineIfNotEmpty();
_builder.append(" ");
_builder.append(asyncClassName, " ");
_builder.append("(messagingAddress, connectorFactory, cache, domain, proxyQos, qosSettings, cached)");
_builder.newLineIfNotEmpty();
_builder.append("{");
_builder.newLine();
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append(className, "");
_builder.append("::~");
_builder.append(className, "");
_builder.append("()");
_builder.newLineIfNotEmpty();
_builder.append("{");
_builder.newLine();
_builder.append("}");
_builder.newLine();
String _namespaceEnder = this._joynrCppGeneratorExtensions.getNamespaceEnder(fInterface);
_builder.append(_namespaceEnder, "");
_builder.newLineIfNotEmpty();
_xblockexpression = (_builder);
}
return _xblockexpression;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy