Skip to content

Generic fields backed by ITrinityStruct/IAccessor #24

Open
@yatli

Description

@yatli

This could be very useful for implementing generic algorithms on different cell types.
Take this example:

struct E
{
    [GraphEdge]
    cellid neighbor;
    [GraphEdgeWeight]
    double weight;
}

cell V
{
    [CompositeEdge]
    List<E> edges;
}

Currently ICell.GetField<T> only accepts non-generic types, so user-defined composite edge types are not possible. If we implement a generic field, we can then write ICell.EnumerateValues<IField>("CompositeEdge") without worrying about the type. Then, an algorithm can proceed and inspect [GraphEdge] and [GraphEdgeWeight] from the generic field respectedly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions