io.joynr.generator.cpp.joynrmessaging.InterfaceJoynrMessagingConnectorHTemplate Maven / Gradle / Ivy
package io.joynr.generator.cpp.joynrmessaging;
import com.google.inject.Inject;
import io.joynr.generator.cpp.util.CppStdTypeUtil;
import io.joynr.generator.cpp.util.InterfaceUtil;
import io.joynr.generator.cpp.util.JoynrCppGeneratorExtensions;
import io.joynr.generator.cpp.util.TemplateBase;
import io.joynr.generator.util.InterfaceTemplate;
import java.util.Set;
import org.eclipse.emf.common.util.EList;
import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.StringExtensions;
import org.franca.core.franca.FAttribute;
import org.franca.core.franca.FBroadcast;
import org.franca.core.franca.FInterface;
@SuppressWarnings("all")
public class InterfaceJoynrMessagingConnectorHTemplate implements InterfaceTemplate {
@Inject
@Extension
private TemplateBase _templateBase;
@Inject
@Extension
private CppStdTypeUtil _cppStdTypeUtil;
@Inject
@Extension
private InterfaceUtil _interfaceUtil;
@Inject
@Extension
private JoynrCppGeneratorExtensions _joynrCppGeneratorExtensions;
public CharSequence generate(final FInterface serviceInterface) {
StringConcatenation _builder = new StringConcatenation();
final String interfaceName = this._joynrCppGeneratorExtensions.joynrName(serviceInterface);
_builder.newLineIfNotEmpty();
String _packagePathWithJoynrPrefix = this._joynrCppGeneratorExtensions.getPackagePathWithJoynrPrefix(serviceInterface, "_");
String _plus = ("GENERATED_INTERFACE_" + _packagePathWithJoynrPrefix);
String _plus_1 = (_plus +
"_");
String _plus_2 = (_plus_1 + interfaceName);
String _plus_3 = (_plus_2 + "JoynrMessagingConnector_h");
final String headerGuard = _plus_3.toUpperCase();
_builder.newLineIfNotEmpty();
CharSequence _warning = this._templateBase.warning();
_builder.append(_warning, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
_builder.append("#ifndef ");
_builder.append(headerGuard, "");
_builder.newLineIfNotEmpty();
_builder.append("#define ");
_builder.append(headerGuard, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
String _dllExportIncludeStatement = this._joynrCppGeneratorExtensions.getDllExportIncludeStatement();
_builder.append(_dllExportIncludeStatement, "");
_builder.newLineIfNotEmpty();
{
Set _requiredIncludesFor = this._cppStdTypeUtil.getRequiredIncludesFor(serviceInterface);
String _includeForString = this._cppStdTypeUtil.getIncludeForString();
Set _addElements = this._cppStdTypeUtil.addElements(_requiredIncludesFor, _includeForString);
for(final String parameterType : _addElements) {
_builder.append("#include ");
_builder.append(parameterType, "");
_builder.newLineIfNotEmpty();
}
}
_builder.newLine();
_builder.append("#include ");
_builder.newLine();
_builder.append("#include \"");
String _packagePathWithJoynrPrefix_1 = this._joynrCppGeneratorExtensions.getPackagePathWithJoynrPrefix(serviceInterface, "/");
_builder.append(_packagePathWithJoynrPrefix_1, "");
_builder.append("/I");
_builder.append(interfaceName, "");
_builder.append("Connector.h\"");
_builder.newLineIfNotEmpty();
_builder.append("#include \"joynr/AbstractJoynrMessagingConnector.h\"");
_builder.newLine();
_builder.append("#include \"joynr/JoynrMessagingConnectorFactory.h\"");
_builder.newLine();
_builder.append("#include \"joynr/SubscriptionRequest.h\"");
_builder.newLine();
_builder.append("#include \"joynr/BroadcastSubscriptionRequest.h\"");
_builder.newLine();
_builder.append("#include \"joynr/SubscriptionQos.h\"");
_builder.newLine();
_builder.append("#include \"joynr/OnChangeSubscriptionQos.h\"");
_builder.newLine();
_builder.newLine();
_builder.append("namespace joynr {");
_builder.newLine();
_builder.append("\t");
_builder.append("class MessagingQos;");
_builder.newLine();
_builder.append("\t");
_builder.append("class IJoynrMessageSender;");
_builder.newLine();
_builder.append("\t");
_builder.append("class ISubscriptionManager;");
_builder.newLine();
_builder.append("}");
_builder.newLine();
_builder.newLine();
String _namespaceStarter = this._joynrCppGeneratorExtensions.getNamespaceStarter(serviceInterface);
_builder.append(_namespaceStarter, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
_builder.newLine();
_builder.append("/** @brief JoynrMessagingConnector for interface ");
_builder.append(interfaceName, "");
_builder.append(" */");
_builder.newLineIfNotEmpty();
_builder.append("class ");
String _dllExportMacro = this._joynrCppGeneratorExtensions.getDllExportMacro();
_builder.append(_dllExportMacro, "");
_builder.append(" ");
_builder.append(interfaceName, "");
_builder.append("JoynrMessagingConnector : public I");
_builder.append(interfaceName, "");
_builder.append("Connector, virtual public joynr::AbstractJoynrMessagingConnector {");
_builder.newLineIfNotEmpty();
_builder.append("private:");
_builder.newLine();
{
EList _attributes = this._joynrCppGeneratorExtensions.getAttributes(serviceInterface);
for(final FAttribute attribute : _attributes) {
_builder.append("\t");
final String returnType = this._cppStdTypeUtil.getTypeName(attribute);
_builder.newLineIfNotEmpty();
_builder.append("\t");
final String attributeName = this._joynrCppGeneratorExtensions.joynrName(attribute);
_builder.newLineIfNotEmpty();
{
boolean _isNotifiable = this._joynrCppGeneratorExtensions.isNotifiable(attribute);
if (_isNotifiable) {
_builder.append("\t");
_builder.append("/**");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @brief creates a new subscription or updates an existing subscription to attribute ");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* ");
String _firstUpper = StringExtensions.toFirstUpper(attributeName);
_builder.append(_firstUpper, "\t ");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param subscriptionListener The listener callback providing methods to call on publication and failure");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param subscriptionQos The subscription quality of service settings");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param subscriptionRequest The subscription request");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @return the subscription id as string");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("*/");
_builder.newLine();
_builder.append("\t");
_builder.append("std::string subscribeTo");
String _firstUpper_1 = StringExtensions.toFirstUpper(attributeName);
_builder.append(_firstUpper_1, "\t");
_builder.append("(");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("\t\t");
_builder.append("std::shared_ptr > subscriptionListener,");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("\t\t");
_builder.append("const joynr::SubscriptionQos& subscriptionQos,");
_builder.newLine();
_builder.append("\t");
_builder.append("\t\t");
_builder.append("SubscriptionRequest& subscriptionRequest);");
_builder.newLine();
}
}
}
}
{
EList _broadcasts = serviceInterface.getBroadcasts();
for(final FBroadcast broadcast : _broadcasts) {
_builder.append("\t");
final String returnTypes = this._cppStdTypeUtil.getCommaSeparatedOutputParameterTypes(broadcast);
_builder.newLineIfNotEmpty();
_builder.append("\t");
final String broadcastName = this._joynrCppGeneratorExtensions.joynrName(broadcast);
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("/**");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @brief subscribes to broadcast ");
String _firstUpper_2 = StringExtensions.toFirstUpper(broadcastName);
_builder.append(_firstUpper_2, "\t ");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param subscriptionListener The listener callback providing methods to call on publication and failure");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param subscriptionQos The subscription quality of service settings");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param subscriptionRequest The subscription request");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @return the subscription id as string");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("*/");
_builder.newLine();
_builder.append("\t");
_builder.append("std::string subscribeTo");
String _firstUpper_3 = StringExtensions.toFirstUpper(broadcastName);
_builder.append(_firstUpper_3, "\t");
_builder.append("Broadcast(");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("\t\t");
_builder.append("std::shared_ptr > subscriptionListener,");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("\t\t");
_builder.append("const joynr::OnChangeSubscriptionQos& subscriptionQos,");
_builder.newLine();
_builder.append("\t");
_builder.append("\t\t");
_builder.append("BroadcastSubscriptionRequest& subscriptionRequest);");
_builder.newLine();
}
}
_builder.append("public:");
_builder.newLine();
_builder.append("\t");
_builder.append("/**");
_builder.newLine();
_builder.append("\t ");
_builder.append("* @brief Parameterized constructor");
_builder.newLine();
_builder.append("\t ");
_builder.append("* @param messageSender The message sender");
_builder.newLine();
_builder.append("\t ");
_builder.append("* @param subscriptionManager Pointer to subscription manager instance");
_builder.newLine();
_builder.append("\t ");
_builder.append("* @param domain the provider domain");
_builder.newLine();
_builder.append("\t ");
_builder.append("* @param proxyParticipantId The participant id of the proxy");
_builder.newLine();
_builder.append("\t ");
_builder.append("* @param providerParticipantId The participant id of the provider");
_builder.newLine();
_builder.append("\t ");
_builder.append("* @param qosSettings The quality of service settings");
_builder.newLine();
_builder.append("\t ");
_builder.append("* @param cache Pointer to the client cache instance");
_builder.newLine();
_builder.append("\t ");
_builder.append("* @param cached True, if entries are cached, false otherwise");
_builder.newLine();
_builder.append("\t ");
_builder.append("*/");
_builder.newLine();
_builder.append("\t");
_builder.append(interfaceName, "\t");
_builder.append("JoynrMessagingConnector(");
_builder.newLineIfNotEmpty();
_builder.append("\t\t");
_builder.append("joynr::IJoynrMessageSender* messageSender,");
_builder.newLine();
_builder.append("\t\t");
_builder.append("joynr::ISubscriptionManager* subscriptionManager,");
_builder.newLine();
_builder.append("\t\t");
_builder.append("const std::string &domain,");
_builder.newLine();
_builder.append("\t\t");
_builder.append("const std::string proxyParticipantId,");
_builder.newLine();
_builder.append("\t\t");
_builder.append("const std::string& providerParticipantId,");
_builder.newLine();
_builder.append("\t\t");
_builder.append("const joynr::MessagingQos &qosSettings,");
_builder.newLine();
_builder.append("\t\t");
_builder.append("joynr::IClientCache *cache,");
_builder.newLine();
_builder.append("\t\t");
_builder.append("bool cached);");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("/**");
_builder.newLine();
_builder.append("\t ");
_builder.append("* @brief Checks whether cluster controller is used");
_builder.newLine();
_builder.append("\t ");
_builder.append("* @return true, if cluster controller is used");
_builder.newLine();
_builder.append("\t ");
_builder.append("*/");
_builder.newLine();
_builder.append("\t");
_builder.append("virtual bool usesClusterController() const;");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("/** @brief Destructor */");
_builder.newLine();
_builder.append("\t");
_builder.append("virtual ~");
_builder.append(interfaceName, "\t");
_builder.append("JoynrMessagingConnector(){}");
_builder.newLineIfNotEmpty();
_builder.newLine();
_builder.append("\t");
CharSequence _produceSyncGetters = this._interfaceUtil.produceSyncGetters(serviceInterface, false);
_builder.append(_produceSyncGetters, "\t");
_builder.newLineIfNotEmpty();
_builder.append("\t");
CharSequence _produceAsyncGetters = this._interfaceUtil.produceAsyncGetters(serviceInterface, false);
_builder.append(_produceAsyncGetters, "\t");
_builder.newLineIfNotEmpty();
_builder.append("\t");
CharSequence _produceSyncSetters = this._interfaceUtil.produceSyncSetters(serviceInterface, false);
_builder.append(_produceSyncSetters, "\t");
_builder.newLineIfNotEmpty();
_builder.append("\t");
CharSequence _produceAsyncSetters = this._interfaceUtil.produceAsyncSetters(serviceInterface, false);
_builder.append(_produceAsyncSetters, "\t");
_builder.newLineIfNotEmpty();
{
EList _attributes_1 = this._joynrCppGeneratorExtensions.getAttributes(serviceInterface);
for(final FAttribute attribute_1 : _attributes_1) {
_builder.append("\t");
final String returnType_1 = this._cppStdTypeUtil.getTypeName(attribute_1);
_builder.newLineIfNotEmpty();
_builder.append("\t");
final String attributeName_1 = this._joynrCppGeneratorExtensions.joynrName(attribute_1);
_builder.newLineIfNotEmpty();
{
boolean _isNotifiable_1 = this._joynrCppGeneratorExtensions.isNotifiable(attribute_1);
if (_isNotifiable_1) {
_builder.append("\t");
_builder.append("/**");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @brief creates a new subscription subscription to attribute ");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* ");
String _firstUpper_4 = StringExtensions.toFirstUpper(attributeName_1);
_builder.append(_firstUpper_4, "\t ");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param subscriptionListener The listener callback providing methods to call on publication and failure");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param subscriptionQos The subscription quality of service settings");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @return the subscription id as string");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("*/");
_builder.newLine();
_builder.append("\t");
_builder.append("virtual std::string subscribeTo");
String _firstUpper_5 = StringExtensions.toFirstUpper(attributeName_1);
_builder.append(_firstUpper_5, "\t");
_builder.append("(");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("\t\t\t");
_builder.append("std::shared_ptr > subscriptionListener,");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("\t\t\t");
_builder.append("const joynr::SubscriptionQos& subscriptionQos);");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("/**");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @brief updates an existing subscription to attribute ");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* ");
String _firstUpper_6 = StringExtensions.toFirstUpper(attributeName_1);
_builder.append(_firstUpper_6, "\t ");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param subscriptionListener The listener callback providing methods to call on publication and failure");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param subscriptionQos The subscription quality of service settings");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @return the subscription id as string");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("*/");
_builder.newLine();
_builder.append("\t");
_builder.append("virtual std::string subscribeTo");
String _firstUpper_7 = StringExtensions.toFirstUpper(attributeName_1);
_builder.append(_firstUpper_7, "\t");
_builder.append("(");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("\t\t\t");
_builder.append("std::shared_ptr > subscriptionListener,");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("\t\t\t");
_builder.append("const joynr::SubscriptionQos& subscriptionQos,");
_builder.newLine();
_builder.append("\t");
_builder.append("\t\t\t");
_builder.append("std::string& subscriptionId);");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("/**");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @brief unsubscribes from attribute ");
String _firstUpper_8 = StringExtensions.toFirstUpper(attributeName_1);
_builder.append(_firstUpper_8, "\t ");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param subscriptionId The subscription id returned earlier on creation of the subscription");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("*/");
_builder.newLine();
_builder.append("\t");
_builder.append("virtual void unsubscribeFrom");
String _firstUpper_9 = StringExtensions.toFirstUpper(attributeName_1);
_builder.append(_firstUpper_9, "\t");
_builder.append("(std::string& subscriptionId);");
_builder.newLineIfNotEmpty();
}
}
}
}
_builder.newLine();
_builder.append("\t");
CharSequence _produceSyncMethods = this._interfaceUtil.produceSyncMethods(serviceInterface, false);
_builder.append(_produceSyncMethods, "\t");
_builder.newLineIfNotEmpty();
_builder.append("\t");
CharSequence _produceAsyncMethods = this._interfaceUtil.produceAsyncMethods(serviceInterface, false);
_builder.append(_produceAsyncMethods, "\t");
_builder.newLineIfNotEmpty();
_builder.newLine();
{
EList _broadcasts_1 = serviceInterface.getBroadcasts();
for(final FBroadcast broadcast_1 : _broadcasts_1) {
_builder.newLine();
_builder.append("\t");
final String returnTypes_1 = this._cppStdTypeUtil.getCommaSeparatedOutputParameterTypes(broadcast_1);
_builder.newLineIfNotEmpty();
_builder.append("\t");
final String broadcastName_1 = this._joynrCppGeneratorExtensions.joynrName(broadcast_1);
_builder.newLineIfNotEmpty();
{
boolean _isSelective = this._joynrCppGeneratorExtensions.isSelective(broadcast_1);
if (_isSelective) {
_builder.append("\t");
_builder.append("/**");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @brief subscribes to selective broadcast ");
String _firstUpper_10 = StringExtensions.toFirstUpper(broadcastName_1);
_builder.append(_firstUpper_10, "\t ");
_builder.append(" with filter parameters");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param filterParameters The filter parameters for selection of suitable broadcasts");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param subscriptionListener The listener callback providing methods to call on publication and failure");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param subscriptionQos The subscription quality of service settings");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @return the subscription id as string");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("*/");
_builder.newLine();
_builder.append("\t");
_builder.append("virtual std::string subscribeTo");
String _firstUpper_11 = StringExtensions.toFirstUpper(broadcastName_1);
_builder.append(_firstUpper_11, "\t");
_builder.append("Broadcast(");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("\t\t\t");
_builder.append("const ");
String _firstUpper_12 = StringExtensions.toFirstUpper(interfaceName);
_builder.append(_firstUpper_12, "\t\t\t\t");
String _firstUpper_13 = StringExtensions.toFirstUpper(broadcastName_1);
_builder.append(_firstUpper_13, "\t\t\t\t");
_builder.append("BroadcastFilterParameters& filterParameters,");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("\t\t\t");
_builder.append("std::shared_ptr > subscriptionListener,");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("\t\t\t");
_builder.append("const joynr::OnChangeSubscriptionQos& subscriptionQos);");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("/**");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @brief updates an existing subscription to selective broadcast ");
String _firstUpper_14 = StringExtensions.toFirstUpper(broadcastName_1);
_builder.append(_firstUpper_14, "\t ");
_builder.append(" with filter parameters");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param filterParameters The filter parameters for selection of suitable broadcasts");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param subscriptionListener The listener callback providing methods to call on publication and failure");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param subscriptionQos The subscription quality of service settings");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param subscriptionId The subscription id returned earlier on creation of the subscription");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @return the subscription id as string");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("*/");
_builder.newLine();
_builder.append("\t");
_builder.append("virtual std::string subscribeTo");
String _firstUpper_15 = StringExtensions.toFirstUpper(broadcastName_1);
_builder.append(_firstUpper_15, "\t");
_builder.append("Broadcast(");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("\t\t\t");
_builder.append("const ");
String _firstUpper_16 = StringExtensions.toFirstUpper(interfaceName);
_builder.append(_firstUpper_16, "\t\t\t\t");
String _firstUpper_17 = StringExtensions.toFirstUpper(broadcastName_1);
_builder.append(_firstUpper_17, "\t\t\t\t");
_builder.append("BroadcastFilterParameters& filterParameters,");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("\t\t\t");
_builder.append("std::shared_ptr > subscriptionListener,");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("\t\t\t");
_builder.append("const joynr::OnChangeSubscriptionQos& subscriptionQos,");
_builder.newLine();
_builder.append("\t");
_builder.append("\t\t\t");
_builder.append("std::string& subscriptionId);");
_builder.newLine();
} else {
_builder.append("\t");
_builder.append("/**");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @brief subscribes to broadcast ");
String _firstUpper_18 = StringExtensions.toFirstUpper(broadcastName_1);
_builder.append(_firstUpper_18, "\t ");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param subscriptionListener The listener callback providing methods to call on publication and failure");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param subscriptionQos The subscription quality of service settings");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @return the subscription id as string");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("*/");
_builder.newLine();
_builder.append("\t");
_builder.append("virtual std::string subscribeTo");
String _firstUpper_19 = StringExtensions.toFirstUpper(broadcastName_1);
_builder.append(_firstUpper_19, "\t");
_builder.append("Broadcast(");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("\t\t\t");
_builder.append("std::shared_ptr > subscriptionListener,");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("\t\t\t");
_builder.append("const joynr::OnChangeSubscriptionQos& subscriptionQos);");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("/**");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @brief updates an existing subscription to broadcast ");
String _firstUpper_20 = StringExtensions.toFirstUpper(broadcastName_1);
_builder.append(_firstUpper_20, "\t ");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param filterParameters The filter parameters for selection of suitable broadcasts");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param subscriptionListener The listener callback providing methods to call on publication and failure");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param subscriptionQos The subscription quality of service settings");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param subscriptionId The subscription id returned earlier on creation of the subscription");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @return the subscription id as string");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("*/");
_builder.newLine();
_builder.append("\t");
_builder.append("virtual std::string subscribeTo");
String _firstUpper_21 = StringExtensions.toFirstUpper(broadcastName_1);
_builder.append(_firstUpper_21, "\t");
_builder.append("Broadcast(");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("\t\t\t");
_builder.append("std::shared_ptr > subscriptionListener,");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("\t\t\t");
_builder.append("const joynr::OnChangeSubscriptionQos& subscriptionQos,");
_builder.newLine();
_builder.append("\t");
_builder.append("\t\t\t");
_builder.append("std::string& subscriptionId);");
_builder.newLine();
}
}
_builder.newLine();
_builder.append("\t");
_builder.append("/**");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @brief unsubscribes from broadcast ");
String _firstUpper_22 = StringExtensions.toFirstUpper(broadcastName_1);
_builder.append(_firstUpper_22, "\t ");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append(" ");
_builder.append("* @param subscriptionId The subscription id returned earlier on creation of the subscription");
_builder.newLine();
_builder.append("\t");
_builder.append(" ");
_builder.append("*/");
_builder.newLine();
_builder.append("\t");
_builder.append("virtual void unsubscribeFrom");
String _firstUpper_23 = StringExtensions.toFirstUpper(broadcastName_1);
_builder.append(_firstUpper_23, "\t");
_builder.append("Broadcast(std::string& subscriptionId);");
_builder.newLineIfNotEmpty();
}
}
_builder.append("};");
_builder.newLine();
String _namespaceEnder = this._joynrCppGeneratorExtensions.getNamespaceEnder(serviceInterface);
_builder.append(_namespaceEnder, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
_builder.append("namespace joynr {");
_builder.newLine();
_builder.newLine();
_builder.append("// Helper class for use by the JoynrMessagingConnectorFactory");
_builder.newLine();
_builder.append("// This class creates instances of ");
_builder.append(interfaceName, "");
_builder.append("JoynrMessagingConnector");
_builder.newLineIfNotEmpty();
_builder.append("template <>");
_builder.newLine();
_builder.append("class JoynrMessagingConnectorFactoryHelper <");
String _packagePathWithJoynrPrefix_2 = this._joynrCppGeneratorExtensions.getPackagePathWithJoynrPrefix(serviceInterface, "::");
_builder.append(_packagePathWithJoynrPrefix_2, "");
_builder.append("::I");
_builder.append(interfaceName, "");
_builder.append("Connector> {");
_builder.newLineIfNotEmpty();
_builder.append("public:");
_builder.newLine();
_builder.append("\t");
String _packagePathWithJoynrPrefix_3 = this._joynrCppGeneratorExtensions.getPackagePathWithJoynrPrefix(serviceInterface, "::");
_builder.append(_packagePathWithJoynrPrefix_3, "\t");
_builder.append("::");
_builder.append(interfaceName, "\t");
_builder.append("JoynrMessagingConnector* create(");
_builder.newLineIfNotEmpty();
_builder.append("\t\t\t");
_builder.append("joynr::IJoynrMessageSender* messageSender,");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("joynr::ISubscriptionManager* subscriptionManager,");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("const std::string &domain,");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("const std::string proxyParticipantId,");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("const std::string& providerParticipantId,");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("const joynr::MessagingQos &qosSettings,");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("joynr::IClientCache *cache,");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("bool cached");
_builder.newLine();
_builder.append("\t");
_builder.append(") {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("return new ");
String _packagePathWithJoynrPrefix_4 = this._joynrCppGeneratorExtensions.getPackagePathWithJoynrPrefix(serviceInterface, "::");
_builder.append(_packagePathWithJoynrPrefix_4, "\t\t");
_builder.append("::");
_builder.append(interfaceName, "\t\t");
_builder.append("JoynrMessagingConnector(");
_builder.newLineIfNotEmpty();
_builder.append("\t\t\t\t\t");
_builder.append("messageSender,");
_builder.newLine();
_builder.append("\t\t\t\t\t");
_builder.append("subscriptionManager,");
_builder.newLine();
_builder.append("\t\t\t\t\t");
_builder.append("domain,");
_builder.newLine();
_builder.append("\t\t\t\t\t");
_builder.append("proxyParticipantId,");
_builder.newLine();
_builder.append("\t\t\t\t\t");
_builder.append("providerParticipantId,");
_builder.newLine();
_builder.append("\t\t\t\t\t");
_builder.append("qosSettings,");
_builder.newLine();
_builder.append("\t\t\t\t\t");
_builder.append("cache,");
_builder.newLine();
_builder.append("\t\t\t\t\t");
_builder.append("cached");
_builder.newLine();
_builder.append("\t\t");
_builder.append(");");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("};");
_builder.newLine();
_builder.newLine();
_builder.append("} // namespace joynr");
_builder.newLine();
_builder.append("#endif // ");
_builder.append(headerGuard, "");
_builder.newLineIfNotEmpty();
return _builder;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy