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

(VolPkg) Add support for transform paths #94

Merged
merged 8 commits into from
Aug 8, 2024
Merged

(VolPkg) Add support for transform paths #94

merged 8 commits into from
Aug 8, 2024

Conversation

csparker247
Copy link
Member

@csparker247 csparker247 commented Aug 7, 2024

This builds off of the transform functionality added in #67 and #69 to make working with transforms a little more automatic.

First, the single argument VolumePkg::transform(id) and VolumePkg::hasTransform(id) functions now support constructing a composite transform using the -> operator in the id string. The inverse * operator is still fully supported. The following will return a composite transform containing the three identified transforms with inversion already applied to the final transform:

auto tfm = vpkg.transform("20240808111644->20240808111647->20240808111648*");

Second, the two argument VolumePkg::transform(src, tgt) function now additionally searches for multi-transform paths between the source and target volumes. Single-transform paths (what the previous implementation returned) are returned as their original transform type. Multi-transform paths are returned as a new, unsimplified CompositeTransform. Paths are returned in order of increasing length and may incorporate inverse transforms which help satisfy the mapping. The returned identifiers follow the form used by the new VolumePkg::transform(id) implementation:

auto paths = vpkg.transform("a", "d");
std::cout << "paths:\n";
for(auto [id, tfm] : paths) {
    std::cout << " - " << id << "\n";
}
/*
paths:
 - 20240808111644                                  // single-transform
 - 20240808111645*                                 // single-transform (inverted)
 - 20240808111646->20240808111647->20240808111648  // multi-transform path
*/

Other changes

  • VolumePkg: Add transform tests
  • CompositeTransform: Add push_front member
  • CompositeTransform: Fix bug when pushing a CompositeTransform
  • core: Add libcore to include interface
  • core: General clang-tidy fixes

@csparker247 csparker247 changed the title Construct composite transforms (VolPkg) Add support for transform paths Aug 8, 2024
@csparker247 csparker247 marked this pull request as ready for review August 8, 2024 16:11
@csparker247 csparker247 merged commit 50ee1c6 into develop Aug 8, 2024
4 checks passed
@csparker247 csparker247 deleted the tfm-chain branch August 8, 2024 16:59
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.

1 participant