Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,12 @@ public boolean isIsEnumType()
return super.getContentTypeCode().isIsEnumType();
}

@Override
public boolean isIsBufferType()
{
return super.getContentTypeCode().isIsBufferType();
}

public boolean isIsType_10()
{
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,23 @@ public boolean isIsSequenceType()
return true;
}

@Override
public boolean isIsBufferType()
{
if (isUnbound())
{
return getContentTypeCode().isIsByteType() || getContentTypeCode().isIsUint8Type();
}

return false;
}

@Override
public String getCppTypename()
{
ST st = getCppTypenameFromStringTemplate();
st.add("ctx", ctx);
st.add("sequence_type_code", this);
st.add("type", getContentTypeCode().getCppTypename());
String contenttype = getContentTypeCode().getCppTypename().replaceAll("::", "_");
if (getContentTypeCode() instanceof StringTypeCode)
Expand Down
11 changes: 8 additions & 3 deletions src/main/java/com/eprosima/idl/parser/typecode/TypeCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,11 @@ public boolean isIsUnionType()
return m_kind == Kind.KIND_UNION;
}

public boolean isIsBufferType()
{
return false;
}

// Functions to ease TypeIdentifier and TypeObject generation.
public String getCppTypenameForTypeId()
{
Expand Down Expand Up @@ -538,19 +543,19 @@ void calculate_extensibility(
{
if (m_annotations.containsKey(Annotation.final_str) ||
(m_annotations.containsKey(Annotation.extensibility_str) &&
m_annotations.get(Annotation.extensibility_str).getValue().equals(Annotation.ex_final_val)))
m_annotations.get(Annotation.extensibility_str).getEnumStringValue().equals(Annotation.ex_final_str)))
{
extensibility_ = ExtensibilityKind.FINAL;
}
else if (m_annotations.containsKey(Annotation.appendable_str) ||
(m_annotations.containsKey(Annotation.extensibility_str) &&
m_annotations.get(Annotation.extensibility_str).getValue().equals(Annotation.ex_appendable_val)))
m_annotations.get(Annotation.extensibility_str).getEnumStringValue().equals(Annotation.ex_appendable_str)))
{
extensibility_ = ExtensibilityKind.APPENDABLE;
}
else if (m_annotations.containsKey(Annotation.mutable_str) ||
(m_annotations.containsKey(Annotation.extensibility_str) &&
m_annotations.get(Annotation.extensibility_str).getValue().equals(Annotation.ex_mutable_val)))
m_annotations.get(Annotation.extensibility_str).getEnumStringValue().equals(Annotation.ex_mutable_str)))
{
extensibility_ = ExtensibilityKind.MUTABLE;
}
Expand Down
5 changes: 3 additions & 2 deletions src/main/resources/com/eprosima/idl/templates/Types.stg
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ type_c(name) ::= <<$name$>>

type_10(name) ::= <<$name$>>

// TODO Para que sirve empty en FastBuffers?
type_e(ctx, type, contenttype, maxsize, empty) ::= <<std::vector<$type$>$empty$>>
// Note: empty is never assigned. It is a helper to avoid '>>>' causing a syntax error when parsing the template,
// and avoid an extra space when it is not needed.
type_e(ctx, sequence_type_code, type, contenttype, maxsize, empty) ::= <<std::vector<$type$>$empty$>>

type_1a(name, type) ::= <<$name$>>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ type_c(name) ::= <<$name$>>

type_10(name) ::= <<$name$>>

// TODO Para que sirve empty en FastBuffers?
type_e(ctx, type, contenttype, maxsize, empty) ::= <<$ctx.filename$_$contenttype$Seq_$maxsize$_t>>
// Note: empty is never assigned. It is a helper to avoid '>>>' causing a syntax error when parsing the template,
// and avoid an extra space when it is not needed.
type_e(ctx, sequence_type_code, type, contenttype, maxsize, empty) ::= <<$ctx.filename$_$contenttype$Seq_$maxsize$_t>>

type_1a(name, type) ::= <<$name$>>

Expand Down