01-05-2024 08:44 AM
I use GOOP a lot and at the moment I am trying to write a automatic serialiser. To accomplish this I am trying to run the _GetAttribute.vi as a call by reference but as the terminal for the class will vary depending on the caller I need to use invoke run, where the VI reference is opened using the path.
This works fine when the _GetAttributes.vi isn't placed on the block diagram, but when it is I get error 1000 out of the invoke node.
Is there any work around for this or am I taking the wrong approach?
I've attached a simplified and the actual project I'm using.
OpenG required for actual project and run the tester vi in the child class
01-05-2024 09:43 AM
Hi Jashcroft,
I once wanted to do that and stumbled upon the same problems.
Some suggestions:
- Make "<class>_GetAttributes.vi" reentrant;
- Create a reentrant wrapper method for "<class>_GetAttributes.vi", which you can call dynamically;
- Create a dynamic dispatch method "Serialize.vi" method for each class, which will contain the serialization code and output a string.
However it implies modifying all your classes, thus making the idea of an "automatic serializer" lose a bit of its interest.
Alternatively you could look into creating your own GOOP class template, e.g. "Serializable_Simple_4x4x4" or "Serializable_Singleton_4x4x4".
See this discussion for more infos.
Regards,
Raphaël.