KDSoap icon indicating copy to clipboard operation
KDSoap copied to clipboard

Polymorphic helper function

Open ryanenzo opened this issue 5 years ago • 1 comments

Polymorphic data members have a "{member}_as_kdsoap_value()" function, which lets you get the raw KDSoapValue that was received. If it was actually a derived type, you have to deserialize it yourself.

I propose automatically adding a helper function for each polymorphic data member, that looks like:

template<class T> T dataMemberDeserializedAs() const { T t; t.deserialize(dataMember_as_kdsoap_value()); return t; }

I would have implemented this myself. However, I'm couldn't see how to create template functions using libKODE.

ryanenzo avatar Mar 15 '19 11:03 ryanenzo

libkode can be extended ;-)

BTW libkode upstream is https://github.com/cornelius/kode but unfortunately there are a number of commits on each side that didn't get merged into the other, so they have diverged quite a bit over time.

If you don't want to get into that, let's say I take care of syncing the two libkodes, and you can implement this in kdsoap's copy (without being blocked by the syncing).

dfaure-kdab avatar Mar 15 '19 15:03 dfaure-kdab