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

Refactor OriginalLabel class to remove inheritance from Blob #4309

Merged
merged 5 commits into from
Feb 23, 2021

Conversation

AustinSanders
Copy link
Contributor

Refactor OriginalLabel class to remove inheritance from Blob

Description

Refactor OriginalLabel to remove inheritance from Blob.

Related Issue

Motivation and Context

More clearly separates functionality so that we can move toward building pvl / blob / functionality independently.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation change (update to the documentation; no code change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read and agree to abide by the Code of Conduct
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have added myself to the .zenodo.json document.
  • I have added any user impacting changes to the CHANGELOG.md document.

Licensing

This project is mostly composed of free and unencumbered software released into the public domain, and we are unlikely to accept contributions that are not also released into the public domain. Somewhere near the top of each file should have these words:

This work is free and unencumbered software released into the public domain. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain.

  • I dedicate any and all copyright interest in this software to the public domain. I make this dedication for the benefit of the public at large and to the detriment of my heirs and successors. I intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

Copy link
Contributor

@jessemapel jessemapel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just two small comments really.

isis/src/base/objs/Cube/Cube.cpp Show resolved Hide resolved
isis/src/base/objs/OriginalLabel/OriginalLabel.cpp Outdated Show resolved Hide resolved
isis/src/galileo/apps/gllnims2isis/main.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@acpaquette acpaquette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few things to discuss but overall looks good!

isis/src/base/objs/OriginalLabel/OriginalLabel.cpp Outdated Show resolved Hide resolved
isis/src/base/objs/OriginalLabel/OriginalLabel.cpp Outdated Show resolved Hide resolved
Comment on lines +938 to +940
void Cube::write(OriginalLabel lab) {
write(*(lab.toBlob()));
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this write method makes things easier but I don't know how necessary it is and that's something I have been going back and forth on. It'd be good for us to figure out exactly how we want to be writing these blobs back out. While the *(lab.toBlob()) is a little messy I don't think it's bad to have write(*(lab.toBlob())) all over the place rather than write(lab)

@jessemapel
Copy link
Contributor

jessemapel commented Feb 23, 2021

For reading/writing these things, I think the purest thing to do is enforce File <-> Blob <-> Class. It requires a bit more code but it's straight forward.

Then, I start writing code and I just wish I had a direct read/write method that wrapped the File <-> Blob part.

I could see either way, but we should be consistent.

@jessemapel jessemapel merged commit 4e8cbcc into DOI-USGS:blob Feb 23, 2021
jessemapel added a commit that referenced this pull request Mar 9, 2021
* Updated to new blob structure

* Clean up after being able to look at all of the changes at once

* Changed the history read to return a history object rather than a pointer

* Addressed PR feedback

* Imagepolygon Update (#4308)

* Converted Imagepolygon to no longer be a subclass of blob

* Updated Imagepolygon with constructor chaining

* Fixed error message

* Refactor OriginalLabel class to remove inheritance from Blob (#4309)

* Initial refactor of OriginalLabel class

* Addressed PR feedback

* Fixed error message

Co-authored-by: Jesse Mapel <[email protected]>

* Modified Table to not inherit from Blob anymore (#4312)

* Ported Table test to gtest

* Table refactor

* Fixed merge issue

* Fixed merge issues

* Removes blob inheritance from OriginalXmlLabel (#4316)

* Initial refactor of OriginalLabel class

* Addressed PR feedback

* Fixed error message

* Remove blob inheritance from originalxmllabel

* Removed commented / old code

* Added byte order specification

* History object tests (#4314)

* Adds History object tests

* Updated blob tests to use a non-pointer variable

* Removed gisblob from isis (#4329)

* Removed blob inheritance from stretchblob (#4331)

* Removed blob inheritance from stretchblob

* Addressed feedback + working read/write

* Updated cubestretch with the stretch blob functionality

* Removed stretchBlob and updated cubestretch/cube with read write functionality

* Replaced readStretchBlob with readCubeStretch

* Fixed segfault

* Removed debug print statements

* Added check for existence of OriginalLabel before attempting to propagate

* Addressed PR feedback

Co-authored-by: Adam Paquette <[email protected]>

* Removed StringBlob Class (#4321)

* Converted StringBlob

* Removed StretchBlob class

* Changed Blob setData to copy

* Added csminit change and docs

* Removed old memcopy

* History Blob Old Implementation (#4342)

* Implemented old history functionality

* Removed old history unit test

* Fixed original label reading

* Fixed Blob branch test failures (#4344)

* Fixed test failures

* More clean-up

* Fixed marci2isis test

* Blob final clean-up (#4346)

* Redid Blob writing

* Added docs

* Review feedback

* Fixed int comparison

Co-authored-by: Adam Paquette <[email protected]>
Co-authored-by: AustinSanders <[email protected]>
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

Successfully merging this pull request may close these issues.

3 participants