Merge pull request #3127 from aws-lumberyard-dev/scriptcanvas/codegenfix_namespace

Completed namespace support for the ScriptCanvasGrammar template
This commit is contained in:
Luis Sempé
2021-08-18 14:40:37 -07:00
committed by GitHub
2 changed files with 21 additions and 2 deletions
@@ -77,7 +77,7 @@ public: \
{% if Class.attrib['GraphEntryPoint'] is defined %} bool IsEntryPoint() const override { return {%if Class.attrib['GraphEntryPoint'] == "True" %}true{%else%}false{%endif%}; } \
{% endif %}
public: \
friend struct ::{{ className | replace(' ','') }}Property;
friend struct {% if attribute_Namespace is not defined %}::{% endif %}{{ className | replace(' ','') }}Property;
// Helpers for easily accessing properties and slots
struct {{ className | replace(' ','') }}Property
@@ -26,6 +26,20 @@ SPDX-License-Identifier: Apache-2.0 OR MIT
#include "{{ xml.attrib['Include'] }}"
{% for Class in xml.iter('Class') %}
{% set attribute_Namespace = undefined %}
{%- if Class.attrib['Namespace'] is defined %}
{% if Class.attrib['Namespace'] != "None" %}
{% set attribute_Namespace = Class.attrib['Namespace'] %}
{% endif %}
{% endif %}
{% if attribute_Namespace is defined %}
namespace {{attribute_Namespace}}
{
{% endif %}
void {{ Class.attrib['QualifiedName'] }}::ConfigureSlots()
{
{% if Class.attrib['Base'] is defined %}
@@ -269,7 +283,12 @@ void {{ Class.attrib['QualifiedName'] }}::Reflect(AZ::ReflectContext* context)
return datumValue ? *datumValue : {{ Property.attrib['Type'] }}();
}
{% endfor %}
{% if attribute_Namespace is defined %}
}
{% endif %}
{% endfor %}
{% endfor %}