io.joynr.generator.cpp.communicationmodel.MapHTemplate Maven / Gradle / Ivy
package io.joynr.generator.cpp.communicationmodel;
import com.google.common.collect.Iterables;
import com.google.inject.assistedinject.Assisted;
import io.joynr.generator.cpp.util.CppStdTypeUtil;
import io.joynr.generator.cpp.util.JoynrCppGeneratorExtensions;
import io.joynr.generator.cpp.util.TemplateBase;
import io.joynr.generator.templates.MapTemplate;
import io.joynr.generator.templates.util.NamingUtil;
import java.util.Set;
import javax.inject.Inject;
import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.xbase.lib.Extension;
import org.franca.core.franca.FBasicTypeId;
import org.franca.core.franca.FMapType;
import org.franca.core.franca.FType;
@SuppressWarnings("all")
public class MapHTemplate extends MapTemplate {
@Inject
@Extension
private JoynrCppGeneratorExtensions _joynrCppGeneratorExtensions;
@Inject
@Extension
private CppStdTypeUtil _cppStdTypeUtil;
@Inject
@Extension
private NamingUtil _namingUtil;
@Inject
@Extension
private TemplateBase _templateBase;
@Inject
public MapHTemplate(@Assisted final FMapType type) {
super(type);
}
@Override
public CharSequence generate(final boolean generateVersion) {
StringConcatenation _builder = new StringConcatenation();
final String typeName = this._namingUtil.joynrName(this.type);
_builder.newLineIfNotEmpty();
String _packagePathWithJoynrPrefix = this._joynrCppGeneratorExtensions.getPackagePathWithJoynrPrefix(this.type, "_", true, generateVersion);
String _plus = ("GENERATED_TYPE_" + _packagePathWithJoynrPrefix);
String _plus_1 = (_plus + "_");
String _plus_2 = (_plus_1 + typeName);
final String headerGuard = (_plus_2 + "_H").toUpperCase();
_builder.newLineIfNotEmpty();
CharSequence _warning = this._templateBase.warning();
_builder.append(_warning);
_builder.newLineIfNotEmpty();
_builder.append("#ifndef ");
_builder.append(headerGuard);
_builder.newLineIfNotEmpty();
_builder.append("#define ");
_builder.append(headerGuard);
_builder.newLineIfNotEmpty();
_builder.newLine();
_builder.newLine();
_builder.append("#include