26namespace shamrock::solvergraph {
29 class GetFieldRefFromLayer :
public INode {
34 GetFieldRefFromLayer(
u32 field_idx) : field_idx(field_idx) {}
38 : GetFieldRefFromLayer(layout.
get_field_idx<T>(field_name)) {}
41 const std::shared_ptr<shamrock::patch::PatchDataLayerLayout> &layout,
42 const std::string &field_name)
51 std::shared_ptr<IPatchDataLayerRefs> source,
64 auto edges = get_edges();
66 edges.out_ref.set_refs(
67 edges.source.get_const_refs()
70 return std::ref(pdat.get_field<T>(field_idx));
Defines the PatchDataLayerRefs class for managing distributed references to patch data layers.
std::uint32_t u32
32 bit unsigned integer
std::uint64_t u64
64 bit unsigned integer
u32 get_field_idx(const std::string &field_name) const
Get the field id if matching name & type.
PatchDataLayer container class, the layout is described in patchdata_layout.
std::string _impl_get_label() const
get the label of the node
void _impl_evaluate_internal()
evaluate the node
std::string _impl_get_tex() const
get the tex of the node
T & get_rw_edge(int slot)
Get a read write edge and cast it to the type T.
void __internal_set_rw_edges(std::vector< std::shared_ptr< IEdge > > new_rw_edges)
Set the read write edges.
void __internal_set_ro_edges(std::vector< std::shared_ptr< IEdge > > new_ro_edges)
Set the read only edges.
const T & get_ro_edge(int slot)
Get a read only edge and cast it to the type T.
T & get_check_ref(const std::unique_ptr< T > &ptr, SourceLocation loc=SourceLocation())
Takes a std::unique_ptr and returns a reference to the object it holds. It throws a std::runtime_erro...