My goal is to design an algorithm that can take any instance of a class from a big codebase, reduce it down to primitives or arrays of primitives (if needed), create opcua nodes for each object, and then write to those.
At the moment my algorithm takes an object, then recurses through the properties and fields of the object using reflection until it reaches primitives and arrays of primitives, then creates OPCUA nodes to represent those. This works fine for a simple class, for example a class having two int properties. But class A that has a property List of instances of class B, with class B having a property Dictionary<int, instance of class C> and class C having a property List<int[]> is a lot trickier.
Is there something built in OPCUA that can help me solve this? For example in this situation what would be the best solution? To reiterate I want to make an algorithm that can turn this into OPCUA nodes.
public class x
{
public List<int> obj1;
public List<y> obj2;
List<z> obj3;
}
public class y
{
int obj4;
int obj5;
}
public class z
{
int obj6;
int obj7;
List<int> obj8;
List<z2> obj9;
}
public class z2
{
Dictionary<string,int> obj10;
float obj11;
}