-
Notifications
You must be signed in to change notification settings - Fork 1.4k
(De)Serialization clean up of temporary workarounds #3971
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
Conversation
…ackwards compat hacks. Updated some uses of the legacy functions that were missed originally.
… should be inherited now
…from SerializeStatus
|
@vincewoo I don't want the functions deprecated yet. Can we just remove the temporary variables? Next release we will DEPRECATE and then remote the release after that. |
Yes, I can do that! |
|
|
||
| SerializeStatus ComPacket::serializeBase(SerializeBufferBase& buffer) const { | ||
| return buffer.serialize(static_cast<FwPacketDescriptorType>(this->m_type)); | ||
| return buffer.serializeFrom(static_cast<FwPacketDescriptorType>(this->m_type)); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| SerializeStatus ComPacket::deserializeBase(SerializeBufferBase& buffer) { | ||
| FwPacketDescriptorType serVal; | ||
| SerializeStatus stat = buffer.deserialize(serVal); | ||
| SerializeStatus stat = buffer.deserializeTo(serVal); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| // get type | ||
| FwEnumStoreType des; | ||
| SerializeStatus stat = buffer.deserialize(des); | ||
| SerializeStatus stat = buffer.deserializeTo(des); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| return this->serializeTo(buffer, maxLength); | ||
| // Deprecated method for backward compatibility | ||
| SerializeStatus StringBase::serialize(SerializeBufferBase& buffer) const { | ||
| return this->serializeTo(buffer); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| return this->deserializeFrom(buffer); | ||
| // Deprecated method for backward compatibility | ||
| SerializeStatus StringBase::serialize(SerializeBufferBase& buffer, SizeType maxLength) const { | ||
| return this->serializeTo(buffer, maxLength); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| return this->deserializeFrom(buffer); | ||
| // Deprecated method for backward compatibility | ||
| SerializeStatus StringBase::serialize(SerializeBufferBase& buffer, SizeType maxLength) const { | ||
| return this->serializeTo(buffer, maxLength); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| status = this->m_val.serialize(buffer); | ||
| } | ||
| return status; | ||
| return this->m_val.serializeTo(buffer); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
|
|
||
| SerializeStatus Time::deserialize(SerializeBufferBase& buffer) { | ||
| return this->deserializeFrom(buffer); | ||
| return this->m_val.deserializeFrom(buffer); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
|
|
||
| // id | ||
| SerializeStatus stat = this->m_tlmBuffer.serialize(id); | ||
| SerializeStatus stat = this->m_tlmBuffer.serializeFrom(id); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
|
|
||
| // time tag | ||
| stat = this->m_tlmBuffer.serialize(timeTag); | ||
| stat = this->m_tlmBuffer.serializeFrom(timeTag); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
|
|
||
| // id | ||
| SerializeStatus stat = this->m_tlmBuffer.deserialize(id); | ||
| SerializeStatus stat = this->m_tlmBuffer.deserializeTo(id); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
|
|
||
| // time tag | ||
| stat = this->m_tlmBuffer.deserialize(timeTag); | ||
| stat = this->m_tlmBuffer.deserializeTo(timeTag); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
|
|
||
| // telemetry buffer | ||
| stat = this->m_tlmBuffer.deserialize(buffer.getBuffAddr(), bufferSize, Fw::Serialization::OMIT_LENGTH); | ||
| stat = this->m_tlmBuffer.deserializeTo(buffer.getBuffAddr(), bufferSize, Fw::Serialization::OMIT_LENGTH); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
|
|
||
| // telemetry buffer | ||
| stat = this->m_tlmBuffer.deserialize(buffer.getBuffAddr(), bufferSize, Fw::Serialization::OMIT_LENGTH); | ||
| stat = this->m_tlmBuffer.deserializeTo(buffer.getBuffAddr(), bufferSize, Fw::Serialization::OMIT_LENGTH); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| SerializeStatus TlmPacket::serializeTo(SerializeBufferBase& buffer) const { | ||
| // serialize the number of packets | ||
| SerializeStatus stat = buffer.serialize(this->m_numEntries); | ||
| SerializeStatus stat = buffer.serializeFrom(this->m_numEntries); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| SerializeStatus TlmPacket::deserializeFrom(SerializeBufferBase& buffer) { | ||
| // deserialize the number of packets | ||
| SerializeStatus stat = buffer.deserialize(this->m_numEntries); | ||
| SerializeStatus stat = buffer.deserializeTo(this->m_numEntries); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
|
@thomas-bc Note that this PR is deleting all the serialize/deserialize methods from the child classes so they inherit properly from the parent now. This makes it easier for use to later deprecate as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fprime/Fw/Types/Serializable.hpp
Lines 39 to 41 in fe88650
| virtual SerializeStatus serialize(SerializeBufferBase& buffer) const; | |
| virtual SerializeStatus deserialize(SerializeBufferBase& buffer); |
I see serialize/deserialize are still virtual, we may not want this since they should not be overridden. Maybe making them inline in the header is better?
| // ---------------------------------------------------------------------- | ||
|
|
||
| virtual SerializeStatus serialize(SerializeBufferBase& buffer) const; | ||
| SerializeStatus serialize(SerializeBufferBase& buffer) const { return this->serializeTo(buffer); } |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| virtual SerializeStatus serialize(SerializeBufferBase& buffer) const; | ||
| SerializeStatus serialize(SerializeBufferBase& buffer) const { return this->serializeTo(buffer); } | ||
|
|
||
| SerializeStatus deserialize(SerializeBufferBase& buffer) { return this->deserializeFrom(buffer); } |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| // ---------------------------------------------------------------------- | ||
|
|
||
| virtual SerializeStatus serialize(SerializeBufferBase& buffer) const; | ||
| SerializeStatus serialize(SerializeBufferBase& buffer) const { return this->serializeTo(buffer); } |
Check notice
Code scanning / CodeQL
More than one statement per line Note
| virtual SerializeStatus serialize(SerializeBufferBase& buffer) const; | ||
| SerializeStatus serialize(SerializeBufferBase& buffer) const { return this->serializeTo(buffer); } | ||
|
|
||
| SerializeStatus deserialize(SerializeBufferBase& buffer) { return this->deserializeFrom(buffer); } |
Check notice
Code scanning / CodeQL
More than one statement per line Note
…Inherit from parent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the virtual on serialize/deserialize has been addressed, looks great! Thanks for the fast turnaround on this!
|
Looks good, I just had a few questions/comments. @LeStarch @thomas-bc can we remove the Deferred to Next Release label from this PR? I think it is close, and it's important for the release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
|
Got verbal buy off from @thomas-bc and @bocchino . Good to merge. |
Change Description
This change continues the effort for #3781. The FPP change has been completed to be compatible with the new serialization methods. This PR removes the temporary workarounds introduced by #3880 that we had in place to decouple with FPP.
Rationale
Cleaning up the temporary workarounds left that we had in place to decouple the necessary FPP upgrade completed by nasa/fpp#763.
Testing/Review Recommendations
No new UTs were added as part of this change. Existing were updated where necessary and re-run for regression.
Future Work
We still need to mark the legacy
serializeanddeserializemethods ofFw::SerializableandFw::SerializeBufferBaseas DEPRECATED.