Skip to content

Commit

Permalink
[#609] Rename allocator parameter in generated reflectable code
Browse files Browse the repository at this point in the history
  • Loading branch information
mikir committed May 30, 2024
1 parent e1c5db4 commit dee9448
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
12 changes: 6 additions & 6 deletions compiler/extensions/cpp/freemarker/Bitmask.cpp.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ ${types.reflectablePtr.name} ${name}::reflectable(const ${types.allocator.defaul
</#if>
}

${types.anyHolder.name} getAnyValue(const ${types.allocator.default}& allocator) const override
${types.anyHolder.name} getAnyValue(const ${types.allocator.default}& alloc) const override
{
return ${types.anyHolder.name}(m_bitmask, allocator);
return ${types.anyHolder.name}(m_bitmask, alloc);
}

${types.anyHolder.name} getAnyValue(const ${types.allocator.default}& allocator) override
${types.anyHolder.name} getAnyValue(const ${types.allocator.default}& alloc) override
{
return ${types.anyHolder.name}(m_bitmask, allocator);
return ${types.anyHolder.name}(m_bitmask, alloc);
}

<#-- bitmask is always unsigned -->
Expand All @@ -125,9 +125,9 @@ ${types.reflectablePtr.name} ${name}::reflectable(const ${types.allocator.defaul
return static_cast<double>(toUInt());
}

${types.string.name} toString(const ${types.allocator.default}& allocator) const override
${types.string.name} toString(const ${types.allocator.default}& alloc) const override
{
return m_bitmask.toString(allocator);
return m_bitmask.toString(alloc);
}

private:
Expand Down
12 changes: 6 additions & 6 deletions compiler/extensions/cpp/freemarker/Choice.cpp.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ ${I}return {};
using ::zserio::ReflectableConstAllocatorHolderBase<allocator_type>::getAnyValue;

</#if>
explicit Reflectable(<#if isConst>const </#if>${fullName}& object, const allocator_type& allocator) :
explicit Reflectable(<#if isConst>const </#if>${fullName}& object, const allocator_type& alloc) :
::zserio::Reflectable<#if isConst>Const</#if>AllocatorHolderBase<allocator_type>(<#rt>
<#lt>${fullName}::typeInfo(), allocator),
<#lt>${fullName}::typeInfo(), alloc),
m_object(object)
{}
<#if !isConst>
Expand Down Expand Up @@ -269,15 +269,15 @@ ${I}return {};
</#if>
}

${types.anyHolder.name} getAnyValue(const allocator_type& allocator) const override
${types.anyHolder.name} getAnyValue(const allocator_type& alloc) const override
{
return ${types.anyHolder.name}(::std::cref(m_object), allocator);
return ${types.anyHolder.name}(::std::cref(m_object), alloc);
}
<#if !isConst>

${types.anyHolder.name} getAnyValue(const allocator_type& allocator) override
${types.anyHolder.name} getAnyValue(const allocator_type& alloc) override
{
return ${types.anyHolder.name}(::std::ref(m_object), allocator);
return ${types.anyHolder.name}(::std::ref(m_object), alloc);
}
</#if>

Expand Down
12 changes: 6 additions & 6 deletions compiler/extensions/cpp/freemarker/Enumeration.cpp.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ ${types.reflectablePtr.name} enumReflectable(${fullName} value, const ${types.al
</#if>
}

${types.anyHolder.name} getAnyValue(const ${types.allocator.default}& allocator) const override
${types.anyHolder.name} getAnyValue(const ${types.allocator.default}& alloc) const override
{
return ${types.anyHolder.name}(m_value, allocator);
return ${types.anyHolder.name}(m_value, alloc);
}

${types.anyHolder.name} getAnyValue(const ${types.allocator.default}& allocator) override
${types.anyHolder.name} getAnyValue(const ${types.allocator.default}& alloc) override
{
return ${types.anyHolder.name}(m_value, allocator);
return ${types.anyHolder.name}(m_value, alloc);
}

${underlyingTypeInfo.typeFullName} get<#rt>
Expand All @@ -109,9 +109,9 @@ ${types.reflectablePtr.name} enumReflectable(${fullName} value, const ${types.al
return static_cast<double>(<#if underlyingTypeInfo.isSigned>toInt()<#else>toUInt()</#if>);
}

${types.string.name} toString(const ${types.allocator.default}& allocator) const override
${types.string.name} toString(const ${types.allocator.default}& alloc) const override
{
return ${types.string.name}(::zserio::enumToString(m_value), allocator);
return ${types.string.name}(::zserio::enumToString(m_value), alloc);
}

private:
Expand Down
12 changes: 6 additions & 6 deletions compiler/extensions/cpp/freemarker/Structure.cpp.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ const ${types.typeInfo.name}& ${name}::typeInfo()
using ::zserio::ReflectableConstAllocatorHolderBase<allocator_type>::getAnyValue;

</#if>
explicit Reflectable(<#if isConst>const </#if>${fullName}& object, const allocator_type& allocator) :
explicit Reflectable(<#if isConst>const </#if>${fullName}& object, const allocator_type& alloc) :
::zserio::Reflectable<#if isConst>Const</#if>AllocatorHolderBase<allocator_type>(<#rt>
<#lt>${fullName}::typeInfo(), allocator),
<#lt>${fullName}::typeInfo(), alloc),
m_object(object)
{}
<#if !isConst>
Expand Down Expand Up @@ -222,15 +222,15 @@ const ${types.typeInfo.name}& ${name}::typeInfo()
</#if>
</#if>

${types.anyHolder.name} getAnyValue(const allocator_type& allocator) const override
${types.anyHolder.name} getAnyValue(const allocator_type& alloc) const override
{
return ${types.anyHolder.name}(::std::cref(m_object), allocator);
return ${types.anyHolder.name}(::std::cref(m_object), alloc);
}
<#if !isConst>

${types.anyHolder.name} getAnyValue(const allocator_type& allocator) override
${types.anyHolder.name} getAnyValue(const allocator_type& alloc) override
{
return ${types.anyHolder.name}(::std::ref(m_object), allocator);
return ${types.anyHolder.name}(::std::ref(m_object), alloc);
}
</#if>

Expand Down
12 changes: 6 additions & 6 deletions compiler/extensions/cpp/freemarker/Union.cpp.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ const ${types.typeInfo.name}& ${name}::typeInfo()
using ::zserio::ReflectableConstAllocatorHolderBase<allocator_type>::getAnyValue;

</#if>
explicit Reflectable(<#if isConst>const </#if>${fullName}& object, const allocator_type& allocator) :
::zserio::Reflectable<#if isConst>Const</#if>AllocatorHolderBase<allocator_type>(${fullName}::typeInfo(), allocator),
explicit Reflectable(<#if isConst>const </#if>${fullName}& object, const allocator_type& alloc) :
::zserio::Reflectable<#if isConst>Const</#if>AllocatorHolderBase<allocator_type>(${fullName}::typeInfo(), alloc),
m_object(object)
{}
<#if !isConst>
Expand Down Expand Up @@ -366,15 +366,15 @@ const ${types.typeInfo.name}& ${name}::typeInfo()
</#if>
}

${types.anyHolder.name} getAnyValue(const allocator_type& allocator) const override
${types.anyHolder.name} getAnyValue(const allocator_type& alloc) const override
{
return ${types.anyHolder.name}(::std::cref(m_object), allocator);
return ${types.anyHolder.name}(::std::cref(m_object), alloc);
}
<#if !isConst>

${types.anyHolder.name} getAnyValue(const allocator_type& allocator) override
${types.anyHolder.name} getAnyValue(const allocator_type& alloc) override
{
return ${types.anyHolder.name}(::std::ref(m_object), allocator);
return ${types.anyHolder.name}(::std::ref(m_object), alloc);
}
</#if>

Expand Down

0 comments on commit dee9448

Please sign in to comment.