Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic fields backed by ITrinityStruct/IAccessor #24

Open
yatli opened this issue Feb 25, 2017 · 1 comment
Open

Generic fields backed by ITrinityStruct/IAccessor #24

yatli opened this issue Feb 25, 2017 · 1 comment
Milestone

Comments

@yatli
Copy link

yatli commented Feb 25, 2017

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.

@yatli yatli added this to the Future milestone Mar 1, 2017
@TaviTruman
Copy link
Contributor

TaviTruman commented Mar 19, 2017

@yatli I just saw this and yeah this would be a most excellent addition and suits my needs well. Right now I have all of this type of generic typing and graph exploration in code I hand write against the GE generated code. What do we need to do to get started on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants