snu-quiqcl / qiwis

QuIqcl Widget Integration Software
MIT License
5 stars 2 forks source link

Generalize swift call message protocol #142

Closed kangz12345 closed 1 year ago

kangz12345 commented 1 year ago

I refactored _handleSwiftcall() to accept more general method calls.

Summary:

  1. I introduced Serializable class to indicate the dataclasses that are able to converted to JSON strings. All the public methods should have parameters that are JSONifiable by itself or an instance of Serializable.
  2. _parseArgs() inspects the function signature of the public API methods, and converts arguments from JSON strings to concrete dataclass instances in the parameter type is Serializable.

However, I have not tested the actual behavior yet...

This closes #139.