- Notifications
You must be signed in to change notification settings - Fork3
[Functionality] Reduce Custom generator scope to a Single stage generator#227
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
19 commits Select commitHold shift + click to select a range
346925c Added Comparator for custom_generator
coder1373b1d63e Updated CreateTaskRunner and TaskRunner APIs
coder1372395186 Added GroupRunner
coder13783fab19 Removed dependency_cb
coder137da0ef69 Update gcovr.cmake
coder1379352f01 Update test_custom_generator.cpp
coder13733a1111 Removed groups from Custom Generator
coder137240881e Removed ungrouped ids from custom generator
coder13719ce132 Updated comparator variable names
coder137950d840 Added IsChanged function to Comparator
coder137fa20529 Added a ConvertToInternal function for UserCustomGeneratorSchema
coder1376d03060 Removed groups from custom_generator_schema
coder1372bfff72 Shifted classes to seperate include files
coder1370156aec Update custom_generator.cpp
coder137a0316aa Pass blob_handler shared_ptr by ref
coder137fdc7849 Update custom_generator.h
coder1376a0e493 Update cppcheck.cmake
coder137a4a52b2 Updated tests for custom_generator
coder13703061bd Updated custom_generator blob_handler implementation
coder137File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
3 changes: 3 additions & 0 deletionsbuildcc/lib/target/cmake/common_target_src.cmake
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
240 changes: 118 additions & 122 deletionsbuildcc/lib/target/include/target/custom_generator.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletionsbuildcc/lib/target/include/target/custom_generator/custom_blob_handler.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| /* | ||
| * Copyright 2021-2022 Niket Naidu. All rights reserved. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| #ifndef TARGET_CUSTOM_GENERATOR_CUSTOM_BLOB_HANDLER_H_ | ||
| #define TARGET_CUSTOM_GENERATOR_CUSTOM_BLOB_HANDLER_H_ | ||
| #include <vector> | ||
| #include "env/assert_fatal.h" | ||
| namespace buildcc { | ||
| class CustomBlobHandler { | ||
| public: | ||
| CustomBlobHandler() = default; | ||
| virtual ~CustomBlobHandler() = default; | ||
| bool CheckChanged(const std::vector<uint8_t> &previous, | ||
| const std::vector<uint8_t> ¤t) const { | ||
| env::assert_fatal( | ||
| Verify(previous), | ||
| "Stored blob is corrupted or User verification is incorrect"); | ||
| env::assert_fatal( | ||
| Verify(current), | ||
| "Current blob is corrupted or User verification is incorrect"); | ||
| return !IsEqual(previous, current); | ||
| }; | ||
| std::vector<uint8_t> GetSerializedData() const { | ||
| auto serialized_data = Serialize(); | ||
| env::assert_fatal( | ||
| Verify(serialized_data), | ||
| "Serialized data is corrupted or Serialize function is incorrect"); | ||
| return serialized_data; | ||
| } | ||
| private: | ||
| virtual bool Verify(const std::vector<uint8_t> &serialized_data) const = 0; | ||
| virtual bool IsEqual(const std::vector<uint8_t> &previous, | ||
| const std::vector<uint8_t> ¤t) const = 0; | ||
| virtual std::vector<uint8_t> Serialize() const = 0; | ||
| }; | ||
| } // namespace buildcc | ||
| #endif |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.