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

XML deserialize checks for unnecessary stream operators #4589

Open
chaosct opened this issue Nov 16, 2015 · 1 comment
Open

XML deserialize checks for unnecessary stream operators #4589

chaosct opened this issue Nov 16, 2015 · 1 comment

Comments

@chaosct
Copy link
Contributor

chaosct commented Nov 16, 2015

In order to deserialize an ofParameter, ofParameter::isSerializable() must be true. This method checks both for serializable flag and existence of stream operators (<<, >>).

However when deserializing an ofParameter, only ofParameter::fromString() is used. I use to implement fromString() for my custom ofParameter's in OF < 0.9.0, but now a dummy implementation of the stream operators must be defined to allow deserialization, which is kind of dangerous (who knows if other parts of ofParameter end using stream operators for something).

I suspect this happens also on serialization.

@arturoc
Copy link
Member

arturoc commented Nov 21, 2015

serializable is an opt out flag for serialization, it doesn't mean that the parameter or the type 'can' be serialized but if it 'should'

then there's the check to see if a type can be serialized by using the stream operator with a stream which i think is not ambiguous (the underlying type still can implement the stream operator with other types).

we implement the stream operators across all types in OF that we want to be able to be serialized and not any form of method that way those types can be directly sent to a text file...

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

No branches or pull requests

2 participants