32 template <
typename BaseType,
typename Wrapped>
36 using Wrapped::Wrapped;
40 if (base.
GetType() == LayerEnumOf<BaseType>())
42 Wrapped::Run(graph, *PolymorphicDowncast<BaseType*>(&base));
51 template <
typename Wrapped>
55 using Wrapped::Wrapped;
59 Wrapped::Run(graph, base);
66 template <
typename BaseType,
typename Wrapped>
78 template <
typename BaseType,
typename ChildType,
typename Wrapped>
82 using Wrapped::Wrapped;
86 for (
auto output = base.BeginOutputSlots(); output != base.EndOutputSlots(); ++output)
88 for (
auto&& childInput : output->GetConnections())
90 if (childInput->GetOwningLayer().GetType() == LayerEnumOf<ChildType>())
92 Wrapped::Run(graph, *childInput);
97 for (
unsigned int i = 0; i < output->GetNumConnections();)
99 Layer* child = &output->GetConnection(i)->GetOwningLayer();
117 template <
typename BaseType,
typename ChildType,
typename Wrapped>
119 :
public OptimizeForTypeImpl<BaseType, OptimizeForConnectionImpl<BaseType, ChildType, Wrapped>>
130 template <
typename BaseType,
typename ChildType,
typename Wrapped>
134 using Wrapped::Wrapped;
138 for (
auto output = base.BeginOutputSlots(); output != base.EndOutputSlots(); ++output)
140 if (output->GetNumConnections() == 1)
142 for (
auto&& childInput : output->GetConnections())
144 if (childInput->GetOwningLayer().GetType() == LayerEnumOf<ChildType>())
146 Wrapped::Run(graph, *childInput);
151 for (
unsigned int i = 0; i < output->GetNumConnections();)
153 Layer* child = &output->GetConnection(i)->GetOwningLayer();
172 template <
typename BaseType,
typename ChildType,
typename Wrapped>
174 :
public OptimizeForTypeImpl<BaseType, OptimizeForExclusiveConnectionImpl<BaseType, ChildType, Wrapped>>