You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
o3de/Gems/ScriptCanvas/Code/Include/ScriptCanvas/AutoGen/ScriptCanvasGrammar_Header....

165 lines
6.5 KiB
Django/Jinja

{#
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
#}
{% import 'ScriptCanvas_Macros.jinja' as macros %}
#pragma once
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// This code was produced with AzAutoGen, any modifications made will not be preserved.
// If you need to modify this code see:
//
// Gems\ScriptCanvas\Code\Include\ScriptCanvas\AutoGen\ScriptCanvasNode_Header.jinja
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include <ScriptCanvas/Core/Datum.h>
#include <ScriptCanvas/Core/Node.h>
{% for xml in dataFiles %}
{% for Class in xml.iter('Class') %}
{# Any user-provided includes #}
{% for Include in Class.iter('Include') %}
#include <{{ Include.attrib['File'] }}>
{% endfor %}
{# Class Attributes #}
{# ----------------------------------------------------------------------------------------- #}
{% 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 %}
{% set className = Class.attrib['Name'] %}
{% set baseClasses = ", ".join(Class.attrib['Base'].split(';')) if Class.attrib['Base'] is string else "ScriptCanvas::Node" %}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
////
//// {{ className }}
////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
{% set classUuid = Class.attrib['Uuid'] %}
{% if classUuid is not defined %}
{% set classUuid = className|createHashGuid %}
{% endif %}
{% set deprecationUuid = Class.attrib['DeprecationUUID'] %}
// The following will be injected directly into the source header file for which AZ AutoGen is being run.
// You must #include the generated header into the source header
#define SCRIPTCANVAS_NODE_{{ className }} \
public: \
AZ_COMPONENT({{ className }}, "{{ classUuid }}", {{ baseClasses }} ); \
static void Reflect(AZ::ReflectContext* reflection); \
void ConfigureSlots() override; \
bool RequiresDynamicSlotOrdering() const override; \
bool IsDeprecated() const override; \
{% if deprecationUuid is defined %} ScriptCanvas::NodeConfiguration GetReplacementNodeConfiguration() const override; \
{% endif %}
using Node::FindDatum; \
{% if Class.attrib['GraphEntryPoint'] is defined %} bool IsEntryPoint() const override { return {%if Class.attrib['GraphEntryPoint'] == "True" %}true{%else%}false{%endif%}; } \
{% endif %}
public: \
friend struct {% if attribute_Namespace is not defined %}::{% endif %}{{ className | replace(' ','') }}Property;
// Helpers for easily accessing properties and slots
struct {{ className | replace(' ','') }}Property
{
{% for Property in Class.iter('Out') %}
{% if Property.attrib['Description'] is defined %} // {{ Property.attrib['Description'] }}{% endif %}
static ScriptCanvas::SlotId Get{{ Property.attrib['Name'] | replace(' ','') }}SlotId(const ScriptCanvas::Node* owner)
{
return owner->GetSlotId("{{ Property.attrib['Name'] }}");
}
static ScriptCanvas::Slot* Get{{ Property.attrib['Name'] | replace(' ','') }}Slot(const ScriptCanvas::Node* owner)
{
return owner->GetSlot(Get{{ Property.attrib['Name'] | replace(' ','') }}SlotId(owner));
}
{% endfor %}
{% for Property in Class.iter('OutLatent') %}
{% if Property.attrib['Description'] is defined %} // {{ Property.attrib['Description'] }}{% endif %}
static ScriptCanvas::SlotId Get{{ Property.attrib['Name'] | replace(' ','') }}SlotId(const ScriptCanvas::Node* owner)
{
return owner->GetSlotId("{{ Property.attrib['Name'] }}");
}
static ScriptCanvas::Slot* Get{{ Property.attrib['Name'] | replace(' ','') }}Slot(const ScriptCanvas::Node* owner)
{
return owner->GetSlot(Get{{ Property.attrib['Name'] | replace(' ','') }}SlotId(owner));
}
{% endfor %}
{% for Property in Class.iter('In') %}
{% if Property.attrib['Description'] is defined %} // {{ Property.attrib['Description'] }}{% endif %}
static ScriptCanvas::SlotId Get{{ Property.attrib['Name'] | replace(' ','') }}SlotId(const ScriptCanvas::Node* owner)
{
return owner->GetSlotId("{{ Property.attrib['Name'] }}");
}
static ScriptCanvas::Slot* Get{{ Property.attrib['Name'] | replace(' ','') }}Slot(const ScriptCanvas::Node* owner)
{
return owner->GetSlot(Get{{ Property.attrib['Name'] | replace(' ','') }}SlotId(owner));
}
{% endfor %}
{% for Property in Class.iter('Property') %}
{% if Property.attrib['Description'] is defined %} // {{ Property.attrib['Description'] }}{% endif %}
static ScriptCanvas::SlotId Get{{ Property.attrib['Name'] | replace(' ','') }}SlotId(const ScriptCanvas::Node* owner)
{
return owner->GetSlotId("{{ Property.attrib['Name'] }}");
}
static ScriptCanvas::Slot* Get{{ Property.attrib['Name'] | replace(' ','') }}Slot(const ScriptCanvas::Node* owner)
{
return owner->GetSlot(Get{{ Property.attrib['Name'] | replace(' ','') }}SlotId(owner));
}
static {{ Property.attrib['Type'] }} Get{{ Property.attrib['Name'] | replace(' ','') }}(ScriptCanvas::Node* owner);
{% endfor %}
{% for Property in Class.iter('DynamicDataSlot') %}
{% if Property.attrib['Description'] is defined %} // {{ Property.attrib['Description'] }}{% endif %}
static ScriptCanvas::SlotId Get{{ Property.attrib['Name'] }}SlotId(const ScriptCanvas::Node* owner)
{
return owner->GetSlotId("{{ Property.attrib['Name'] }}");
}
static ScriptCanvas::Slot* Get{{ Property.attrib['Name'] }}Slot(const ScriptCanvas::Node* owner)
{
return owner->GetSlot(Get{{ Property.attrib['Name'] }}SlotId(owner));
}
{% endfor %}
};
{% if attribute_Namespace is defined %}
}
{% endif %}
{{ macros.ReportErrors() }}
{% endfor %}
{% endfor %}