Removes NodeableOutNative.h from Gems/ScriptCanvas
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
@@ -78,26 +78,6 @@ namespace ScriptCanvas
|
||||
return output;
|
||||
}
|
||||
|
||||
template<typename... t_Args, AZStd::size_t... Is>
|
||||
Out CreateOutHelper(const AZStd::string& name, const AZStd::vector<AZStd::string>& outputNames, AZStd::index_sequence<Is...>)
|
||||
{
|
||||
Out out;
|
||||
SetDisplayAndParsedName(out, name);
|
||||
out.outputs.reserve(sizeof...(Is));
|
||||
|
||||
int dummy[]{ 0, (out.outputs.emplace_back(CreateOutput<t_Args>(outputNames[Is])), 0)... };
|
||||
static_cast<void>(dummy); /* avoid warning for unused variable */
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
template<typename... t_Args>
|
||||
Out CreateOut(const AZStd::string& name, const AZStd::vector<AZStd::string>& outputNames = {})
|
||||
{
|
||||
return CreateOutHelper<t_Args...>(name, outputNames, AZStd::make_index_sequence<sizeof...(t_Args)>());
|
||||
}
|
||||
|
||||
|
||||
template<typename t_Return, typename... t_Args, AZStd::size_t... Is>
|
||||
Out CreateOutReturnHelper(const AZStd::string& name, const AZStd::string& returnName, const AZStd::vector<AZStd::string>& outputNames, AZStd::index_sequence<Is...>)
|
||||
{
|
||||
|
||||
-1
@@ -17,7 +17,6 @@
|
||||
#include <ScriptCanvas/Core/NodeableOut.h>
|
||||
#include <ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.h>
|
||||
#include <ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedUtility.h>
|
||||
#include <ScriptCanvas/Execution/NodeableOut/NodeableOutNative.h>
|
||||
#include <ScriptCanvas/Grammar/PrimitivesDeclarations.h>
|
||||
#include <ScriptCanvas/Libraries/Math/MathNodeUtilities.h>
|
||||
#include <ScriptCanvas/Utils/BehaviorContextUtils.h>
|
||||
|
||||
-1
@@ -16,7 +16,6 @@
|
||||
#include <ScriptCanvas/Core/NodeableOut.h>
|
||||
#include <ScriptCanvas/Execution/ExecutionState.h>
|
||||
#include <ScriptCanvas/Execution/ExecutionObjectCloning.h>
|
||||
#include <ScriptCanvas/Execution/NodeableOut/NodeableOutNative.h>
|
||||
#include <ScriptCanvas/Grammar/PrimitivesDeclarations.h>
|
||||
#include <ScriptCanvas/Libraries/Math/MathNodeUtilities.h>
|
||||
#include <ScriptCanvas/Utils/BehaviorContextUtils.h>
|
||||
|
||||
-1
@@ -18,7 +18,6 @@
|
||||
#include <ScriptCanvas/Core/NodeableOut.h>
|
||||
#include <ScriptCanvas/Execution/ExecutionState.h>
|
||||
#include <ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.h>
|
||||
#include <ScriptCanvas/Execution/NodeableOut/NodeableOutNative.h>
|
||||
#include <ScriptCanvas/Grammar/PrimitivesDeclarations.h>
|
||||
|
||||
#include "ExecutionInterpretedOut.h"
|
||||
|
||||
-1
@@ -17,7 +17,6 @@
|
||||
#include <ScriptCanvas/Core/Nodeable.h>
|
||||
#include <ScriptCanvas/Core/NodeableOut.h>
|
||||
#include <ScriptCanvas/Execution/ExecutionState.h>
|
||||
#include <ScriptCanvas/Execution/NodeableOut/NodeableOutNative.h>
|
||||
#include <ScriptCanvas/Grammar/PrimitivesDeclarations.h>
|
||||
|
||||
#include "ExecutionInterpretedAPI.h"
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/std/allocator.h>
|
||||
#include <AzCore/std/allocator_static.h>
|
||||
#include <AzCore/std/typetraits/internal/type_sequence_traits.h>
|
||||
|
||||
#include <ScriptCanvas/Core/NodeableOut.h>
|
||||
|
||||
namespace ScriptCanvas
|
||||
{
|
||||
namespace Execution
|
||||
{
|
||||
template<typename Callable, typename Allocator, typename... Args, size_t... IndexSequence>
|
||||
FunctorOut CreateOutWithArgs(Callable&& callable, Allocator& allocator, AZStd::Internal::pack_traits_arg_sequence<Args...>, std::index_sequence<IndexSequence...>, ReturnTypeIsNotVoid)
|
||||
{
|
||||
auto nodeCallWrapper = [callable = AZStd::forward<Callable>(callable)](AZ::BehaviorValueParameter* result, AZ::BehaviorValueParameter* arguments, int numArguments) mutable
|
||||
{
|
||||
[[maybe_unused]] constexpr size_t numFunctorArguments = sizeof...(Args);
|
||||
(void)numArguments;
|
||||
AZ_Assert(numArguments == numFunctorArguments, "number of arguments doesn't match number of parameters");
|
||||
AZ_Assert(result, "no null result allowed");
|
||||
result->StoreResult(AZStd::invoke(callable, *arguments[IndexSequence].GetAsUnsafe<Args>()...));
|
||||
};
|
||||
|
||||
static_assert(!AZStd::is_same_v<Allocator, StackAllocatorType> || sizeof(nodeCallWrapper) <= MaxNodeableOutStackSize, "Lambda is too large to fit within NodebleOut functor");
|
||||
return FunctorOut(AZStd::move(nodeCallWrapper), allocator);
|
||||
}
|
||||
|
||||
template<typename Callable, typename Allocator, typename... Args, size_t... IndexSequence>
|
||||
FunctorOut CreateOutWithArgs(Callable&& callable, Allocator& allocator, AZStd::Internal::pack_traits_arg_sequence<Args...>, std::index_sequence<IndexSequence...>, ReturnTypeIsVoid)
|
||||
{
|
||||
auto nodeCallWrapper = [callable = AZStd::forward<Callable>(callable)](AZ::BehaviorValueParameter*, AZ::BehaviorValueParameter* arguments, int numArguments) mutable
|
||||
{
|
||||
[[maybe_unused]] constexpr size_t numFunctorArguments = sizeof...(Args);
|
||||
(void)numArguments;
|
||||
AZ_Assert(numArguments == numFunctorArguments, "number of arguments doesn't match number of parameters");
|
||||
AZStd::invoke(callable, *arguments[IndexSequence].GetAsUnsafe<Args>()...);
|
||||
};
|
||||
|
||||
static_assert(!AZStd::is_same_v<Allocator, StackAllocatorType> || sizeof(nodeCallWrapper) <= MaxNodeableOutStackSize, "Lambda is too large to fit within NodebleOut functor");
|
||||
return FunctorOut(AZStd::move(nodeCallWrapper), allocator);
|
||||
}
|
||||
|
||||
template<typename Callable, typename Allocator>
|
||||
FunctorOut CreateOut(Callable&& callable, Allocator& allocator)
|
||||
{
|
||||
using CallableTraits = AZStd::function_traits<AZStd::remove_cvref_t<Callable>>;
|
||||
return CreateOutWithArgs
|
||||
( AZStd::forward<Callable&&>(callable)
|
||||
, allocator
|
||||
, typename CallableTraits::arg_types{}
|
||||
, typename CallableTraits::template expand_args<std::index_sequence_for>{}
|
||||
, typename AZStd::is_void<typename CallableTraits::return_type>::type{});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user