diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index f90f61f3..2ae4c0c9 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -140,23 +140,40 @@ jobs: run: cmake --preset ${{matrix.preset}} - name: CMake Build - run: cmake --build --preset ${{matrix.preset}} + run: cmake --build --preset ${{matrix.preset}} - # - name: CMake Test - # id: cmake-test - # run: ctest --test-dir ./out/build/${{matrix.preset}}/OdbDesignTests --output-log ${{github.workspace}}/testlog.txt --output-junit ${{github.workspace}}/testlog.xml -V - # # let the report step fail the job if it finds failed tests - # continue-on-error: true + - name: Checkout OdbDesign Test Data Repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + repository: 'nam20485/OdbDesignTestData' + path: 'OdbDesignTestData' + ref: 'main' + token: ${{ secrets.ODBDESIGN_TESTDATA_ACCESS_TOKEN }} + + - name : Export ODB_TEST_DATA_DIR + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + with: + script: core.exportVariable('ODB_TEST_DATA_DIR', "${{github.workspace}}/OdbDesignTestData/TEST_DATA" || ''); - # # report test results - # - name: Report Test Results - # uses: dorny/test-reporter@v1.7.0 - # if: ${{steps.cmake-test.outcome}} == 'success' || ${{steps.cmake-test.outcome}} == 'failure' - # with: - # name: ${{ matrix.os }}_test-results - # path: ${{github.workspace}}/testlog.xml - # reporter: java-junit - # fail-on-error: true + - name: CMake Test + id: cmake-test + env: + ODB_TEST_DATA_DIR: ${{github.workspace}}/OdbDesignTestData/TEST_DATA + run: ctest --test-dir ./out/build/${{matrix.preset}}/OdbDesignTests --output-log ${{github.workspace}}/testlog.txt --output-junit ${{github.workspace}}/testlog.xml --output-on-failure + # let the report step fail the job if it finds failed tests... + continue-on-error: true + + # report test results + - name: Report Test Results + uses: dorny/test-reporter@v1.7.0 + if: steps.cmake-test.outcome == 'success' || steps.cmake-test.outcome == 'failure' + with: + name: ${{ matrix.os }}_test-results + path: ${{github.workspace}}/testlog.xml + reporter: java-junit + path-replace-backslashes: true + # fail job based on report results + fail-on-error: true # # Artifacts @@ -190,7 +207,7 @@ jobs: Compress-Archive -Path "${{env.ARTIFACTS_DIR_WIN}}\*.dll","${{env.ARTIFACTS_DIR_WIN}}\*.exe" -DestinationPath "${{env.ARTIFACTS_DIR_WIN}}\artifacts-${{matrix.os}}.zip" -Verbose -Force - name: Upload Artifacts - uses: actions/upload-artifact@1eb3cb2b3e0f29609092a73eb033bb759a334595 # v4.1.0 + uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0 with: name: ${{ matrix.os }}-artifacts path: ${{ env.ARTIFACTS_DIR }}/artifacts-${{matrix.os}}.zip diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index e4622d47..6966cd7a 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -47,7 +47,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@e5f05b81d5b6ff8cfa111c80c22c5fd02a384118 # v3.23.0 + uses: github/codeql-action/init@0b21cf2492b6b02c465a3e5d7c473717ad7721ba # v3.23.1 with: languages: ${{ matrix.language }} config-file: ${{ github.workspace }}/.github/codeql-config.yml @@ -78,6 +78,6 @@ jobs: run: cmake --build --preset linux-release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@e5f05b81d5b6ff8cfa111c80c22c5fd02a384118 # v3.23.0 + uses: github/codeql-action/analyze@0b21cf2492b6b02c465a3e5d7c473717ad7721ba # v3.23.1 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 523c7326..50f55be6 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -25,6 +25,6 @@ jobs: - name: 'Checkout Repository' uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: 'Dependency Review' - uses: actions/dependency-review-action@c74b580d73376b7750d3d2a50bfb8adc2c937507 # v3.1.5 + uses: actions/dependency-review-action@4901385134134e04cec5fbe5ddfe3b2c5bd5d976 # v4.0.0 with: comment-summary-in-pr: true diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index a3a31c58..69984159 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -41,14 +41,8 @@ jobs: - name: Add Problem Matchers uses: ammaraskar/gcc-problem-matcher@d1fed1fac9e94d30e23b5a82dba4e2963e71d2e7 # master - # # Install the cosign tool except on PR - # # https://github.com/sigstore/cosign-installer - # - name: Install cosign - # if: github.event_name != 'pull_request' - # uses: sigstore/cosign-installer@f3c664df7af409cb4873aa5068053ba9d61a57b6 #v2.6.0 - # # with: - # # cosign-release: 'v1.13.1' - + # Install the cosign tool except on PR + # https://github.com/sigstore/cosign-installer - name: cosign-installer if: github.event_name != 'pull_request' uses: sigstore/cosign-installer@9614fae9e5c5eddabb09f90a270fcb487c9f7149 # v3.3.0 @@ -103,9 +97,7 @@ jobs: # transparency data even for private images, pass --force to cosign below. # https://github.com/sigstore/cosign - name: Sign the published Docker image - if: ${{ github.event_name != 'pull_request' }} - env: - COSIGN_EXPERIMENTAL: "true" + if: ${{ github.event_name != 'pull_request' }} # This step uses the identity token to provision an ephemeral certificate # against the sigstore community Fulcio instance. run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign --yes {}@${{ steps.build-and-push.outputs.digest }} diff --git a/.github/workflows/docker-scout-scan.yml b/.github/workflows/docker-scout-scan.yml index 5c5fd544..b3252e1f 100644 --- a/.github/workflows/docker-scout-scan.yml +++ b/.github/workflows/docker-scout-scan.yml @@ -128,7 +128,7 @@ jobs: - name: Analyze for critical and high CVEs id: docker-scout-cves # if: ${{ github.event_name != 'pull_request_target' }} - uses: docker/scout-action@b7413c99043c2a9131c0fa39cedaece80f285788 # v1.2.2 + uses: docker/scout-action@42a6acc319ac229f86e12bfca3b83de09fb058be # v1.3.0 with: command: cves,recommendations image: ${{ steps.meta.outputs.tags }} @@ -138,14 +138,14 @@ jobs: - name: Upload SARIF result id: upload-sarif - uses: github/codeql-action/upload-sarif@e5f05b81d5b6ff8cfa111c80c22c5fd02a384118 # v3.23.0 + uses: github/codeql-action/upload-sarif@0b21cf2492b6b02c465a3e5d7c473717ad7721ba # v3.23.1 with: sarif_file: sarif.output.json - name: Docker Scout Compare to Latest id: docker-scout if: ${{ github.event_name == 'pull_request' }} - uses: docker/scout-action@b7413c99043c2a9131c0fa39cedaece80f285788 # v1.2.2 + uses: docker/scout-action@42a6acc319ac229f86e12bfca3b83de09fb058be # v1.3.0 with: command: compare image: ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index a66355a2..68f0a067 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -61,7 +61,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@1eb3cb2b3e0f29609092a73eb033bb759a334595 # v4.1.0 + uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0 with: name: SARIF file path: results.sarif @@ -69,6 +69,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@e5f05b81d5b6ff8cfa111c80c22c5fd02a384118 # v3.23.0 + uses: github/codeql-action/upload-sarif@0b21cf2492b6b02c465a3e5d7c473717ad7721ba # v3.23.1 with: sarif_file: results.sarif diff --git a/OdbDesignLib/App/BasicRequestAuthentication.cpp b/OdbDesignLib/App/BasicRequestAuthentication.cpp new file mode 100644 index 00000000..6e719cf5 --- /dev/null +++ b/OdbDesignLib/App/BasicRequestAuthentication.cpp @@ -0,0 +1,47 @@ +#include "BasicRequestAuthentication.h" +#include + +namespace Odb::Lib::App +{ + crow::response BasicRequestAuthentication::AuthenticateRequest(const crow::request& req) + { + const auto& authHeader = req.get_header_value("Authorization"); + if (authHeader.empty()) return crow::response(401, "Unauthorized"); + + auto authValue = authHeader.substr(6); + if (authValue.empty()) return crow::response(401, "Unauthorized"); + + auto authValueDecoded = crow::utility::base64decode(authValue, authValue.size()); + if (authValueDecoded.empty()) return crow::response(401, "Unauthorized"); + + auto seperatorPos = authValueDecoded.find(':'); + if (seperatorPos == std::string::npos) return crow::response(401, "Unauthorized"); + + auto username = authValueDecoded.substr(0, seperatorPos); + auto password = authValueDecoded.substr(seperatorPos + 1); + + //if (! VerifyCredentials(username, password)) return crow::response(403, "Invalid username or password"); + auto resp = VerifyCredentials(username, password); + return resp; + } + + crow::response BasicRequestAuthentication::VerifyCredentials(const std::string& username, const std::string& password) + { + // 500 - Internal Server Error + auto validUsername = std::getenv(USERNAME_ENV_NAME); + if (validUsername == nullptr) return crow::response(500, "Server failed retrieving credentials"); + + auto validPassword = std::getenv(PASSWORD_ENV_NAME); + if (validPassword == nullptr) return crow::response(500, "Server failed retrieving credentials"); + + // 403 - Forbidden + if (username != validUsername || + password != validPassword) + { + return crow::response(403, "Invalid username or password"); + } + + // 200 Authorized! + return crow::response(200, "Authorized"); + } +} \ No newline at end of file diff --git a/OdbDesignLib/App/BasicRequestAuthentication.h b/OdbDesignLib/App/BasicRequestAuthentication.h new file mode 100644 index 00000000..63f94d07 --- /dev/null +++ b/OdbDesignLib/App/BasicRequestAuthentication.h @@ -0,0 +1,26 @@ +#pragma once + +#include "IRequestAuthentication.h" +#include "../odbdesign_export.h" + +namespace Odb::Lib::App +{ + class ODBDESIGN_EXPORT BasicRequestAuthentication : public IRequestAuthentication + { + public: + //BasicRequestAuthentication() + //{ + //} + + // Inherited via IRequestAuthentication + crow::response AuthenticateRequest(const crow::request& req) override; + + private: + + crow::response VerifyCredentials(const std::string& username, const std::string& password); + + const inline static char USERNAME_ENV_NAME[] = "ODBDESIGN_SERVER_REQUEST_USERNAME"; + const inline static char PASSWORD_ENV_NAME[] = "ODBDESIGN_SERVER_REQUEST_PASSWORD"; + + }; +} diff --git a/OdbDesignLib/App/IOdbServerApp.h b/OdbDesignLib/App/IOdbServerApp.h index 2830dc06..79c1afa8 100644 --- a/OdbDesignLib/App/IOdbServerApp.h +++ b/OdbDesignLib/App/IOdbServerApp.h @@ -2,6 +2,7 @@ #include "IOdbApp.h" #include "../odbdesign_export.h" +#include "IRequestAuthentication.h" namespace Odb::Lib::App { @@ -11,6 +12,8 @@ namespace Odb::Lib::App virtual ~IOdbServerApp() {} virtual CrowApp& crow_app() = 0; + virtual IRequestAuthentication& request_auth() = 0; + virtual void request_auth(std::unique_ptr requestAuthentication) = 0; protected: IOdbServerApp() = default; diff --git a/OdbDesignLib/App/IRequestAuthentication.cpp b/OdbDesignLib/App/IRequestAuthentication.cpp new file mode 100644 index 00000000..f7a40168 --- /dev/null +++ b/OdbDesignLib/App/IRequestAuthentication.cpp @@ -0,0 +1,6 @@ +#include "IRequestAuthentication.h" + +namespace Odb::Lib::App +{ + +} \ No newline at end of file diff --git a/OdbDesignLib/App/IRequestAuthentication.h b/OdbDesignLib/App/IRequestAuthentication.h new file mode 100644 index 00000000..bf7bc5a5 --- /dev/null +++ b/OdbDesignLib/App/IRequestAuthentication.h @@ -0,0 +1,18 @@ +#pragma once + +#include "../odbdesign_export.h" +#include "crow_win.h" + +namespace Odb::Lib::App +{ + class ODBDESIGN_EXPORT IRequestAuthentication + { + public: + virtual crow::response AuthenticateRequest(const crow::request& req) = 0; + + protected: + // pure virtual interface + IRequestAuthentication() = default; + + }; +} diff --git a/OdbDesignLib/App/OdbServerAppBase.cpp b/OdbDesignLib/App/OdbServerAppBase.cpp index 8306505c..8a2a80ec 100644 --- a/OdbDesignLib/App/OdbServerAppBase.cpp +++ b/OdbDesignLib/App/OdbServerAppBase.cpp @@ -1,4 +1,5 @@ #include "OdbServerAppBase.h" +#include "OdbServerAppBase.h" #include "Logger.h" using namespace Utils; @@ -7,8 +8,20 @@ using namespace std::filesystem; namespace Odb::Lib::App { OdbServerAppBase::OdbServerAppBase(int argc, char* argv[]) - : OdbAppBase(argc, argv) + : OdbAppBase(argc, argv) + { + } + + bool OdbServerAppBase::preServerRun() { + // override in extended class to configure server or run custom code + return true; + } + + bool OdbServerAppBase::postServerRun() + { + // override in extended class to cleanup server or run custom code + return true; } OdbServerAppBase::~OdbServerAppBase() @@ -70,9 +83,13 @@ namespace Odb::Lib::App // set server to use multiple threads m_crowApp.multithreaded(); + if (!preServerRun()) return ExitCode::PreServerRunFailed; + // run the Crow server m_crowApp.run(); + if (!postServerRun()) return ExitCode::PostServerRunFailed; + // success! return ExitCode::Success; } @@ -82,6 +99,16 @@ namespace Odb::Lib::App return m_crowApp; } + IRequestAuthentication& OdbServerAppBase::request_auth() + { + return *m_pRequestAuthentication; + } + + void OdbServerAppBase::request_auth(std::unique_ptr pRequestAuthentication) + { + m_pRequestAuthentication = std::move(pRequestAuthentication); + } + void OdbServerAppBase::register_routes() { for (const auto& pController : m_vecControllers) diff --git a/OdbDesignLib/App/OdbServerAppBase.h b/OdbDesignLib/App/OdbServerAppBase.h index ae62ba1a..9db46ab7 100644 --- a/OdbDesignLib/App/OdbServerAppBase.h +++ b/OdbDesignLib/App/OdbServerAppBase.h @@ -4,28 +4,38 @@ #include "OdbAppBase.h" #include "RouteController.h" #include "../odbdesign_export.h" +#include "IRequestAuthentication.h" +#include "BasicRequestAuthentication.h" namespace Odb::Lib::App { class ODBDESIGN_EXPORT OdbServerAppBase : public OdbAppBase, public IOdbServerApp { - public: - OdbServerAppBase(int argc, char* argv[]); + public: virtual ~OdbServerAppBase(); CrowApp& crow_app() override; + IRequestAuthentication& request_auth() override; + void request_auth(std::unique_ptr pRequestAuthentication) override; + Utils::ExitCode Run() override; protected: + OdbServerAppBase(int argc, char* argv[]); + RouteController::Vector m_vecControllers; // implement in subclasses to add route controllers virtual void add_controllers() = 0; + virtual bool preServerRun(); + virtual bool postServerRun(); + private: CrowApp m_crowApp; //crow::SimpleApp m_crowApp; + std::unique_ptr m_pRequestAuthentication; void register_routes(); diff --git a/OdbDesignLib/App/RouteController.cpp b/OdbDesignLib/App/RouteController.cpp index a6883a7d..c98f5aad 100644 --- a/OdbDesignLib/App/RouteController.cpp +++ b/OdbDesignLib/App/RouteController.cpp @@ -11,8 +11,15 @@ namespace Odb::Lib::App void RouteController::register_route_handler(std::string route, TRouteHandlerFunction handler) { m_serverApp.crow_app().route_dynamic(std::move(route)) - ([handler](const crow::request& req) + ([/*&,*/ handler](const crow::request& req) { + //// authenticate request before sending to handler + //auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + //if (authResp.code != crow::status::OK) + //{ + // return authResp; + //} + return handler(req); }); diff --git a/OdbDesignLib/CMakeLists.txt b/OdbDesignLib/CMakeLists.txt index f0c24b20..b2e626e8 100644 --- a/OdbDesignLib/CMakeLists.txt +++ b/OdbDesignLib/CMakeLists.txt @@ -29,8 +29,15 @@ add_library(OdbDesign SHARED "ProtoBuf/symbolsdirectory.pb.h" "ProtoBuf/symbolsdirectory.pb.cc" "ProtoBuf/symbolname.pb.h" "ProtoBuf/symbolname.pb.cc" "ProtoBuf/stephdrfile.pb.h" "ProtoBuf/stephdrfile.pb.cc" + "ProtoBuf/pin.pb.h" "ProtoBuf/pin.pb.cc" + "ProtoBuf/pinconnection.pb.h" "ProtoBuf/pinconnection.pb.cc" + "ProtoBuf/part.pb.h" "ProtoBuf/part.pb.cc" + "ProtoBuf/component.pb.h" "ProtoBuf/component.pb.cc" + "ProtoBuf/net.pb.h" "ProtoBuf/net.pb.cc" + "ProtoBuf/via.pb.h" "ProtoBuf/via.pb.cc" + "ProtoBuf/package.pb.h" "ProtoBuf/package.pb.cc" "FileModel/parse_error.h" "FileModel/parse_info.h" "FileModel/parse_info.cpp" "FileModel/parse_error.cpp" "FileModel/invalid_odb_error.h" "FileModel/invalid_odb_error.cpp" "ProtoBuf/common.pb.h" "ProtoBuf/common.pb.cc" "ProtoBuf/componentsfile.pb.h" "ProtoBuf/componentsfile.pb.cc" "FileModel/Design/PropertyRecord.h" "FileModel/Design/PropertyRecord.cpp" "FileModel/Design/FeaturesFile.h" "FileModel/Design/FeaturesFile.cpp" "FileModel/Design/ContourPolygon.h" "FileModel/Design/ContourPolygon.cpp" "FileModel/Design/SymbolName.h" "FileModel/Design/SymbolName.cpp" "FileModel/Design/SymbolsDirectory.h" "FileModel/Design/SymbolsDirectory.cpp" "FileModel/Design/StepHdrFile.h" "FileModel/Design/StepHdrFile.cpp" "FileModel/Design/AttributeLookupTable.h" "FileModel/Design/AttributeLookupTable.cpp" -) + "App/IRequestAuthentication.h" "App/IRequestAuthentication.cpp" "App/BasicRequestAuthentication.h" "App/BasicRequestAuthentication.cpp") # disable warning C4250: inheritance by dominance target_compile_options(OdbDesign PUBLIC diff --git a/OdbDesignLib/FileModel/Design/ComponentsFile.cpp b/OdbDesignLib/FileModel/Design/ComponentsFile.cpp index a255c747..9dea4179 100644 --- a/OdbDesignLib/FileModel/Design/ComponentsFile.cpp +++ b/OdbDesignLib/FileModel/Design/ComponentsFile.cpp @@ -625,7 +625,8 @@ namespace Odb::Lib::FileModel::Design if (!(lineStream >> pCurrentBomDescriptionRecord->ipn)) { - throw_parse_error(m_path, line, token, lineNumber); + // blank/ no IPN value allowed + //throw_parse_error(m_path, line, token, lineNumber); } } else if (line.find(ComponentsFile::BomDescriptionRecord::DSC_RECORD_TOKEN) == 0) diff --git a/OdbDesignLib/FileModel/Design/ComponentsFile.h b/OdbDesignLib/FileModel/Design/ComponentsFile.h index 7c906fc4..100dd8a3 100644 --- a/OdbDesignLib/FileModel/Design/ComponentsFile.h +++ b/OdbDesignLib/FileModel/Design/ComponentsFile.h @@ -91,8 +91,7 @@ namespace Odb::Lib::FileModel::Design std::string cpn; std::string pkg; std::string ipn; - std::vector descriptions; - std::string dsc; + std::vector descriptions; std::string vpl_vnd; std::string vpl_mpn; std::string vnd; diff --git a/OdbDesignLib/FileModel/Design/FeaturesFile.cpp b/OdbDesignLib/FileModel/Design/FeaturesFile.cpp index ec241482..67f81ca9 100644 --- a/OdbDesignLib/FileModel/Design/FeaturesFile.cpp +++ b/OdbDesignLib/FileModel/Design/FeaturesFile.cpp @@ -53,7 +53,7 @@ namespace Odb::Lib::FileModel::Design } std::filesystem::path featuresFilePath; - for (const std::string featuresFilename : filenames) + for (const auto& featuresFilename : filenames) { loginfo("trying features file: [" + featuresFilename + "]..."); diff --git a/OdbDesignLib/FileModel/Design/FileArchive.cpp b/OdbDesignLib/FileModel/Design/FileArchive.cpp index f7bb7256..35bc7a2d 100644 --- a/OdbDesignLib/FileModel/Design/FileArchive.cpp +++ b/OdbDesignLib/FileModel/Design/FileArchive.cpp @@ -370,7 +370,7 @@ namespace Odb::Lib::FileModel::Design return m_miscAttrListFile; } - std::shared_ptr FileArchive::GetStepDirectory(const std::string& stepName /*= ""*/) + std::shared_ptr FileArchive::GetStepDirectory(const std::string& stepName /*= ""*/) const { std::shared_ptr pStepDirectory; diff --git a/OdbDesignLib/FileModel/Design/FileArchive.h b/OdbDesignLib/FileModel/Design/FileArchive.h index 8162bc23..b7c862fc 100644 --- a/OdbDesignLib/FileModel/Design/FileArchive.h +++ b/OdbDesignLib/FileModel/Design/FileArchive.h @@ -36,7 +36,7 @@ namespace Odb::Lib::FileModel::Design const StandardFontsFile& GetStandardFontsFile() const; const AttrListFile& GetMiscAttrListFile() const; - std::shared_ptr GetStepDirectory(const std::string& stepName = ""); + std::shared_ptr GetStepDirectory(const std::string& stepName = "") const; // TODO: fix these to use pointer return types //const EdaDataFile& GetStepEdaDataFile(std::string stepName) const; diff --git a/OdbDesignLib/ProtoBuf/component.pb.cc b/OdbDesignLib/ProtoBuf/component.pb.cc new file mode 100644 index 00000000..2c748216 --- /dev/null +++ b/OdbDesignLib/ProtoBuf/component.pb.cc @@ -0,0 +1,581 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: component.proto + +#include "component.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { +PROTOBUF_CONSTEXPR Component::Component( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.refdes_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.partname_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.package_)*/nullptr + , /*decltype(_impl_.part_)*/nullptr + , /*decltype(_impl_.index_)*/0u + , /*decltype(_impl_.side_)*/0} {} +struct ComponentDefaultTypeInternal { + PROTOBUF_CONSTEXPR ComponentDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~ComponentDefaultTypeInternal() {} + union { + Component _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ComponentDefaultTypeInternal _Component_default_instance_; +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb +static ::_pb::Metadata file_level_metadata_component_2eproto[1]; +static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_component_2eproto = nullptr; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_component_2eproto = nullptr; + +const uint32_t TableStruct_component_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Component, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Component, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Component, _impl_.refdes_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Component, _impl_.partname_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Component, _impl_.package_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Component, _impl_.index_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Component, _impl_.side_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Component, _impl_.part_), + 0, + 1, + 2, + 4, + 5, + 3, +}; +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, 12, -1, sizeof(::Odb::Lib::Protobuf::ProductModel::Component)}, +}; + +static const ::_pb::Message* const file_default_instances[] = { + &::Odb::Lib::Protobuf::ProductModel::_Component_default_instance_._instance, +}; + +const char descriptor_table_protodef_component_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\017component.proto\022\035Odb.Lib.Protobuf.Prod" + "uctModel\032\013enums.proto\032\npart.proto\032\rpacka" + "ge.proto\"\261\002\n\tComponent\022\023\n\006refDes\030\001 \001(\tH\000" + "\210\001\001\022\025\n\010partName\030\002 \001(\tH\001\210\001\001\022<\n\007package\030\003 " + "\001(\0132&.Odb.Lib.Protobuf.ProductModel.Pack" + "ageH\002\210\001\001\022\022\n\005index\030\004 \001(\rH\003\210\001\001\022.\n\004side\030\005 \001" + "(\0162\033.Odb.Lib.Protobuf.BoardSideH\004\210\001\001\0226\n\004" + "part\030\006 \001(\0132#.Odb.Lib.Protobuf.ProductMod" + "el.PartH\005\210\001\001B\t\n\007_refDesB\013\n\t_partNameB\n\n\010" + "_packageB\010\n\006_indexB\007\n\005_sideB\007\n\005_partb\006pr" + "oto3" + ; +static const ::_pbi::DescriptorTable* const descriptor_table_component_2eproto_deps[3] = { + &::descriptor_table_enums_2eproto, + &::descriptor_table_package_2eproto, + &::descriptor_table_part_2eproto, +}; +static ::_pbi::once_flag descriptor_table_component_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_component_2eproto = { + false, false, 404, descriptor_table_protodef_component_2eproto, + "component.proto", + &descriptor_table_component_2eproto_once, descriptor_table_component_2eproto_deps, 3, 1, + schemas, file_default_instances, TableStruct_component_2eproto::offsets, + file_level_metadata_component_2eproto, file_level_enum_descriptors_component_2eproto, + file_level_service_descriptors_component_2eproto, +}; +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_component_2eproto_getter() { + return &descriptor_table_component_2eproto; +} + +// Force running AddDescriptors() at dynamic initialization time. +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_component_2eproto(&descriptor_table_component_2eproto); +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { + +// =================================================================== + +class Component::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_refdes(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_partname(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static const ::Odb::Lib::Protobuf::ProductModel::Package& package(const Component* msg); + static void set_has_package(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } + static void set_has_index(HasBits* has_bits) { + (*has_bits)[0] |= 16u; + } + static void set_has_side(HasBits* has_bits) { + (*has_bits)[0] |= 32u; + } + static const ::Odb::Lib::Protobuf::ProductModel::Part& part(const Component* msg); + static void set_has_part(HasBits* has_bits) { + (*has_bits)[0] |= 8u; + } +}; + +const ::Odb::Lib::Protobuf::ProductModel::Package& +Component::_Internal::package(const Component* msg) { + return *msg->_impl_.package_; +} +const ::Odb::Lib::Protobuf::ProductModel::Part& +Component::_Internal::part(const Component* msg) { + return *msg->_impl_.part_; +} +void Component::clear_package() { + if (_impl_.package_ != nullptr) _impl_.package_->Clear(); + _impl_._has_bits_[0] &= ~0x00000004u; +} +void Component::clear_part() { + if (_impl_.part_ != nullptr) _impl_.part_->Clear(); + _impl_._has_bits_[0] &= ~0x00000008u; +} +Component::Component(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:Odb.Lib.Protobuf.ProductModel.Component) +} +Component::Component(const Component& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + Component* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.refdes_){} + , decltype(_impl_.partname_){} + , decltype(_impl_.package_){nullptr} + , decltype(_impl_.part_){nullptr} + , decltype(_impl_.index_){} + , decltype(_impl_.side_){}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.refdes_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.refdes_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_refdes()) { + _this->_impl_.refdes_.Set(from._internal_refdes(), + _this->GetArenaForAllocation()); + } + _impl_.partname_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.partname_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_partname()) { + _this->_impl_.partname_.Set(from._internal_partname(), + _this->GetArenaForAllocation()); + } + if (from._internal_has_package()) { + _this->_impl_.package_ = new ::Odb::Lib::Protobuf::ProductModel::Package(*from._impl_.package_); + } + if (from._internal_has_part()) { + _this->_impl_.part_ = new ::Odb::Lib::Protobuf::ProductModel::Part(*from._impl_.part_); + } + ::memcpy(&_impl_.index_, &from._impl_.index_, + static_cast(reinterpret_cast(&_impl_.side_) - + reinterpret_cast(&_impl_.index_)) + sizeof(_impl_.side_)); + // @@protoc_insertion_point(copy_constructor:Odb.Lib.Protobuf.ProductModel.Component) +} + +inline void Component::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.refdes_){} + , decltype(_impl_.partname_){} + , decltype(_impl_.package_){nullptr} + , decltype(_impl_.part_){nullptr} + , decltype(_impl_.index_){0u} + , decltype(_impl_.side_){0} + }; + _impl_.refdes_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.refdes_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.partname_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.partname_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +Component::~Component() { + // @@protoc_insertion_point(destructor:Odb.Lib.Protobuf.ProductModel.Component) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void Component::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.refdes_.Destroy(); + _impl_.partname_.Destroy(); + if (this != internal_default_instance()) delete _impl_.package_; + if (this != internal_default_instance()) delete _impl_.part_; +} + +void Component::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Component::Clear() { +// @@protoc_insertion_point(message_clear_start:Odb.Lib.Protobuf.ProductModel.Component) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x0000000fu) { + if (cached_has_bits & 0x00000001u) { + _impl_.refdes_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000002u) { + _impl_.partname_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000004u) { + GOOGLE_DCHECK(_impl_.package_ != nullptr); + _impl_.package_->Clear(); + } + if (cached_has_bits & 0x00000008u) { + GOOGLE_DCHECK(_impl_.part_ != nullptr); + _impl_.part_->Clear(); + } + } + if (cached_has_bits & 0x00000030u) { + ::memset(&_impl_.index_, 0, static_cast( + reinterpret_cast(&_impl_.side_) - + reinterpret_cast(&_impl_.index_)) + sizeof(_impl_.side_)); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* Component::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // optional string refDes = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_refdes(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "Odb.Lib.Protobuf.ProductModel.Component.refDes")); + } else + goto handle_unusual; + continue; + // optional string partName = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_partname(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "Odb.Lib.Protobuf.ProductModel.Component.partName")); + } else + goto handle_unusual; + continue; + // optional .Odb.Lib.Protobuf.ProductModel.Package package = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + ptr = ctx->ParseMessage(_internal_mutable_package(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional uint32 index = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + _Internal::set_has_index(&has_bits); + _impl_.index_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .Odb.Lib.Protobuf.BoardSide side = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_side(static_cast<::Odb::Lib::Protobuf::BoardSide>(val)); + } else + goto handle_unusual; + continue; + // optional .Odb.Lib.Protobuf.ProductModel.Part part = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { + ptr = ctx->ParseMessage(_internal_mutable_part(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + _impl_._has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* Component::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:Odb.Lib.Protobuf.ProductModel.Component) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // optional string refDes = 1; + if (_internal_has_refdes()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_refdes().data(), static_cast(this->_internal_refdes().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "Odb.Lib.Protobuf.ProductModel.Component.refDes"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_refdes(), target); + } + + // optional string partName = 2; + if (_internal_has_partname()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_partname().data(), static_cast(this->_internal_partname().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "Odb.Lib.Protobuf.ProductModel.Component.partName"); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_partname(), target); + } + + // optional .Odb.Lib.Protobuf.ProductModel.Package package = 3; + if (_internal_has_package()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::package(this), + _Internal::package(this).GetCachedSize(), target, stream); + } + + // optional uint32 index = 4; + if (_internal_has_index()) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_index(), target); + } + + // optional .Odb.Lib.Protobuf.BoardSide side = 5; + if (_internal_has_side()) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 5, this->_internal_side(), target); + } + + // optional .Odb.Lib.Protobuf.ProductModel.Part part = 6; + if (_internal_has_part()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(6, _Internal::part(this), + _Internal::part(this).GetCachedSize(), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:Odb.Lib.Protobuf.ProductModel.Component) + return target; +} + +size_t Component::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:Odb.Lib.Protobuf.ProductModel.Component) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x0000003fu) { + // optional string refDes = 1; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_refdes()); + } + + // optional string partName = 2; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_partname()); + } + + // optional .Odb.Lib.Protobuf.ProductModel.Package package = 3; + if (cached_has_bits & 0x00000004u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.package_); + } + + // optional .Odb.Lib.Protobuf.ProductModel.Part part = 6; + if (cached_has_bits & 0x00000008u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.part_); + } + + // optional uint32 index = 4; + if (cached_has_bits & 0x00000010u) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_index()); + } + + // optional .Odb.Lib.Protobuf.BoardSide side = 5; + if (cached_has_bits & 0x00000020u) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_side()); + } + + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Component::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Component::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Component::GetClassData() const { return &_class_data_; } + + +void Component::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:Odb.Lib.Protobuf.ProductModel.Component) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x0000003fu) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_set_refdes(from._internal_refdes()); + } + if (cached_has_bits & 0x00000002u) { + _this->_internal_set_partname(from._internal_partname()); + } + if (cached_has_bits & 0x00000004u) { + _this->_internal_mutable_package()->::Odb::Lib::Protobuf::ProductModel::Package::MergeFrom( + from._internal_package()); + } + if (cached_has_bits & 0x00000008u) { + _this->_internal_mutable_part()->::Odb::Lib::Protobuf::ProductModel::Part::MergeFrom( + from._internal_part()); + } + if (cached_has_bits & 0x00000010u) { + _this->_impl_.index_ = from._impl_.index_; + } + if (cached_has_bits & 0x00000020u) { + _this->_impl_.side_ = from._impl_.side_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Component::CopyFrom(const Component& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:Odb.Lib.Protobuf.ProductModel.Component) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Component::IsInitialized() const { + return true; +} + +void Component::InternalSwap(Component* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.refdes_, lhs_arena, + &other->_impl_.refdes_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.partname_, lhs_arena, + &other->_impl_.partname_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(Component, _impl_.side_) + + sizeof(Component::_impl_.side_) + - PROTOBUF_FIELD_OFFSET(Component, _impl_.package_)>( + reinterpret_cast(&_impl_.package_), + reinterpret_cast(&other->_impl_.package_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Component::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_component_2eproto_getter, &descriptor_table_component_2eproto_once, + file_level_metadata_component_2eproto[0]); +} + +// @@protoc_insertion_point(namespace_scope) +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::Odb::Lib::Protobuf::ProductModel::Component* +Arena::CreateMaybeMessage< ::Odb::Lib::Protobuf::ProductModel::Component >(Arena* arena) { + return Arena::CreateMessageInternal< ::Odb::Lib::Protobuf::ProductModel::Component >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/OdbDesignLib/ProtoBuf/component.pb.h b/OdbDesignLib/ProtoBuf/component.pb.h new file mode 100644 index 00000000..46d2a6bd --- /dev/null +++ b/OdbDesignLib/ProtoBuf/component.pb.h @@ -0,0 +1,708 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: component.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_component_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_component_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3021000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "enums.pb.h" +#include "part.pb.h" +#include "package.pb.h" +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_component_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_component_2eproto { + static const uint32_t offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_component_2eproto; +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { +class Component; +struct ComponentDefaultTypeInternal; +extern ComponentDefaultTypeInternal _Component_default_instance_; +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb +PROTOBUF_NAMESPACE_OPEN +template<> ::Odb::Lib::Protobuf::ProductModel::Component* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Component>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { + +// =================================================================== + +class Component final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.ProductModel.Component) */ { + public: + inline Component() : Component(nullptr) {} + ~Component() override; + explicit PROTOBUF_CONSTEXPR Component(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + Component(const Component& from); + Component(Component&& from) noexcept + : Component() { + *this = ::std::move(from); + } + + inline Component& operator=(const Component& from) { + CopyFrom(from); + return *this; + } + inline Component& operator=(Component&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Component& default_instance() { + return *internal_default_instance(); + } + static inline const Component* internal_default_instance() { + return reinterpret_cast( + &_Component_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(Component& a, Component& b) { + a.Swap(&b); + } + inline void Swap(Component* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Component* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Component* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const Component& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const Component& from) { + Component::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Component* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "Odb.Lib.Protobuf.ProductModel.Component"; + } + protected: + explicit Component(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kRefDesFieldNumber = 1, + kPartNameFieldNumber = 2, + kPackageFieldNumber = 3, + kPartFieldNumber = 6, + kIndexFieldNumber = 4, + kSideFieldNumber = 5, + }; + // optional string refDes = 1; + bool has_refdes() const; + private: + bool _internal_has_refdes() const; + public: + void clear_refdes(); + const std::string& refdes() const; + template + void set_refdes(ArgT0&& arg0, ArgT... args); + std::string* mutable_refdes(); + PROTOBUF_NODISCARD std::string* release_refdes(); + void set_allocated_refdes(std::string* refdes); + private: + const std::string& _internal_refdes() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_refdes(const std::string& value); + std::string* _internal_mutable_refdes(); + public: + + // optional string partName = 2; + bool has_partname() const; + private: + bool _internal_has_partname() const; + public: + void clear_partname(); + const std::string& partname() const; + template + void set_partname(ArgT0&& arg0, ArgT... args); + std::string* mutable_partname(); + PROTOBUF_NODISCARD std::string* release_partname(); + void set_allocated_partname(std::string* partname); + private: + const std::string& _internal_partname() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_partname(const std::string& value); + std::string* _internal_mutable_partname(); + public: + + // optional .Odb.Lib.Protobuf.ProductModel.Package package = 3; + bool has_package() const; + private: + bool _internal_has_package() const; + public: + void clear_package(); + const ::Odb::Lib::Protobuf::ProductModel::Package& package() const; + PROTOBUF_NODISCARD ::Odb::Lib::Protobuf::ProductModel::Package* release_package(); + ::Odb::Lib::Protobuf::ProductModel::Package* mutable_package(); + void set_allocated_package(::Odb::Lib::Protobuf::ProductModel::Package* package); + private: + const ::Odb::Lib::Protobuf::ProductModel::Package& _internal_package() const; + ::Odb::Lib::Protobuf::ProductModel::Package* _internal_mutable_package(); + public: + void unsafe_arena_set_allocated_package( + ::Odb::Lib::Protobuf::ProductModel::Package* package); + ::Odb::Lib::Protobuf::ProductModel::Package* unsafe_arena_release_package(); + + // optional .Odb.Lib.Protobuf.ProductModel.Part part = 6; + bool has_part() const; + private: + bool _internal_has_part() const; + public: + void clear_part(); + const ::Odb::Lib::Protobuf::ProductModel::Part& part() const; + PROTOBUF_NODISCARD ::Odb::Lib::Protobuf::ProductModel::Part* release_part(); + ::Odb::Lib::Protobuf::ProductModel::Part* mutable_part(); + void set_allocated_part(::Odb::Lib::Protobuf::ProductModel::Part* part); + private: + const ::Odb::Lib::Protobuf::ProductModel::Part& _internal_part() const; + ::Odb::Lib::Protobuf::ProductModel::Part* _internal_mutable_part(); + public: + void unsafe_arena_set_allocated_part( + ::Odb::Lib::Protobuf::ProductModel::Part* part); + ::Odb::Lib::Protobuf::ProductModel::Part* unsafe_arena_release_part(); + + // optional uint32 index = 4; + bool has_index() const; + private: + bool _internal_has_index() const; + public: + void clear_index(); + uint32_t index() const; + void set_index(uint32_t value); + private: + uint32_t _internal_index() const; + void _internal_set_index(uint32_t value); + public: + + // optional .Odb.Lib.Protobuf.BoardSide side = 5; + bool has_side() const; + private: + bool _internal_has_side() const; + public: + void clear_side(); + ::Odb::Lib::Protobuf::BoardSide side() const; + void set_side(::Odb::Lib::Protobuf::BoardSide value); + private: + ::Odb::Lib::Protobuf::BoardSide _internal_side() const; + void _internal_set_side(::Odb::Lib::Protobuf::BoardSide value); + public: + + // @@protoc_insertion_point(class_scope:Odb.Lib.Protobuf.ProductModel.Component) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr refdes_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr partname_; + ::Odb::Lib::Protobuf::ProductModel::Package* package_; + ::Odb::Lib::Protobuf::ProductModel::Part* part_; + uint32_t index_; + int side_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_component_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Component + +// optional string refDes = 1; +inline bool Component::_internal_has_refdes() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool Component::has_refdes() const { + return _internal_has_refdes(); +} +inline void Component::clear_refdes() { + _impl_.refdes_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& Component::refdes() const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Component.refDes) + return _internal_refdes(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void Component::set_refdes(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.refdes_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:Odb.Lib.Protobuf.ProductModel.Component.refDes) +} +inline std::string* Component::mutable_refdes() { + std::string* _s = _internal_mutable_refdes(); + // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.ProductModel.Component.refDes) + return _s; +} +inline const std::string& Component::_internal_refdes() const { + return _impl_.refdes_.Get(); +} +inline void Component::_internal_set_refdes(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.refdes_.Set(value, GetArenaForAllocation()); +} +inline std::string* Component::_internal_mutable_refdes() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.refdes_.Mutable(GetArenaForAllocation()); +} +inline std::string* Component::release_refdes() { + // @@protoc_insertion_point(field_release:Odb.Lib.Protobuf.ProductModel.Component.refDes) + if (!_internal_has_refdes()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.refdes_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.refdes_.IsDefault()) { + _impl_.refdes_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void Component::set_allocated_refdes(std::string* refdes) { + if (refdes != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.refdes_.SetAllocated(refdes, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.refdes_.IsDefault()) { + _impl_.refdes_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:Odb.Lib.Protobuf.ProductModel.Component.refDes) +} + +// optional string partName = 2; +inline bool Component::_internal_has_partname() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool Component::has_partname() const { + return _internal_has_partname(); +} +inline void Component::clear_partname() { + _impl_.partname_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline const std::string& Component::partname() const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Component.partName) + return _internal_partname(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void Component::set_partname(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.partname_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:Odb.Lib.Protobuf.ProductModel.Component.partName) +} +inline std::string* Component::mutable_partname() { + std::string* _s = _internal_mutable_partname(); + // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.ProductModel.Component.partName) + return _s; +} +inline const std::string& Component::_internal_partname() const { + return _impl_.partname_.Get(); +} +inline void Component::_internal_set_partname(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.partname_.Set(value, GetArenaForAllocation()); +} +inline std::string* Component::_internal_mutable_partname() { + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.partname_.Mutable(GetArenaForAllocation()); +} +inline std::string* Component::release_partname() { + // @@protoc_insertion_point(field_release:Odb.Lib.Protobuf.ProductModel.Component.partName) + if (!_internal_has_partname()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000002u; + auto* p = _impl_.partname_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.partname_.IsDefault()) { + _impl_.partname_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void Component::set_allocated_partname(std::string* partname) { + if (partname != nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + _impl_.partname_.SetAllocated(partname, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.partname_.IsDefault()) { + _impl_.partname_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:Odb.Lib.Protobuf.ProductModel.Component.partName) +} + +// optional .Odb.Lib.Protobuf.ProductModel.Package package = 3; +inline bool Component::_internal_has_package() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + PROTOBUF_ASSUME(!value || _impl_.package_ != nullptr); + return value; +} +inline bool Component::has_package() const { + return _internal_has_package(); +} +inline const ::Odb::Lib::Protobuf::ProductModel::Package& Component::_internal_package() const { + const ::Odb::Lib::Protobuf::ProductModel::Package* p = _impl_.package_; + return p != nullptr ? *p : reinterpret_cast( + ::Odb::Lib::Protobuf::ProductModel::_Package_default_instance_); +} +inline const ::Odb::Lib::Protobuf::ProductModel::Package& Component::package() const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Component.package) + return _internal_package(); +} +inline void Component::unsafe_arena_set_allocated_package( + ::Odb::Lib::Protobuf::ProductModel::Package* package) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.package_); + } + _impl_.package_ = package; + if (package) { + _impl_._has_bits_[0] |= 0x00000004u; + } else { + _impl_._has_bits_[0] &= ~0x00000004u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:Odb.Lib.Protobuf.ProductModel.Component.package) +} +inline ::Odb::Lib::Protobuf::ProductModel::Package* Component::release_package() { + _impl_._has_bits_[0] &= ~0x00000004u; + ::Odb::Lib::Protobuf::ProductModel::Package* temp = _impl_.package_; + _impl_.package_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::Odb::Lib::Protobuf::ProductModel::Package* Component::unsafe_arena_release_package() { + // @@protoc_insertion_point(field_release:Odb.Lib.Protobuf.ProductModel.Component.package) + _impl_._has_bits_[0] &= ~0x00000004u; + ::Odb::Lib::Protobuf::ProductModel::Package* temp = _impl_.package_; + _impl_.package_ = nullptr; + return temp; +} +inline ::Odb::Lib::Protobuf::ProductModel::Package* Component::_internal_mutable_package() { + _impl_._has_bits_[0] |= 0x00000004u; + if (_impl_.package_ == nullptr) { + auto* p = CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Package>(GetArenaForAllocation()); + _impl_.package_ = p; + } + return _impl_.package_; +} +inline ::Odb::Lib::Protobuf::ProductModel::Package* Component::mutable_package() { + ::Odb::Lib::Protobuf::ProductModel::Package* _msg = _internal_mutable_package(); + // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.ProductModel.Component.package) + return _msg; +} +inline void Component::set_allocated_package(::Odb::Lib::Protobuf::ProductModel::Package* package) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.package_); + } + if (package) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(package)); + if (message_arena != submessage_arena) { + package = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, package, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000004u; + } else { + _impl_._has_bits_[0] &= ~0x00000004u; + } + _impl_.package_ = package; + // @@protoc_insertion_point(field_set_allocated:Odb.Lib.Protobuf.ProductModel.Component.package) +} + +// optional uint32 index = 4; +inline bool Component::_internal_has_index() const { + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; + return value; +} +inline bool Component::has_index() const { + return _internal_has_index(); +} +inline void Component::clear_index() { + _impl_.index_ = 0u; + _impl_._has_bits_[0] &= ~0x00000010u; +} +inline uint32_t Component::_internal_index() const { + return _impl_.index_; +} +inline uint32_t Component::index() const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Component.index) + return _internal_index(); +} +inline void Component::_internal_set_index(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000010u; + _impl_.index_ = value; +} +inline void Component::set_index(uint32_t value) { + _internal_set_index(value); + // @@protoc_insertion_point(field_set:Odb.Lib.Protobuf.ProductModel.Component.index) +} + +// optional .Odb.Lib.Protobuf.BoardSide side = 5; +inline bool Component::_internal_has_side() const { + bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; + return value; +} +inline bool Component::has_side() const { + return _internal_has_side(); +} +inline void Component::clear_side() { + _impl_.side_ = 0; + _impl_._has_bits_[0] &= ~0x00000020u; +} +inline ::Odb::Lib::Protobuf::BoardSide Component::_internal_side() const { + return static_cast< ::Odb::Lib::Protobuf::BoardSide >(_impl_.side_); +} +inline ::Odb::Lib::Protobuf::BoardSide Component::side() const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Component.side) + return _internal_side(); +} +inline void Component::_internal_set_side(::Odb::Lib::Protobuf::BoardSide value) { + _impl_._has_bits_[0] |= 0x00000020u; + _impl_.side_ = value; +} +inline void Component::set_side(::Odb::Lib::Protobuf::BoardSide value) { + _internal_set_side(value); + // @@protoc_insertion_point(field_set:Odb.Lib.Protobuf.ProductModel.Component.side) +} + +// optional .Odb.Lib.Protobuf.ProductModel.Part part = 6; +inline bool Component::_internal_has_part() const { + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; + PROTOBUF_ASSUME(!value || _impl_.part_ != nullptr); + return value; +} +inline bool Component::has_part() const { + return _internal_has_part(); +} +inline const ::Odb::Lib::Protobuf::ProductModel::Part& Component::_internal_part() const { + const ::Odb::Lib::Protobuf::ProductModel::Part* p = _impl_.part_; + return p != nullptr ? *p : reinterpret_cast( + ::Odb::Lib::Protobuf::ProductModel::_Part_default_instance_); +} +inline const ::Odb::Lib::Protobuf::ProductModel::Part& Component::part() const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Component.part) + return _internal_part(); +} +inline void Component::unsafe_arena_set_allocated_part( + ::Odb::Lib::Protobuf::ProductModel::Part* part) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.part_); + } + _impl_.part_ = part; + if (part) { + _impl_._has_bits_[0] |= 0x00000008u; + } else { + _impl_._has_bits_[0] &= ~0x00000008u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:Odb.Lib.Protobuf.ProductModel.Component.part) +} +inline ::Odb::Lib::Protobuf::ProductModel::Part* Component::release_part() { + _impl_._has_bits_[0] &= ~0x00000008u; + ::Odb::Lib::Protobuf::ProductModel::Part* temp = _impl_.part_; + _impl_.part_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::Odb::Lib::Protobuf::ProductModel::Part* Component::unsafe_arena_release_part() { + // @@protoc_insertion_point(field_release:Odb.Lib.Protobuf.ProductModel.Component.part) + _impl_._has_bits_[0] &= ~0x00000008u; + ::Odb::Lib::Protobuf::ProductModel::Part* temp = _impl_.part_; + _impl_.part_ = nullptr; + return temp; +} +inline ::Odb::Lib::Protobuf::ProductModel::Part* Component::_internal_mutable_part() { + _impl_._has_bits_[0] |= 0x00000008u; + if (_impl_.part_ == nullptr) { + auto* p = CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Part>(GetArenaForAllocation()); + _impl_.part_ = p; + } + return _impl_.part_; +} +inline ::Odb::Lib::Protobuf::ProductModel::Part* Component::mutable_part() { + ::Odb::Lib::Protobuf::ProductModel::Part* _msg = _internal_mutable_part(); + // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.ProductModel.Component.part) + return _msg; +} +inline void Component::set_allocated_part(::Odb::Lib::Protobuf::ProductModel::Part* part) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.part_); + } + if (part) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(part)); + if (message_arena != submessage_arena) { + part = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, part, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000008u; + } else { + _impl_._has_bits_[0] &= ~0x00000008u; + } + _impl_.part_ = part; + // @@protoc_insertion_point(field_set_allocated:Odb.Lib.Protobuf.ProductModel.Component.part) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_component_2eproto diff --git a/OdbDesignLib/ProtoBuf/design.pb.cc b/OdbDesignLib/ProtoBuf/design.pb.cc index 1a699676..477da8b3 100644 --- a/OdbDesignLib/ProtoBuf/design.pb.cc +++ b/OdbDesignLib/ProtoBuf/design.pb.cc @@ -23,11 +23,66 @@ namespace _pbi = _pb::internal; namespace Odb { namespace Lib { namespace Protobuf { +namespace ProductModel { +PROTOBUF_CONSTEXPR Design_NetsByNameEntry_DoNotUse::Design_NetsByNameEntry_DoNotUse( + ::_pbi::ConstantInitialized) {} +struct Design_NetsByNameEntry_DoNotUseDefaultTypeInternal { + PROTOBUF_CONSTEXPR Design_NetsByNameEntry_DoNotUseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~Design_NetsByNameEntry_DoNotUseDefaultTypeInternal() {} + union { + Design_NetsByNameEntry_DoNotUse _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Design_NetsByNameEntry_DoNotUseDefaultTypeInternal _Design_NetsByNameEntry_DoNotUse_default_instance_; +PROTOBUF_CONSTEXPR Design_PackagesByNameEntry_DoNotUse::Design_PackagesByNameEntry_DoNotUse( + ::_pbi::ConstantInitialized) {} +struct Design_PackagesByNameEntry_DoNotUseDefaultTypeInternal { + PROTOBUF_CONSTEXPR Design_PackagesByNameEntry_DoNotUseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~Design_PackagesByNameEntry_DoNotUseDefaultTypeInternal() {} + union { + Design_PackagesByNameEntry_DoNotUse _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Design_PackagesByNameEntry_DoNotUseDefaultTypeInternal _Design_PackagesByNameEntry_DoNotUse_default_instance_; +PROTOBUF_CONSTEXPR Design_ComponentsByNameEntry_DoNotUse::Design_ComponentsByNameEntry_DoNotUse( + ::_pbi::ConstantInitialized) {} +struct Design_ComponentsByNameEntry_DoNotUseDefaultTypeInternal { + PROTOBUF_CONSTEXPR Design_ComponentsByNameEntry_DoNotUseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~Design_ComponentsByNameEntry_DoNotUseDefaultTypeInternal() {} + union { + Design_ComponentsByNameEntry_DoNotUse _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Design_ComponentsByNameEntry_DoNotUseDefaultTypeInternal _Design_ComponentsByNameEntry_DoNotUse_default_instance_; +PROTOBUF_CONSTEXPR Design_PartsByNameEntry_DoNotUse::Design_PartsByNameEntry_DoNotUse( + ::_pbi::ConstantInitialized) {} +struct Design_PartsByNameEntry_DoNotUseDefaultTypeInternal { + PROTOBUF_CONSTEXPR Design_PartsByNameEntry_DoNotUseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~Design_PartsByNameEntry_DoNotUseDefaultTypeInternal() {} + union { + Design_PartsByNameEntry_DoNotUse _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Design_PartsByNameEntry_DoNotUseDefaultTypeInternal _Design_PartsByNameEntry_DoNotUse_default_instance_; PROTOBUF_CONSTEXPR Design::Design( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_._has_bits_)*/{} , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_.filearchive_)*/nullptr} {} + , /*decltype(_impl_.nets_)*/{} + , /*decltype(_impl_.netsbyname_)*/{::_pbi::ConstantInitialized()} + , /*decltype(_impl_.packages_)*/{} + , /*decltype(_impl_.packagesbyname_)*/{::_pbi::ConstantInitialized()} + , /*decltype(_impl_.components_)*/{} + , /*decltype(_impl_.componentsbyname_)*/{::_pbi::ConstantInitialized()} + , /*decltype(_impl_.parts_)*/{} + , /*decltype(_impl_.partsbyname_)*/{::_pbi::ConstantInitialized()} + , /*decltype(_impl_.productmodel_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.filemodel_)*/nullptr} {} struct DesignDefaultTypeInternal { PROTOBUF_CONSTEXPR DesignDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} @@ -37,45 +92,144 @@ struct DesignDefaultTypeInternal { }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DesignDefaultTypeInternal _Design_default_instance_; +} // namespace ProductModel } // namespace Protobuf } // namespace Lib } // namespace Odb -static ::_pb::Metadata file_level_metadata_design_2eproto[1]; +static ::_pb::Metadata file_level_metadata_design_2eproto[5]; static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_design_2eproto = nullptr; static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_design_2eproto = nullptr; const uint32_t TableStruct_design_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::Design, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::Design, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design_NetsByNameEntry_DoNotUse, _has_bits_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design_NetsByNameEntry_DoNotUse, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::Design, _impl_.filearchive_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design_NetsByNameEntry_DoNotUse, key_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design_NetsByNameEntry_DoNotUse, value_), 0, + 1, + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design_PackagesByNameEntry_DoNotUse, _has_bits_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design_PackagesByNameEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design_PackagesByNameEntry_DoNotUse, key_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design_PackagesByNameEntry_DoNotUse, value_), + 0, + 1, + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design_ComponentsByNameEntry_DoNotUse, _has_bits_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design_ComponentsByNameEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design_ComponentsByNameEntry_DoNotUse, key_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design_ComponentsByNameEntry_DoNotUse, value_), + 0, + 1, + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design_PartsByNameEntry_DoNotUse, _has_bits_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design_PartsByNameEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design_PartsByNameEntry_DoNotUse, key_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design_PartsByNameEntry_DoNotUse, value_), + 0, + 1, + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design, _impl_.productmodel_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design, _impl_.name_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design, _impl_.filemodel_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design, _impl_.nets_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design, _impl_.netsbyname_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design, _impl_.packages_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design, _impl_.packagesbyname_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design, _impl_.components_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design, _impl_.componentsbyname_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design, _impl_.parts_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Design, _impl_.partsbyname_), + 0, + 1, + 2, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, }; static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, 7, -1, sizeof(::Odb::Lib::Protobuf::Design)}, + { 0, 8, -1, sizeof(::Odb::Lib::Protobuf::ProductModel::Design_NetsByNameEntry_DoNotUse)}, + { 10, 18, -1, sizeof(::Odb::Lib::Protobuf::ProductModel::Design_PackagesByNameEntry_DoNotUse)}, + { 20, 28, -1, sizeof(::Odb::Lib::Protobuf::ProductModel::Design_ComponentsByNameEntry_DoNotUse)}, + { 30, 38, -1, sizeof(::Odb::Lib::Protobuf::ProductModel::Design_PartsByNameEntry_DoNotUse)}, + { 40, 57, -1, sizeof(::Odb::Lib::Protobuf::ProductModel::Design)}, }; static const ::_pb::Message* const file_default_instances[] = { - &::Odb::Lib::Protobuf::_Design_default_instance_._instance, + &::Odb::Lib::Protobuf::ProductModel::_Design_NetsByNameEntry_DoNotUse_default_instance_._instance, + &::Odb::Lib::Protobuf::ProductModel::_Design_PackagesByNameEntry_DoNotUse_default_instance_._instance, + &::Odb::Lib::Protobuf::ProductModel::_Design_ComponentsByNameEntry_DoNotUse_default_instance_._instance, + &::Odb::Lib::Protobuf::ProductModel::_Design_PartsByNameEntry_DoNotUse_default_instance_._instance, + &::Odb::Lib::Protobuf::ProductModel::_Design_default_instance_._instance, }; const char descriptor_table_protodef_design_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = - "\n\014design.proto\022\020Odb.Lib.Protobuf\032\021filear" - "chive.proto\"Q\n\006Design\0227\n\013fileArchive\030\001 \001" - "(\0132\035.Odb.Lib.Protobuf.FileArchiveH\000\210\001\001B\016" - "\n\014_fileArchiveb\006proto3" + "\n\014design.proto\022\035Odb.Lib.Protobuf.Product" + "Model\032\021filearchive.proto\032\tnet.proto\032\rpac" + "kage.proto\032\017component.proto\032\npart.proto\"" + "\247\010\n\006Design\022\031\n\014productModel\030\001 \001(\tH\000\210\001\001\022\021\n" + "\004name\030\002 \001(\tH\001\210\001\001\0225\n\tfileModel\030\003 \001(\0132\035.Od" + "b.Lib.Protobuf.FileArchiveH\002\210\001\001\0220\n\004nets\030" + "\004 \003(\0132\".Odb.Lib.Protobuf.ProductModel.Ne" + "t\022I\n\nnetsByName\030\005 \003(\01325.Odb.Lib.Protobuf" + ".ProductModel.Design.NetsByNameEntry\0228\n\010" + "packages\030\006 \003(\0132&.Odb.Lib.Protobuf.Produc" + "tModel.Package\022Q\n\016packagesByName\030\007 \003(\01329" + ".Odb.Lib.Protobuf.ProductModel.Design.Pa" + "ckagesByNameEntry\022<\n\ncomponents\030\010 \003(\0132(." + "Odb.Lib.Protobuf.ProductModel.Component\022" + "U\n\020componentsByName\030\t \003(\0132;.Odb.Lib.Prot" + "obuf.ProductModel.Design.ComponentsByNam" + "eEntry\0222\n\005parts\030\n \003(\0132#.Odb.Lib.Protobuf" + ".ProductModel.Part\022K\n\013partsByName\030\013 \003(\0132" + "6.Odb.Lib.Protobuf.ProductModel.Design.P" + "artsByNameEntry\032U\n\017NetsByNameEntry\022\013\n\003ke" + "y\030\001 \001(\t\0221\n\005value\030\002 \001(\0132\".Odb.Lib.Protobu" + "f.ProductModel.Net:\0028\001\032]\n\023PackagesByName" + "Entry\022\013\n\003key\030\001 \001(\t\0225\n\005value\030\002 \001(\0132&.Odb." + "Lib.Protobuf.ProductModel.Package:\0028\001\032a\n" + "\025ComponentsByNameEntry\022\013\n\003key\030\001 \001(\t\0227\n\005v" + "alue\030\002 \001(\0132(.Odb.Lib.Protobuf.ProductMod" + "el.Component:\0028\001\032W\n\020PartsByNameEntry\022\013\n\003" + "key\030\001 \001(\t\0222\n\005value\030\002 \001(\0132#.Odb.Lib.Proto" + "buf.ProductModel.Part:\0028\001B\017\n\r_productMod" + "elB\007\n\005_nameB\014\n\n_fileModelb\006proto3" ; -static const ::_pbi::DescriptorTable* const descriptor_table_design_2eproto_deps[1] = { +static const ::_pbi::DescriptorTable* const descriptor_table_design_2eproto_deps[5] = { + &::descriptor_table_component_2eproto, &::descriptor_table_filearchive_2eproto, + &::descriptor_table_net_2eproto, + &::descriptor_table_package_2eproto, + &::descriptor_table_part_2eproto, }; static ::_pbi::once_flag descriptor_table_design_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_design_2eproto = { - false, false, 142, descriptor_table_protodef_design_2eproto, + false, false, 1193, descriptor_table_protodef_design_2eproto, "design.proto", - &descriptor_table_design_2eproto_once, descriptor_table_design_2eproto_deps, 1, 1, + &descriptor_table_design_2eproto_once, descriptor_table_design_2eproto_deps, 5, 5, schemas, file_default_instances, TableStruct_design_2eproto::offsets, file_level_metadata_design_2eproto, file_level_enum_descriptors_design_2eproto, file_level_service_descriptors_design_2eproto, @@ -89,31 +243,121 @@ PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_in namespace Odb { namespace Lib { namespace Protobuf { +namespace ProductModel { + +// =================================================================== + +Design_NetsByNameEntry_DoNotUse::Design_NetsByNameEntry_DoNotUse() {} +Design_NetsByNameEntry_DoNotUse::Design_NetsByNameEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : SuperType(arena) {} +void Design_NetsByNameEntry_DoNotUse::MergeFrom(const Design_NetsByNameEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::PROTOBUF_NAMESPACE_ID::Metadata Design_NetsByNameEntry_DoNotUse::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_design_2eproto_getter, &descriptor_table_design_2eproto_once, + file_level_metadata_design_2eproto[0]); +} + +// =================================================================== + +Design_PackagesByNameEntry_DoNotUse::Design_PackagesByNameEntry_DoNotUse() {} +Design_PackagesByNameEntry_DoNotUse::Design_PackagesByNameEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : SuperType(arena) {} +void Design_PackagesByNameEntry_DoNotUse::MergeFrom(const Design_PackagesByNameEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::PROTOBUF_NAMESPACE_ID::Metadata Design_PackagesByNameEntry_DoNotUse::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_design_2eproto_getter, &descriptor_table_design_2eproto_once, + file_level_metadata_design_2eproto[1]); +} + +// =================================================================== + +Design_ComponentsByNameEntry_DoNotUse::Design_ComponentsByNameEntry_DoNotUse() {} +Design_ComponentsByNameEntry_DoNotUse::Design_ComponentsByNameEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : SuperType(arena) {} +void Design_ComponentsByNameEntry_DoNotUse::MergeFrom(const Design_ComponentsByNameEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::PROTOBUF_NAMESPACE_ID::Metadata Design_ComponentsByNameEntry_DoNotUse::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_design_2eproto_getter, &descriptor_table_design_2eproto_once, + file_level_metadata_design_2eproto[2]); +} + +// =================================================================== + +Design_PartsByNameEntry_DoNotUse::Design_PartsByNameEntry_DoNotUse() {} +Design_PartsByNameEntry_DoNotUse::Design_PartsByNameEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : SuperType(arena) {} +void Design_PartsByNameEntry_DoNotUse::MergeFrom(const Design_PartsByNameEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::PROTOBUF_NAMESPACE_ID::Metadata Design_PartsByNameEntry_DoNotUse::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_design_2eproto_getter, &descriptor_table_design_2eproto_once, + file_level_metadata_design_2eproto[3]); +} // =================================================================== class Design::_Internal { public: using HasBits = decltype(std::declval()._impl_._has_bits_); - static const ::Odb::Lib::Protobuf::FileArchive& filearchive(const Design* msg); - static void set_has_filearchive(HasBits* has_bits) { + static void set_has_productmodel(HasBits* has_bits) { (*has_bits)[0] |= 1u; } + static void set_has_name(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static const ::Odb::Lib::Protobuf::FileArchive& filemodel(const Design* msg); + static void set_has_filemodel(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } }; const ::Odb::Lib::Protobuf::FileArchive& -Design::_Internal::filearchive(const Design* msg) { - return *msg->_impl_.filearchive_; +Design::_Internal::filemodel(const Design* msg) { + return *msg->_impl_.filemodel_; } -void Design::clear_filearchive() { - if (_impl_.filearchive_ != nullptr) _impl_.filearchive_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; +void Design::clear_filemodel() { + if (_impl_.filemodel_ != nullptr) _impl_.filemodel_->Clear(); + _impl_._has_bits_[0] &= ~0x00000004u; +} +void Design::clear_nets() { + _impl_.nets_.Clear(); +} +void Design::clear_netsbyname() { + _impl_.netsbyname_.Clear(); +} +void Design::clear_packages() { + _impl_.packages_.Clear(); +} +void Design::clear_packagesbyname() { + _impl_.packagesbyname_.Clear(); +} +void Design::clear_components() { + _impl_.components_.Clear(); +} +void Design::clear_componentsbyname() { + _impl_.componentsbyname_.Clear(); +} +void Design::clear_parts() { + _impl_.parts_.Clear(); +} +void Design::clear_partsbyname() { + _impl_.partsbyname_.Clear(); } Design::Design(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:Odb.Lib.Protobuf.Design) + if (arena != nullptr && !is_message_owned) { + arena->OwnCustomDestructor(this, &Design::ArenaDtor); + } + // @@protoc_insertion_point(arena_constructor:Odb.Lib.Protobuf.ProductModel.Design) } Design::Design(const Design& from) : ::PROTOBUF_NAMESPACE_ID::Message() { @@ -121,13 +365,43 @@ Design::Design(const Design& from) new (&_impl_) Impl_{ decltype(_impl_._has_bits_){from._impl_._has_bits_} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.filearchive_){nullptr}}; + , decltype(_impl_.nets_){from._impl_.nets_} + , /*decltype(_impl_.netsbyname_)*/{} + , decltype(_impl_.packages_){from._impl_.packages_} + , /*decltype(_impl_.packagesbyname_)*/{} + , decltype(_impl_.components_){from._impl_.components_} + , /*decltype(_impl_.componentsbyname_)*/{} + , decltype(_impl_.parts_){from._impl_.parts_} + , /*decltype(_impl_.partsbyname_)*/{} + , decltype(_impl_.productmodel_){} + , decltype(_impl_.name_){} + , decltype(_impl_.filemodel_){nullptr}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - if (from._internal_has_filearchive()) { - _this->_impl_.filearchive_ = new ::Odb::Lib::Protobuf::FileArchive(*from._impl_.filearchive_); + _this->_impl_.netsbyname_.MergeFrom(from._impl_.netsbyname_); + _this->_impl_.packagesbyname_.MergeFrom(from._impl_.packagesbyname_); + _this->_impl_.componentsbyname_.MergeFrom(from._impl_.componentsbyname_); + _this->_impl_.partsbyname_.MergeFrom(from._impl_.partsbyname_); + _impl_.productmodel_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.productmodel_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_productmodel()) { + _this->_impl_.productmodel_.Set(from._internal_productmodel(), + _this->GetArenaForAllocation()); + } + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_name()) { + _this->_impl_.name_.Set(from._internal_name(), + _this->GetArenaForAllocation()); + } + if (from._internal_has_filemodel()) { + _this->_impl_.filemodel_ = new ::Odb::Lib::Protobuf::FileArchive(*from._impl_.filemodel_); } - // @@protoc_insertion_point(copy_constructor:Odb.Lib.Protobuf.Design) + // @@protoc_insertion_point(copy_constructor:Odb.Lib.Protobuf.ProductModel.Design) } inline void Design::SharedCtor( @@ -137,14 +411,33 @@ inline void Design::SharedCtor( new (&_impl_) Impl_{ decltype(_impl_._has_bits_){} , /*decltype(_impl_._cached_size_)*/{} - , decltype(_impl_.filearchive_){nullptr} + , decltype(_impl_.nets_){arena} + , /*decltype(_impl_.netsbyname_)*/{::_pbi::ArenaInitialized(), arena} + , decltype(_impl_.packages_){arena} + , /*decltype(_impl_.packagesbyname_)*/{::_pbi::ArenaInitialized(), arena} + , decltype(_impl_.components_){arena} + , /*decltype(_impl_.componentsbyname_)*/{::_pbi::ArenaInitialized(), arena} + , decltype(_impl_.parts_){arena} + , /*decltype(_impl_.partsbyname_)*/{::_pbi::ArenaInitialized(), arena} + , decltype(_impl_.productmodel_){} + , decltype(_impl_.name_){} + , decltype(_impl_.filemodel_){nullptr} }; + _impl_.productmodel_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.productmodel_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } Design::~Design() { - // @@protoc_insertion_point(destructor:Odb.Lib.Protobuf.Design) + // @@protoc_insertion_point(destructor:Odb.Lib.Protobuf.ProductModel.Design) if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; + ArenaDtor(this); return; } SharedDtor(); @@ -152,23 +445,60 @@ Design::~Design() { inline void Design::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - if (this != internal_default_instance()) delete _impl_.filearchive_; + _impl_.nets_.~RepeatedPtrField(); + _impl_.netsbyname_.Destruct(); + _impl_.netsbyname_.~MapField(); + _impl_.packages_.~RepeatedPtrField(); + _impl_.packagesbyname_.Destruct(); + _impl_.packagesbyname_.~MapField(); + _impl_.components_.~RepeatedPtrField(); + _impl_.componentsbyname_.Destruct(); + _impl_.componentsbyname_.~MapField(); + _impl_.parts_.~RepeatedPtrField(); + _impl_.partsbyname_.Destruct(); + _impl_.partsbyname_.~MapField(); + _impl_.productmodel_.Destroy(); + _impl_.name_.Destroy(); + if (this != internal_default_instance()) delete _impl_.filemodel_; } +void Design::ArenaDtor(void* object) { + Design* _this = reinterpret_cast< Design* >(object); + _this->_impl_.netsbyname_.Destruct(); + _this->_impl_.packagesbyname_.Destruct(); + _this->_impl_.componentsbyname_.Destruct(); + _this->_impl_.partsbyname_.Destruct(); +} void Design::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } void Design::Clear() { -// @@protoc_insertion_point(message_clear_start:Odb.Lib.Protobuf.Design) +// @@protoc_insertion_point(message_clear_start:Odb.Lib.Protobuf.ProductModel.Design) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + _impl_.nets_.Clear(); + _impl_.netsbyname_.Clear(); + _impl_.packages_.Clear(); + _impl_.packagesbyname_.Clear(); + _impl_.components_.Clear(); + _impl_.componentsbyname_.Clear(); + _impl_.parts_.Clear(); + _impl_.partsbyname_.Clear(); cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - GOOGLE_DCHECK(_impl_.filearchive_ != nullptr); - _impl_.filearchive_->Clear(); + if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x00000001u) { + _impl_.productmodel_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000002u) { + _impl_.name_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000004u) { + GOOGLE_DCHECK(_impl_.filemodel_ != nullptr); + _impl_.filemodel_->Clear(); + } } _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); @@ -181,11 +511,135 @@ const char* Design::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // optional .Odb.Lib.Protobuf.FileArchive fileArchive = 1; + // optional string productModel = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - ptr = ctx->ParseMessage(_internal_mutable_filearchive(), ptr); + auto str = _internal_mutable_productmodel(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "Odb.Lib.Protobuf.ProductModel.Design.productModel")); + } else + goto handle_unusual; + continue; + // optional string name = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_name(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "Odb.Lib.Protobuf.ProductModel.Design.name")); + } else + goto handle_unusual; + continue; + // optional .Odb.Lib.Protobuf.FileArchive fileModel = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + ptr = ctx->ParseMessage(_internal_mutable_filemodel(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // repeated .Odb.Lib.Protobuf.ProductModel.Net nets = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_nets(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); + } else + goto handle_unusual; + continue; + // map netsByName = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(&_impl_.netsbyname_, ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr)); + } else + goto handle_unusual; + continue; + // repeated .Odb.Lib.Protobuf.ProductModel.Package packages = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_packages(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr)); + } else + goto handle_unusual; + continue; + // map packagesByName = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(&_impl_.packagesbyname_, ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<58>(ptr)); + } else + goto handle_unusual; + continue; + // repeated .Odb.Lib.Protobuf.ProductModel.Component components = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_components(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<66>(ptr)); + } else + goto handle_unusual; + continue; + // map componentsByName = 9; + case 9: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 74)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(&_impl_.componentsbyname_, ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<74>(ptr)); + } else + goto handle_unusual; + continue; + // repeated .Odb.Lib.Protobuf.ProductModel.Part parts = 10; + case 10: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 82)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_parts(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<82>(ptr)); + } else + goto handle_unusual; + continue; + // map partsByName = 11; + case 11: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 90)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(&_impl_.partsbyname_, ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<90>(ptr)); } else goto handle_unusual; continue; @@ -215,41 +669,277 @@ const char* Design::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { uint8_t* Design::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:Odb.Lib.Protobuf.Design) + // @@protoc_insertion_point(serialize_to_array_start:Odb.Lib.Protobuf.ProductModel.Design) uint32_t cached_has_bits = 0; (void) cached_has_bits; - // optional .Odb.Lib.Protobuf.FileArchive fileArchive = 1; - if (_internal_has_filearchive()) { + // optional string productModel = 1; + if (_internal_has_productmodel()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_productmodel().data(), static_cast(this->_internal_productmodel().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "Odb.Lib.Protobuf.ProductModel.Design.productModel"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_productmodel(), target); + } + + // optional string name = 2; + if (_internal_has_name()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_name().data(), static_cast(this->_internal_name().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "Odb.Lib.Protobuf.ProductModel.Design.name"); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_name(), target); + } + + // optional .Odb.Lib.Protobuf.FileArchive fileModel = 3; + if (_internal_has_filemodel()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::filemodel(this), + _Internal::filemodel(this).GetCachedSize(), target, stream); + } + + // repeated .Odb.Lib.Protobuf.ProductModel.Net nets = 4; + for (unsigned i = 0, + n = static_cast(this->_internal_nets_size()); i < n; i++) { + const auto& repfield = this->_internal_nets(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(4, repfield, repfield.GetCachedSize(), target, stream); + } + + // map netsByName = 5; + if (!this->_internal_netsbyname().empty()) { + using MapType = ::_pb::Map; + using WireHelper = Design_NetsByNameEntry_DoNotUse::Funcs; + const auto& map_field = this->_internal_netsbyname(); + auto check_utf8 = [](const MapType::value_type& entry) { + (void)entry; + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + entry.first.data(), static_cast(entry.first.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "Odb.Lib.Protobuf.ProductModel.Design.NetsByNameEntry.key"); + }; + + if (stream->IsSerializationDeterministic() && map_field.size() > 1) { + for (const auto& entry : ::_pbi::MapSorterPtr(map_field)) { + target = WireHelper::InternalSerialize(5, entry.first, entry.second, target, stream); + check_utf8(entry); + } + } else { + for (const auto& entry : map_field) { + target = WireHelper::InternalSerialize(5, entry.first, entry.second, target, stream); + check_utf8(entry); + } + } + } + + // repeated .Odb.Lib.Protobuf.ProductModel.Package packages = 6; + for (unsigned i = 0, + n = static_cast(this->_internal_packages_size()); i < n; i++) { + const auto& repfield = this->_internal_packages(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(6, repfield, repfield.GetCachedSize(), target, stream); + } + + // map packagesByName = 7; + if (!this->_internal_packagesbyname().empty()) { + using MapType = ::_pb::Map; + using WireHelper = Design_PackagesByNameEntry_DoNotUse::Funcs; + const auto& map_field = this->_internal_packagesbyname(); + auto check_utf8 = [](const MapType::value_type& entry) { + (void)entry; + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + entry.first.data(), static_cast(entry.first.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "Odb.Lib.Protobuf.ProductModel.Design.PackagesByNameEntry.key"); + }; + + if (stream->IsSerializationDeterministic() && map_field.size() > 1) { + for (const auto& entry : ::_pbi::MapSorterPtr(map_field)) { + target = WireHelper::InternalSerialize(7, entry.first, entry.second, target, stream); + check_utf8(entry); + } + } else { + for (const auto& entry : map_field) { + target = WireHelper::InternalSerialize(7, entry.first, entry.second, target, stream); + check_utf8(entry); + } + } + } + + // repeated .Odb.Lib.Protobuf.ProductModel.Component components = 8; + for (unsigned i = 0, + n = static_cast(this->_internal_components_size()); i < n; i++) { + const auto& repfield = this->_internal_components(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(1, _Internal::filearchive(this), - _Internal::filearchive(this).GetCachedSize(), target, stream); + InternalWriteMessage(8, repfield, repfield.GetCachedSize(), target, stream); + } + + // map componentsByName = 9; + if (!this->_internal_componentsbyname().empty()) { + using MapType = ::_pb::Map; + using WireHelper = Design_ComponentsByNameEntry_DoNotUse::Funcs; + const auto& map_field = this->_internal_componentsbyname(); + auto check_utf8 = [](const MapType::value_type& entry) { + (void)entry; + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + entry.first.data(), static_cast(entry.first.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "Odb.Lib.Protobuf.ProductModel.Design.ComponentsByNameEntry.key"); + }; + + if (stream->IsSerializationDeterministic() && map_field.size() > 1) { + for (const auto& entry : ::_pbi::MapSorterPtr(map_field)) { + target = WireHelper::InternalSerialize(9, entry.first, entry.second, target, stream); + check_utf8(entry); + } + } else { + for (const auto& entry : map_field) { + target = WireHelper::InternalSerialize(9, entry.first, entry.second, target, stream); + check_utf8(entry); + } + } + } + + // repeated .Odb.Lib.Protobuf.ProductModel.Part parts = 10; + for (unsigned i = 0, + n = static_cast(this->_internal_parts_size()); i < n; i++) { + const auto& repfield = this->_internal_parts(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(10, repfield, repfield.GetCachedSize(), target, stream); + } + + // map partsByName = 11; + if (!this->_internal_partsbyname().empty()) { + using MapType = ::_pb::Map; + using WireHelper = Design_PartsByNameEntry_DoNotUse::Funcs; + const auto& map_field = this->_internal_partsbyname(); + auto check_utf8 = [](const MapType::value_type& entry) { + (void)entry; + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + entry.first.data(), static_cast(entry.first.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "Odb.Lib.Protobuf.ProductModel.Design.PartsByNameEntry.key"); + }; + + if (stream->IsSerializationDeterministic() && map_field.size() > 1) { + for (const auto& entry : ::_pbi::MapSorterPtr(map_field)) { + target = WireHelper::InternalSerialize(11, entry.first, entry.second, target, stream); + check_utf8(entry); + } + } else { + for (const auto& entry : map_field) { + target = WireHelper::InternalSerialize(11, entry.first, entry.second, target, stream); + check_utf8(entry); + } + } } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:Odb.Lib.Protobuf.Design) + // @@protoc_insertion_point(serialize_to_array_end:Odb.Lib.Protobuf.ProductModel.Design) return target; } size_t Design::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:Odb.Lib.Protobuf.Design) +// @@protoc_insertion_point(message_byte_size_start:Odb.Lib.Protobuf.ProductModel.Design) size_t total_size = 0; uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // optional .Odb.Lib.Protobuf.FileArchive fileArchive = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.filearchive_); + // repeated .Odb.Lib.Protobuf.ProductModel.Net nets = 4; + total_size += 1UL * this->_internal_nets_size(); + for (const auto& msg : this->_impl_.nets_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + // map netsByName = 5; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_netsbyname_size()); + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Net >::const_iterator + it = this->_internal_netsbyname().begin(); + it != this->_internal_netsbyname().end(); ++it) { + total_size += Design_NetsByNameEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second); + } + + // repeated .Odb.Lib.Protobuf.ProductModel.Package packages = 6; + total_size += 1UL * this->_internal_packages_size(); + for (const auto& msg : this->_impl_.packages_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + // map packagesByName = 7; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_packagesbyname_size()); + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Package >::const_iterator + it = this->_internal_packagesbyname().begin(); + it != this->_internal_packagesbyname().end(); ++it) { + total_size += Design_PackagesByNameEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second); + } + + // repeated .Odb.Lib.Protobuf.ProductModel.Component components = 8; + total_size += 1UL * this->_internal_components_size(); + for (const auto& msg : this->_impl_.components_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); } + // map componentsByName = 9; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_componentsbyname_size()); + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Component >::const_iterator + it = this->_internal_componentsbyname().begin(); + it != this->_internal_componentsbyname().end(); ++it) { + total_size += Design_ComponentsByNameEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second); + } + + // repeated .Odb.Lib.Protobuf.ProductModel.Part parts = 10; + total_size += 1UL * this->_internal_parts_size(); + for (const auto& msg : this->_impl_.parts_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + // map partsByName = 11; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_partsbyname_size()); + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Part >::const_iterator + it = this->_internal_partsbyname().begin(); + it != this->_internal_partsbyname().end(); ++it) { + total_size += Design_PartsByNameEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second); + } + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000007u) { + // optional string productModel = 1; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_productmodel()); + } + + // optional string name = 2; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); + } + + // optional .Odb.Lib.Protobuf.FileArchive fileModel = 3; + if (cached_has_bits & 0x00000004u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.filemodel_); + } + + } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -263,20 +953,37 @@ const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Design::GetClassData() const { void Design::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { auto* const _this = static_cast(&to_msg); auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:Odb.Lib.Protobuf.Design) + // @@protoc_insertion_point(class_specific_merge_from_start:Odb.Lib.Protobuf.ProductModel.Design) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; - if (from._internal_has_filearchive()) { - _this->_internal_mutable_filearchive()->::Odb::Lib::Protobuf::FileArchive::MergeFrom( - from._internal_filearchive()); + _this->_impl_.nets_.MergeFrom(from._impl_.nets_); + _this->_impl_.netsbyname_.MergeFrom(from._impl_.netsbyname_); + _this->_impl_.packages_.MergeFrom(from._impl_.packages_); + _this->_impl_.packagesbyname_.MergeFrom(from._impl_.packagesbyname_); + _this->_impl_.components_.MergeFrom(from._impl_.components_); + _this->_impl_.componentsbyname_.MergeFrom(from._impl_.componentsbyname_); + _this->_impl_.parts_.MergeFrom(from._impl_.parts_); + _this->_impl_.partsbyname_.MergeFrom(from._impl_.partsbyname_); + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_set_productmodel(from._internal_productmodel()); + } + if (cached_has_bits & 0x00000002u) { + _this->_internal_set_name(from._internal_name()); + } + if (cached_has_bits & 0x00000004u) { + _this->_internal_mutable_filemodel()->::Odb::Lib::Protobuf::FileArchive::MergeFrom( + from._internal_filemodel()); + } } _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } void Design::CopyFrom(const Design& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:Odb.Lib.Protobuf.Design) +// @@protoc_insertion_point(class_specific_copy_from_start:Odb.Lib.Protobuf.ProductModel.Design) if (&from == this) return; Clear(); MergeFrom(from); @@ -288,25 +995,60 @@ bool Design::IsInitialized() const { void Design::InternalSwap(Design* other) { using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - swap(_impl_.filearchive_, other->_impl_.filearchive_); + _impl_.nets_.InternalSwap(&other->_impl_.nets_); + _impl_.netsbyname_.InternalSwap(&other->_impl_.netsbyname_); + _impl_.packages_.InternalSwap(&other->_impl_.packages_); + _impl_.packagesbyname_.InternalSwap(&other->_impl_.packagesbyname_); + _impl_.components_.InternalSwap(&other->_impl_.components_); + _impl_.componentsbyname_.InternalSwap(&other->_impl_.componentsbyname_); + _impl_.parts_.InternalSwap(&other->_impl_.parts_); + _impl_.partsbyname_.InternalSwap(&other->_impl_.partsbyname_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.productmodel_, lhs_arena, + &other->_impl_.productmodel_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.name_, lhs_arena, + &other->_impl_.name_, rhs_arena + ); + swap(_impl_.filemodel_, other->_impl_.filemodel_); } ::PROTOBUF_NAMESPACE_ID::Metadata Design::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_design_2eproto_getter, &descriptor_table_design_2eproto_once, - file_level_metadata_design_2eproto[0]); + file_level_metadata_design_2eproto[4]); } // @@protoc_insertion_point(namespace_scope) +} // namespace ProductModel } // namespace Protobuf } // namespace Lib } // namespace Odb PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE ::Odb::Lib::Protobuf::Design* -Arena::CreateMaybeMessage< ::Odb::Lib::Protobuf::Design >(Arena* arena) { - return Arena::CreateMessageInternal< ::Odb::Lib::Protobuf::Design >(arena); +template<> PROTOBUF_NOINLINE ::Odb::Lib::Protobuf::ProductModel::Design_NetsByNameEntry_DoNotUse* +Arena::CreateMaybeMessage< ::Odb::Lib::Protobuf::ProductModel::Design_NetsByNameEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::Odb::Lib::Protobuf::ProductModel::Design_NetsByNameEntry_DoNotUse >(arena); +} +template<> PROTOBUF_NOINLINE ::Odb::Lib::Protobuf::ProductModel::Design_PackagesByNameEntry_DoNotUse* +Arena::CreateMaybeMessage< ::Odb::Lib::Protobuf::ProductModel::Design_PackagesByNameEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::Odb::Lib::Protobuf::ProductModel::Design_PackagesByNameEntry_DoNotUse >(arena); +} +template<> PROTOBUF_NOINLINE ::Odb::Lib::Protobuf::ProductModel::Design_ComponentsByNameEntry_DoNotUse* +Arena::CreateMaybeMessage< ::Odb::Lib::Protobuf::ProductModel::Design_ComponentsByNameEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::Odb::Lib::Protobuf::ProductModel::Design_ComponentsByNameEntry_DoNotUse >(arena); +} +template<> PROTOBUF_NOINLINE ::Odb::Lib::Protobuf::ProductModel::Design_PartsByNameEntry_DoNotUse* +Arena::CreateMaybeMessage< ::Odb::Lib::Protobuf::ProductModel::Design_PartsByNameEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::Odb::Lib::Protobuf::ProductModel::Design_PartsByNameEntry_DoNotUse >(arena); +} +template<> PROTOBUF_NOINLINE ::Odb::Lib::Protobuf::ProductModel::Design* +Arena::CreateMaybeMessage< ::Odb::Lib::Protobuf::ProductModel::Design >(Arena* arena) { + return Arena::CreateMessageInternal< ::Odb::Lib::Protobuf::ProductModel::Design >(arena); } PROTOBUF_NAMESPACE_CLOSE diff --git a/OdbDesignLib/ProtoBuf/design.pb.h b/OdbDesignLib/ProtoBuf/design.pb.h index 45a1d1e2..880e65fb 100644 --- a/OdbDesignLib/ProtoBuf/design.pb.h +++ b/OdbDesignLib/ProtoBuf/design.pb.h @@ -29,8 +29,15 @@ #include #include // IWYU pragma: export #include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include #include #include "filearchive.pb.h" +#include "net.pb.h" +#include "package.pb.h" +#include "component.pb.h" +#include "part.pb.h" // @@protoc_insertion_point(includes) #include #define PROTOBUF_INTERNAL_EXPORT_design_2eproto @@ -48,23 +55,146 @@ extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table namespace Odb { namespace Lib { namespace Protobuf { +namespace ProductModel { class Design; struct DesignDefaultTypeInternal; extern DesignDefaultTypeInternal _Design_default_instance_; +class Design_ComponentsByNameEntry_DoNotUse; +struct Design_ComponentsByNameEntry_DoNotUseDefaultTypeInternal; +extern Design_ComponentsByNameEntry_DoNotUseDefaultTypeInternal _Design_ComponentsByNameEntry_DoNotUse_default_instance_; +class Design_NetsByNameEntry_DoNotUse; +struct Design_NetsByNameEntry_DoNotUseDefaultTypeInternal; +extern Design_NetsByNameEntry_DoNotUseDefaultTypeInternal _Design_NetsByNameEntry_DoNotUse_default_instance_; +class Design_PackagesByNameEntry_DoNotUse; +struct Design_PackagesByNameEntry_DoNotUseDefaultTypeInternal; +extern Design_PackagesByNameEntry_DoNotUseDefaultTypeInternal _Design_PackagesByNameEntry_DoNotUse_default_instance_; +class Design_PartsByNameEntry_DoNotUse; +struct Design_PartsByNameEntry_DoNotUseDefaultTypeInternal; +extern Design_PartsByNameEntry_DoNotUseDefaultTypeInternal _Design_PartsByNameEntry_DoNotUse_default_instance_; +} // namespace ProductModel } // namespace Protobuf } // namespace Lib } // namespace Odb PROTOBUF_NAMESPACE_OPEN -template<> ::Odb::Lib::Protobuf::Design* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::Design>(Arena*); +template<> ::Odb::Lib::Protobuf::ProductModel::Design* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Design>(Arena*); +template<> ::Odb::Lib::Protobuf::ProductModel::Design_ComponentsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Design_ComponentsByNameEntry_DoNotUse>(Arena*); +template<> ::Odb::Lib::Protobuf::ProductModel::Design_NetsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Design_NetsByNameEntry_DoNotUse>(Arena*); +template<> ::Odb::Lib::Protobuf::ProductModel::Design_PackagesByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Design_PackagesByNameEntry_DoNotUse>(Arena*); +template<> ::Odb::Lib::Protobuf::ProductModel::Design_PartsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Design_PartsByNameEntry_DoNotUse>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { namespace Protobuf { +namespace ProductModel { // =================================================================== +class Design_NetsByNameEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry { +public: + typedef ::PROTOBUF_NAMESPACE_ID::internal::MapEntry SuperType; + Design_NetsByNameEntry_DoNotUse(); + explicit PROTOBUF_CONSTEXPR Design_NetsByNameEntry_DoNotUse( + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit Design_NetsByNameEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena); + void MergeFrom(const Design_NetsByNameEntry_DoNotUse& other); + static const Design_NetsByNameEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_Design_NetsByNameEntry_DoNotUse_default_instance_); } + static bool ValidateKey(std::string* s) { + return ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(s->data(), static_cast(s->size()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "Odb.Lib.Protobuf.ProductModel.Design.NetsByNameEntry.key"); + } + static bool ValidateValue(void*) { return true; } + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + friend struct ::TableStruct_design_2eproto; +}; + +// ------------------------------------------------------------------- + +class Design_PackagesByNameEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry { +public: + typedef ::PROTOBUF_NAMESPACE_ID::internal::MapEntry SuperType; + Design_PackagesByNameEntry_DoNotUse(); + explicit PROTOBUF_CONSTEXPR Design_PackagesByNameEntry_DoNotUse( + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit Design_PackagesByNameEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena); + void MergeFrom(const Design_PackagesByNameEntry_DoNotUse& other); + static const Design_PackagesByNameEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_Design_PackagesByNameEntry_DoNotUse_default_instance_); } + static bool ValidateKey(std::string* s) { + return ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(s->data(), static_cast(s->size()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "Odb.Lib.Protobuf.ProductModel.Design.PackagesByNameEntry.key"); + } + static bool ValidateValue(void*) { return true; } + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + friend struct ::TableStruct_design_2eproto; +}; + +// ------------------------------------------------------------------- + +class Design_ComponentsByNameEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry { +public: + typedef ::PROTOBUF_NAMESPACE_ID::internal::MapEntry SuperType; + Design_ComponentsByNameEntry_DoNotUse(); + explicit PROTOBUF_CONSTEXPR Design_ComponentsByNameEntry_DoNotUse( + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit Design_ComponentsByNameEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena); + void MergeFrom(const Design_ComponentsByNameEntry_DoNotUse& other); + static const Design_ComponentsByNameEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_Design_ComponentsByNameEntry_DoNotUse_default_instance_); } + static bool ValidateKey(std::string* s) { + return ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(s->data(), static_cast(s->size()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "Odb.Lib.Protobuf.ProductModel.Design.ComponentsByNameEntry.key"); + } + static bool ValidateValue(void*) { return true; } + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + friend struct ::TableStruct_design_2eproto; +}; + +// ------------------------------------------------------------------- + +class Design_PartsByNameEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry { +public: + typedef ::PROTOBUF_NAMESPACE_ID::internal::MapEntry SuperType; + Design_PartsByNameEntry_DoNotUse(); + explicit PROTOBUF_CONSTEXPR Design_PartsByNameEntry_DoNotUse( + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit Design_PartsByNameEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena); + void MergeFrom(const Design_PartsByNameEntry_DoNotUse& other); + static const Design_PartsByNameEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_Design_PartsByNameEntry_DoNotUse_default_instance_); } + static bool ValidateKey(std::string* s) { + return ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(s->data(), static_cast(s->size()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "Odb.Lib.Protobuf.ProductModel.Design.PartsByNameEntry.key"); + } + static bool ValidateValue(void*) { return true; } + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + friend struct ::TableStruct_design_2eproto; +}; + +// ------------------------------------------------------------------- + class Design final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.Design) */ { + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.ProductModel.Design) */ { public: inline Design() : Design(nullptr) {} ~Design() override; @@ -111,7 +241,7 @@ class Design final : &_Design_default_instance_); } static constexpr int kIndexInFileMessages = - 0; + 4; friend void swap(Design& a, Design& b) { a.Swap(&b); @@ -167,11 +297,13 @@ class Design final : private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "Odb.Lib.Protobuf.Design"; + return "Odb.Lib.Protobuf.ProductModel.Design"; } protected: explicit Design(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); + private: + static void ArenaDtor(void* object); public: static const ClassData _class_data_; @@ -181,30 +313,217 @@ class Design final : // nested types ---------------------------------------------------- + // accessors ------------------------------------------------------- enum : int { - kFileArchiveFieldNumber = 1, + kNetsFieldNumber = 4, + kNetsByNameFieldNumber = 5, + kPackagesFieldNumber = 6, + kPackagesByNameFieldNumber = 7, + kComponentsFieldNumber = 8, + kComponentsByNameFieldNumber = 9, + kPartsFieldNumber = 10, + kPartsByNameFieldNumber = 11, + kProductModelFieldNumber = 1, + kNameFieldNumber = 2, + kFileModelFieldNumber = 3, }; - // optional .Odb.Lib.Protobuf.FileArchive fileArchive = 1; - bool has_filearchive() const; + // repeated .Odb.Lib.Protobuf.ProductModel.Net nets = 4; + int nets_size() const; + private: + int _internal_nets_size() const; + public: + void clear_nets(); + ::Odb::Lib::Protobuf::ProductModel::Net* mutable_nets(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Net >* + mutable_nets(); + private: + const ::Odb::Lib::Protobuf::ProductModel::Net& _internal_nets(int index) const; + ::Odb::Lib::Protobuf::ProductModel::Net* _internal_add_nets(); + public: + const ::Odb::Lib::Protobuf::ProductModel::Net& nets(int index) const; + ::Odb::Lib::Protobuf::ProductModel::Net* add_nets(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Net >& + nets() const; + + // map netsByName = 5; + int netsbyname_size() const; + private: + int _internal_netsbyname_size() const; + public: + void clear_netsbyname(); + private: + const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Net >& + _internal_netsbyname() const; + ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Net >* + _internal_mutable_netsbyname(); + public: + const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Net >& + netsbyname() const; + ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Net >* + mutable_netsbyname(); + + // repeated .Odb.Lib.Protobuf.ProductModel.Package packages = 6; + int packages_size() const; + private: + int _internal_packages_size() const; + public: + void clear_packages(); + ::Odb::Lib::Protobuf::ProductModel::Package* mutable_packages(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Package >* + mutable_packages(); + private: + const ::Odb::Lib::Protobuf::ProductModel::Package& _internal_packages(int index) const; + ::Odb::Lib::Protobuf::ProductModel::Package* _internal_add_packages(); + public: + const ::Odb::Lib::Protobuf::ProductModel::Package& packages(int index) const; + ::Odb::Lib::Protobuf::ProductModel::Package* add_packages(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Package >& + packages() const; + + // map packagesByName = 7; + int packagesbyname_size() const; + private: + int _internal_packagesbyname_size() const; + public: + void clear_packagesbyname(); + private: + const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Package >& + _internal_packagesbyname() const; + ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Package >* + _internal_mutable_packagesbyname(); + public: + const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Package >& + packagesbyname() const; + ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Package >* + mutable_packagesbyname(); + + // repeated .Odb.Lib.Protobuf.ProductModel.Component components = 8; + int components_size() const; + private: + int _internal_components_size() const; + public: + void clear_components(); + ::Odb::Lib::Protobuf::ProductModel::Component* mutable_components(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Component >* + mutable_components(); + private: + const ::Odb::Lib::Protobuf::ProductModel::Component& _internal_components(int index) const; + ::Odb::Lib::Protobuf::ProductModel::Component* _internal_add_components(); + public: + const ::Odb::Lib::Protobuf::ProductModel::Component& components(int index) const; + ::Odb::Lib::Protobuf::ProductModel::Component* add_components(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Component >& + components() const; + + // map componentsByName = 9; + int componentsbyname_size() const; private: - bool _internal_has_filearchive() const; + int _internal_componentsbyname_size() const; public: - void clear_filearchive(); - const ::Odb::Lib::Protobuf::FileArchive& filearchive() const; - PROTOBUF_NODISCARD ::Odb::Lib::Protobuf::FileArchive* release_filearchive(); - ::Odb::Lib::Protobuf::FileArchive* mutable_filearchive(); - void set_allocated_filearchive(::Odb::Lib::Protobuf::FileArchive* filearchive); + void clear_componentsbyname(); private: - const ::Odb::Lib::Protobuf::FileArchive& _internal_filearchive() const; - ::Odb::Lib::Protobuf::FileArchive* _internal_mutable_filearchive(); + const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Component >& + _internal_componentsbyname() const; + ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Component >* + _internal_mutable_componentsbyname(); public: - void unsafe_arena_set_allocated_filearchive( - ::Odb::Lib::Protobuf::FileArchive* filearchive); - ::Odb::Lib::Protobuf::FileArchive* unsafe_arena_release_filearchive(); + const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Component >& + componentsbyname() const; + ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Component >* + mutable_componentsbyname(); - // @@protoc_insertion_point(class_scope:Odb.Lib.Protobuf.Design) + // repeated .Odb.Lib.Protobuf.ProductModel.Part parts = 10; + int parts_size() const; + private: + int _internal_parts_size() const; + public: + void clear_parts(); + ::Odb::Lib::Protobuf::ProductModel::Part* mutable_parts(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Part >* + mutable_parts(); + private: + const ::Odb::Lib::Protobuf::ProductModel::Part& _internal_parts(int index) const; + ::Odb::Lib::Protobuf::ProductModel::Part* _internal_add_parts(); + public: + const ::Odb::Lib::Protobuf::ProductModel::Part& parts(int index) const; + ::Odb::Lib::Protobuf::ProductModel::Part* add_parts(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Part >& + parts() const; + + // map partsByName = 11; + int partsbyname_size() const; + private: + int _internal_partsbyname_size() const; + public: + void clear_partsbyname(); + private: + const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Part >& + _internal_partsbyname() const; + ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Part >* + _internal_mutable_partsbyname(); + public: + const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Part >& + partsbyname() const; + ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Part >* + mutable_partsbyname(); + + // optional string productModel = 1; + bool has_productmodel() const; + private: + bool _internal_has_productmodel() const; + public: + void clear_productmodel(); + const std::string& productmodel() const; + template + void set_productmodel(ArgT0&& arg0, ArgT... args); + std::string* mutable_productmodel(); + PROTOBUF_NODISCARD std::string* release_productmodel(); + void set_allocated_productmodel(std::string* productmodel); + private: + const std::string& _internal_productmodel() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_productmodel(const std::string& value); + std::string* _internal_mutable_productmodel(); + public: + + // optional string name = 2; + bool has_name() const; + private: + bool _internal_has_name() const; + public: + void clear_name(); + const std::string& name() const; + template + void set_name(ArgT0&& arg0, ArgT... args); + std::string* mutable_name(); + PROTOBUF_NODISCARD std::string* release_name(); + void set_allocated_name(std::string* name); + private: + const std::string& _internal_name() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); + std::string* _internal_mutable_name(); + public: + + // optional .Odb.Lib.Protobuf.FileArchive fileModel = 3; + bool has_filemodel() const; + private: + bool _internal_has_filemodel() const; + public: + void clear_filemodel(); + const ::Odb::Lib::Protobuf::FileArchive& filemodel() const; + PROTOBUF_NODISCARD ::Odb::Lib::Protobuf::FileArchive* release_filemodel(); + ::Odb::Lib::Protobuf::FileArchive* mutable_filemodel(); + void set_allocated_filemodel(::Odb::Lib::Protobuf::FileArchive* filemodel); + private: + const ::Odb::Lib::Protobuf::FileArchive& _internal_filemodel() const; + ::Odb::Lib::Protobuf::FileArchive* _internal_mutable_filemodel(); + public: + void unsafe_arena_set_allocated_filemodel( + ::Odb::Lib::Protobuf::FileArchive* filemodel); + ::Odb::Lib::Protobuf::FileArchive* unsafe_arena_release_filemodel(); + + // @@protoc_insertion_point(class_scope:Odb.Lib.Protobuf.ProductModel.Design) private: class _Internal; @@ -214,7 +533,33 @@ class Design final : struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::Odb::Lib::Protobuf::FileArchive* filearchive_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Net > nets_; + ::PROTOBUF_NAMESPACE_ID::internal::MapField< + Design_NetsByNameEntry_DoNotUse, + std::string, ::Odb::Lib::Protobuf::ProductModel::Net, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE> netsbyname_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Package > packages_; + ::PROTOBUF_NAMESPACE_ID::internal::MapField< + Design_PackagesByNameEntry_DoNotUse, + std::string, ::Odb::Lib::Protobuf::ProductModel::Package, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE> packagesbyname_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Component > components_; + ::PROTOBUF_NAMESPACE_ID::internal::MapField< + Design_ComponentsByNameEntry_DoNotUse, + std::string, ::Odb::Lib::Protobuf::ProductModel::Component, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE> componentsbyname_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Part > parts_; + ::PROTOBUF_NAMESPACE_ID::internal::MapField< + Design_PartsByNameEntry_DoNotUse, + std::string, ::Odb::Lib::Protobuf::ProductModel::Part, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE> partsbyname_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr productmodel_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::Odb::Lib::Protobuf::FileArchive* filemodel_; }; union { Impl_ _impl_; }; friend struct ::TableStruct_design_2eproto; @@ -228,43 +573,187 @@ class Design final : #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + // Design -// optional .Odb.Lib.Protobuf.FileArchive fileArchive = 1; -inline bool Design::_internal_has_filearchive() const { +// optional string productModel = 1; +inline bool Design::_internal_has_productmodel() const { bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.filearchive_ != nullptr); return value; } -inline bool Design::has_filearchive() const { - return _internal_has_filearchive(); +inline bool Design::has_productmodel() const { + return _internal_has_productmodel(); +} +inline void Design::clear_productmodel() { + _impl_.productmodel_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& Design::productmodel() const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Design.productModel) + return _internal_productmodel(); } -inline const ::Odb::Lib::Protobuf::FileArchive& Design::_internal_filearchive() const { - const ::Odb::Lib::Protobuf::FileArchive* p = _impl_.filearchive_; +template +inline PROTOBUF_ALWAYS_INLINE +void Design::set_productmodel(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.productmodel_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:Odb.Lib.Protobuf.ProductModel.Design.productModel) +} +inline std::string* Design::mutable_productmodel() { + std::string* _s = _internal_mutable_productmodel(); + // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.ProductModel.Design.productModel) + return _s; +} +inline const std::string& Design::_internal_productmodel() const { + return _impl_.productmodel_.Get(); +} +inline void Design::_internal_set_productmodel(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.productmodel_.Set(value, GetArenaForAllocation()); +} +inline std::string* Design::_internal_mutable_productmodel() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.productmodel_.Mutable(GetArenaForAllocation()); +} +inline std::string* Design::release_productmodel() { + // @@protoc_insertion_point(field_release:Odb.Lib.Protobuf.ProductModel.Design.productModel) + if (!_internal_has_productmodel()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.productmodel_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.productmodel_.IsDefault()) { + _impl_.productmodel_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void Design::set_allocated_productmodel(std::string* productmodel) { + if (productmodel != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.productmodel_.SetAllocated(productmodel, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.productmodel_.IsDefault()) { + _impl_.productmodel_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:Odb.Lib.Protobuf.ProductModel.Design.productModel) +} + +// optional string name = 2; +inline bool Design::_internal_has_name() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool Design::has_name() const { + return _internal_has_name(); +} +inline void Design::clear_name() { + _impl_.name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline const std::string& Design::name() const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Design.name) + return _internal_name(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void Design::set_name(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:Odb.Lib.Protobuf.ProductModel.Design.name) +} +inline std::string* Design::mutable_name() { + std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.ProductModel.Design.name) + return _s; +} +inline const std::string& Design::_internal_name() const { + return _impl_.name_.Get(); +} +inline void Design::_internal_set_name(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.name_.Set(value, GetArenaForAllocation()); +} +inline std::string* Design::_internal_mutable_name() { + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.name_.Mutable(GetArenaForAllocation()); +} +inline std::string* Design::release_name() { + // @@protoc_insertion_point(field_release:Odb.Lib.Protobuf.ProductModel.Design.name) + if (!_internal_has_name()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000002u; + auto* p = _impl_.name_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void Design::set_allocated_name(std::string* name) { + if (name != nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:Odb.Lib.Protobuf.ProductModel.Design.name) +} + +// optional .Odb.Lib.Protobuf.FileArchive fileModel = 3; +inline bool Design::_internal_has_filemodel() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + PROTOBUF_ASSUME(!value || _impl_.filemodel_ != nullptr); + return value; +} +inline bool Design::has_filemodel() const { + return _internal_has_filemodel(); +} +inline const ::Odb::Lib::Protobuf::FileArchive& Design::_internal_filemodel() const { + const ::Odb::Lib::Protobuf::FileArchive* p = _impl_.filemodel_; return p != nullptr ? *p : reinterpret_cast( ::Odb::Lib::Protobuf::_FileArchive_default_instance_); } -inline const ::Odb::Lib::Protobuf::FileArchive& Design::filearchive() const { - // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.Design.fileArchive) - return _internal_filearchive(); +inline const ::Odb::Lib::Protobuf::FileArchive& Design::filemodel() const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Design.fileModel) + return _internal_filemodel(); } -inline void Design::unsafe_arena_set_allocated_filearchive( - ::Odb::Lib::Protobuf::FileArchive* filearchive) { +inline void Design::unsafe_arena_set_allocated_filemodel( + ::Odb::Lib::Protobuf::FileArchive* filemodel) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.filearchive_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.filemodel_); } - _impl_.filearchive_ = filearchive; - if (filearchive) { - _impl_._has_bits_[0] |= 0x00000001u; + _impl_.filemodel_ = filemodel; + if (filemodel) { + _impl_._has_bits_[0] |= 0x00000004u; } else { - _impl_._has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000004u; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:Odb.Lib.Protobuf.Design.fileArchive) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:Odb.Lib.Protobuf.ProductModel.Design.fileModel) } -inline ::Odb::Lib::Protobuf::FileArchive* Design::release_filearchive() { - _impl_._has_bits_[0] &= ~0x00000001u; - ::Odb::Lib::Protobuf::FileArchive* temp = _impl_.filearchive_; - _impl_.filearchive_ = nullptr; +inline ::Odb::Lib::Protobuf::FileArchive* Design::release_filemodel() { + _impl_._has_bits_[0] &= ~0x00000004u; + ::Odb::Lib::Protobuf::FileArchive* temp = _impl_.filemodel_; + _impl_.filemodel_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -276,53 +765,314 @@ inline ::Odb::Lib::Protobuf::FileArchive* Design::release_filearchive() { #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::Odb::Lib::Protobuf::FileArchive* Design::unsafe_arena_release_filearchive() { - // @@protoc_insertion_point(field_release:Odb.Lib.Protobuf.Design.fileArchive) - _impl_._has_bits_[0] &= ~0x00000001u; - ::Odb::Lib::Protobuf::FileArchive* temp = _impl_.filearchive_; - _impl_.filearchive_ = nullptr; +inline ::Odb::Lib::Protobuf::FileArchive* Design::unsafe_arena_release_filemodel() { + // @@protoc_insertion_point(field_release:Odb.Lib.Protobuf.ProductModel.Design.fileModel) + _impl_._has_bits_[0] &= ~0x00000004u; + ::Odb::Lib::Protobuf::FileArchive* temp = _impl_.filemodel_; + _impl_.filemodel_ = nullptr; return temp; } -inline ::Odb::Lib::Protobuf::FileArchive* Design::_internal_mutable_filearchive() { - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.filearchive_ == nullptr) { +inline ::Odb::Lib::Protobuf::FileArchive* Design::_internal_mutable_filemodel() { + _impl_._has_bits_[0] |= 0x00000004u; + if (_impl_.filemodel_ == nullptr) { auto* p = CreateMaybeMessage<::Odb::Lib::Protobuf::FileArchive>(GetArenaForAllocation()); - _impl_.filearchive_ = p; + _impl_.filemodel_ = p; } - return _impl_.filearchive_; + return _impl_.filemodel_; } -inline ::Odb::Lib::Protobuf::FileArchive* Design::mutable_filearchive() { - ::Odb::Lib::Protobuf::FileArchive* _msg = _internal_mutable_filearchive(); - // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.Design.fileArchive) +inline ::Odb::Lib::Protobuf::FileArchive* Design::mutable_filemodel() { + ::Odb::Lib::Protobuf::FileArchive* _msg = _internal_mutable_filemodel(); + // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.ProductModel.Design.fileModel) return _msg; } -inline void Design::set_allocated_filearchive(::Odb::Lib::Protobuf::FileArchive* filearchive) { +inline void Design::set_allocated_filemodel(::Odb::Lib::Protobuf::FileArchive* filemodel) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.filearchive_); + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.filemodel_); } - if (filearchive) { + if (filemodel) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( - reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(filearchive)); + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(filemodel)); if (message_arena != submessage_arena) { - filearchive = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, filearchive, submessage_arena); + filemodel = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, filemodel, submessage_arena); } - _impl_._has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000004u; } else { - _impl_._has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000004u; } - _impl_.filearchive_ = filearchive; - // @@protoc_insertion_point(field_set_allocated:Odb.Lib.Protobuf.Design.fileArchive) + _impl_.filemodel_ = filemodel; + // @@protoc_insertion_point(field_set_allocated:Odb.Lib.Protobuf.ProductModel.Design.fileModel) +} + +// repeated .Odb.Lib.Protobuf.ProductModel.Net nets = 4; +inline int Design::_internal_nets_size() const { + return _impl_.nets_.size(); +} +inline int Design::nets_size() const { + return _internal_nets_size(); +} +inline ::Odb::Lib::Protobuf::ProductModel::Net* Design::mutable_nets(int index) { + // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.ProductModel.Design.nets) + return _impl_.nets_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Net >* +Design::mutable_nets() { + // @@protoc_insertion_point(field_mutable_list:Odb.Lib.Protobuf.ProductModel.Design.nets) + return &_impl_.nets_; +} +inline const ::Odb::Lib::Protobuf::ProductModel::Net& Design::_internal_nets(int index) const { + return _impl_.nets_.Get(index); +} +inline const ::Odb::Lib::Protobuf::ProductModel::Net& Design::nets(int index) const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Design.nets) + return _internal_nets(index); +} +inline ::Odb::Lib::Protobuf::ProductModel::Net* Design::_internal_add_nets() { + return _impl_.nets_.Add(); +} +inline ::Odb::Lib::Protobuf::ProductModel::Net* Design::add_nets() { + ::Odb::Lib::Protobuf::ProductModel::Net* _add = _internal_add_nets(); + // @@protoc_insertion_point(field_add:Odb.Lib.Protobuf.ProductModel.Design.nets) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Net >& +Design::nets() const { + // @@protoc_insertion_point(field_list:Odb.Lib.Protobuf.ProductModel.Design.nets) + return _impl_.nets_; +} + +// map netsByName = 5; +inline int Design::_internal_netsbyname_size() const { + return _impl_.netsbyname_.size(); +} +inline int Design::netsbyname_size() const { + return _internal_netsbyname_size(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Net >& +Design::_internal_netsbyname() const { + return _impl_.netsbyname_.GetMap(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Net >& +Design::netsbyname() const { + // @@protoc_insertion_point(field_map:Odb.Lib.Protobuf.ProductModel.Design.netsByName) + return _internal_netsbyname(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Net >* +Design::_internal_mutable_netsbyname() { + return _impl_.netsbyname_.MutableMap(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Net >* +Design::mutable_netsbyname() { + // @@protoc_insertion_point(field_mutable_map:Odb.Lib.Protobuf.ProductModel.Design.netsByName) + return _internal_mutable_netsbyname(); +} + +// repeated .Odb.Lib.Protobuf.ProductModel.Package packages = 6; +inline int Design::_internal_packages_size() const { + return _impl_.packages_.size(); +} +inline int Design::packages_size() const { + return _internal_packages_size(); +} +inline ::Odb::Lib::Protobuf::ProductModel::Package* Design::mutable_packages(int index) { + // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.ProductModel.Design.packages) + return _impl_.packages_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Package >* +Design::mutable_packages() { + // @@protoc_insertion_point(field_mutable_list:Odb.Lib.Protobuf.ProductModel.Design.packages) + return &_impl_.packages_; +} +inline const ::Odb::Lib::Protobuf::ProductModel::Package& Design::_internal_packages(int index) const { + return _impl_.packages_.Get(index); +} +inline const ::Odb::Lib::Protobuf::ProductModel::Package& Design::packages(int index) const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Design.packages) + return _internal_packages(index); +} +inline ::Odb::Lib::Protobuf::ProductModel::Package* Design::_internal_add_packages() { + return _impl_.packages_.Add(); +} +inline ::Odb::Lib::Protobuf::ProductModel::Package* Design::add_packages() { + ::Odb::Lib::Protobuf::ProductModel::Package* _add = _internal_add_packages(); + // @@protoc_insertion_point(field_add:Odb.Lib.Protobuf.ProductModel.Design.packages) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Package >& +Design::packages() const { + // @@protoc_insertion_point(field_list:Odb.Lib.Protobuf.ProductModel.Design.packages) + return _impl_.packages_; +} + +// map packagesByName = 7; +inline int Design::_internal_packagesbyname_size() const { + return _impl_.packagesbyname_.size(); +} +inline int Design::packagesbyname_size() const { + return _internal_packagesbyname_size(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Package >& +Design::_internal_packagesbyname() const { + return _impl_.packagesbyname_.GetMap(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Package >& +Design::packagesbyname() const { + // @@protoc_insertion_point(field_map:Odb.Lib.Protobuf.ProductModel.Design.packagesByName) + return _internal_packagesbyname(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Package >* +Design::_internal_mutable_packagesbyname() { + return _impl_.packagesbyname_.MutableMap(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Package >* +Design::mutable_packagesbyname() { + // @@protoc_insertion_point(field_mutable_map:Odb.Lib.Protobuf.ProductModel.Design.packagesByName) + return _internal_mutable_packagesbyname(); +} + +// repeated .Odb.Lib.Protobuf.ProductModel.Component components = 8; +inline int Design::_internal_components_size() const { + return _impl_.components_.size(); +} +inline int Design::components_size() const { + return _internal_components_size(); +} +inline ::Odb::Lib::Protobuf::ProductModel::Component* Design::mutable_components(int index) { + // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.ProductModel.Design.components) + return _impl_.components_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Component >* +Design::mutable_components() { + // @@protoc_insertion_point(field_mutable_list:Odb.Lib.Protobuf.ProductModel.Design.components) + return &_impl_.components_; +} +inline const ::Odb::Lib::Protobuf::ProductModel::Component& Design::_internal_components(int index) const { + return _impl_.components_.Get(index); +} +inline const ::Odb::Lib::Protobuf::ProductModel::Component& Design::components(int index) const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Design.components) + return _internal_components(index); +} +inline ::Odb::Lib::Protobuf::ProductModel::Component* Design::_internal_add_components() { + return _impl_.components_.Add(); +} +inline ::Odb::Lib::Protobuf::ProductModel::Component* Design::add_components() { + ::Odb::Lib::Protobuf::ProductModel::Component* _add = _internal_add_components(); + // @@protoc_insertion_point(field_add:Odb.Lib.Protobuf.ProductModel.Design.components) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Component >& +Design::components() const { + // @@protoc_insertion_point(field_list:Odb.Lib.Protobuf.ProductModel.Design.components) + return _impl_.components_; +} + +// map componentsByName = 9; +inline int Design::_internal_componentsbyname_size() const { + return _impl_.componentsbyname_.size(); +} +inline int Design::componentsbyname_size() const { + return _internal_componentsbyname_size(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Component >& +Design::_internal_componentsbyname() const { + return _impl_.componentsbyname_.GetMap(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Component >& +Design::componentsbyname() const { + // @@protoc_insertion_point(field_map:Odb.Lib.Protobuf.ProductModel.Design.componentsByName) + return _internal_componentsbyname(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Component >* +Design::_internal_mutable_componentsbyname() { + return _impl_.componentsbyname_.MutableMap(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Component >* +Design::mutable_componentsbyname() { + // @@protoc_insertion_point(field_mutable_map:Odb.Lib.Protobuf.ProductModel.Design.componentsByName) + return _internal_mutable_componentsbyname(); +} + +// repeated .Odb.Lib.Protobuf.ProductModel.Part parts = 10; +inline int Design::_internal_parts_size() const { + return _impl_.parts_.size(); +} +inline int Design::parts_size() const { + return _internal_parts_size(); +} +inline ::Odb::Lib::Protobuf::ProductModel::Part* Design::mutable_parts(int index) { + // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.ProductModel.Design.parts) + return _impl_.parts_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Part >* +Design::mutable_parts() { + // @@protoc_insertion_point(field_mutable_list:Odb.Lib.Protobuf.ProductModel.Design.parts) + return &_impl_.parts_; +} +inline const ::Odb::Lib::Protobuf::ProductModel::Part& Design::_internal_parts(int index) const { + return _impl_.parts_.Get(index); +} +inline const ::Odb::Lib::Protobuf::ProductModel::Part& Design::parts(int index) const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Design.parts) + return _internal_parts(index); +} +inline ::Odb::Lib::Protobuf::ProductModel::Part* Design::_internal_add_parts() { + return _impl_.parts_.Add(); +} +inline ::Odb::Lib::Protobuf::ProductModel::Part* Design::add_parts() { + ::Odb::Lib::Protobuf::ProductModel::Part* _add = _internal_add_parts(); + // @@protoc_insertion_point(field_add:Odb.Lib.Protobuf.ProductModel.Design.parts) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Part >& +Design::parts() const { + // @@protoc_insertion_point(field_list:Odb.Lib.Protobuf.ProductModel.Design.parts) + return _impl_.parts_; +} + +// map partsByName = 11; +inline int Design::_internal_partsbyname_size() const { + return _impl_.partsbyname_.size(); +} +inline int Design::partsbyname_size() const { + return _internal_partsbyname_size(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Part >& +Design::_internal_partsbyname() const { + return _impl_.partsbyname_.GetMap(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Part >& +Design::partsbyname() const { + // @@protoc_insertion_point(field_map:Odb.Lib.Protobuf.ProductModel.Design.partsByName) + return _internal_partsbyname(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Part >* +Design::_internal_mutable_partsbyname() { + return _impl_.partsbyname_.MutableMap(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Part >* +Design::mutable_partsbyname() { + // @@protoc_insertion_point(field_mutable_map:Odb.Lib.Protobuf.ProductModel.Design.partsByName) + return _internal_mutable_partsbyname(); } #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) +} // namespace ProductModel } // namespace Protobuf } // namespace Lib } // namespace Odb diff --git a/OdbDesignLib/ProtoBuf/net.pb.cc b/OdbDesignLib/ProtoBuf/net.pb.cc new file mode 100644 index 00000000..afbf4a1d --- /dev/null +++ b/OdbDesignLib/ProtoBuf/net.pb.cc @@ -0,0 +1,408 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: net.proto + +#include "net.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { +PROTOBUF_CONSTEXPR Net::Net( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.pinconnections_)*/{} + , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.index_)*/0u} {} +struct NetDefaultTypeInternal { + PROTOBUF_CONSTEXPR NetDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~NetDefaultTypeInternal() {} + union { + Net _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NetDefaultTypeInternal _Net_default_instance_; +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb +static ::_pb::Metadata file_level_metadata_net_2eproto[1]; +static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_net_2eproto = nullptr; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_net_2eproto = nullptr; + +const uint32_t TableStruct_net_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Net, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Net, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Net, _impl_.name_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Net, _impl_.pinconnections_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Net, _impl_.index_), + 0, + ~0u, + 1, +}; +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, 9, -1, sizeof(::Odb::Lib::Protobuf::ProductModel::Net)}, +}; + +static const ::_pb::Message* const file_default_instances[] = { + &::Odb::Lib::Protobuf::ProductModel::_Net_default_instance_._instance, +}; + +const char descriptor_table_protodef_net_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\tnet.proto\022\035Odb.Lib.Protobuf.ProductMod" + "el\032\023pinconnection.proto\"\205\001\n\003Net\022\021\n\004name\030" + "\001 \001(\tH\000\210\001\001\022D\n\016pinConnections\030\002 \003(\0132,.Odb" + ".Lib.Protobuf.ProductModel.PinConnection" + "\022\022\n\005index\030\003 \001(\rH\001\210\001\001B\007\n\005_nameB\010\n\006_indexb" + "\006proto3" + ; +static const ::_pbi::DescriptorTable* const descriptor_table_net_2eproto_deps[1] = { + &::descriptor_table_pinconnection_2eproto, +}; +static ::_pbi::once_flag descriptor_table_net_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_net_2eproto = { + false, false, 207, descriptor_table_protodef_net_2eproto, + "net.proto", + &descriptor_table_net_2eproto_once, descriptor_table_net_2eproto_deps, 1, 1, + schemas, file_default_instances, TableStruct_net_2eproto::offsets, + file_level_metadata_net_2eproto, file_level_enum_descriptors_net_2eproto, + file_level_service_descriptors_net_2eproto, +}; +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_net_2eproto_getter() { + return &descriptor_table_net_2eproto; +} + +// Force running AddDescriptors() at dynamic initialization time. +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_net_2eproto(&descriptor_table_net_2eproto); +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { + +// =================================================================== + +class Net::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_name(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_index(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } +}; + +void Net::clear_pinconnections() { + _impl_.pinconnections_.Clear(); +} +Net::Net(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:Odb.Lib.Protobuf.ProductModel.Net) +} +Net::Net(const Net& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + Net* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.pinconnections_){from._impl_.pinconnections_} + , decltype(_impl_.name_){} + , decltype(_impl_.index_){}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_name()) { + _this->_impl_.name_.Set(from._internal_name(), + _this->GetArenaForAllocation()); + } + _this->_impl_.index_ = from._impl_.index_; + // @@protoc_insertion_point(copy_constructor:Odb.Lib.Protobuf.ProductModel.Net) +} + +inline void Net::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.pinconnections_){arena} + , decltype(_impl_.name_){} + , decltype(_impl_.index_){0u} + }; + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +Net::~Net() { + // @@protoc_insertion_point(destructor:Odb.Lib.Protobuf.ProductModel.Net) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void Net::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.pinconnections_.~RepeatedPtrField(); + _impl_.name_.Destroy(); +} + +void Net::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Net::Clear() { +// @@protoc_insertion_point(message_clear_start:Odb.Lib.Protobuf.ProductModel.Net) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.pinconnections_.Clear(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + _impl_.name_.ClearNonDefaultToEmpty(); + } + _impl_.index_ = 0u; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* Net::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // optional string name = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_name(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "Odb.Lib.Protobuf.ProductModel.Net.name")); + } else + goto handle_unusual; + continue; + // repeated .Odb.Lib.Protobuf.ProductModel.PinConnection pinConnections = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_pinconnections(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); + } else + goto handle_unusual; + continue; + // optional uint32 index = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + _Internal::set_has_index(&has_bits); + _impl_.index_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + _impl_._has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* Net::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:Odb.Lib.Protobuf.ProductModel.Net) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // optional string name = 1; + if (_internal_has_name()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_name().data(), static_cast(this->_internal_name().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "Odb.Lib.Protobuf.ProductModel.Net.name"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_name(), target); + } + + // repeated .Odb.Lib.Protobuf.ProductModel.PinConnection pinConnections = 2; + for (unsigned i = 0, + n = static_cast(this->_internal_pinconnections_size()); i < n; i++) { + const auto& repfield = this->_internal_pinconnections(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream); + } + + // optional uint32 index = 3; + if (_internal_has_index()) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_index(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:Odb.Lib.Protobuf.ProductModel.Net) + return target; +} + +size_t Net::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:Odb.Lib.Protobuf.ProductModel.Net) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated .Odb.Lib.Protobuf.ProductModel.PinConnection pinConnections = 2; + total_size += 1UL * this->_internal_pinconnections_size(); + for (const auto& msg : this->_impl_.pinconnections_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + // optional string name = 1; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); + } + + // optional uint32 index = 3; + if (cached_has_bits & 0x00000002u) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_index()); + } + + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Net::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Net::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Net::GetClassData() const { return &_class_data_; } + + +void Net::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:Odb.Lib.Protobuf.ProductModel.Net) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_impl_.pinconnections_.MergeFrom(from._impl_.pinconnections_); + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_set_name(from._internal_name()); + } + if (cached_has_bits & 0x00000002u) { + _this->_impl_.index_ = from._impl_.index_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Net::CopyFrom(const Net& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:Odb.Lib.Protobuf.ProductModel.Net) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Net::IsInitialized() const { + return true; +} + +void Net::InternalSwap(Net* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + _impl_.pinconnections_.InternalSwap(&other->_impl_.pinconnections_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.name_, lhs_arena, + &other->_impl_.name_, rhs_arena + ); + swap(_impl_.index_, other->_impl_.index_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Net::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_net_2eproto_getter, &descriptor_table_net_2eproto_once, + file_level_metadata_net_2eproto[0]); +} + +// @@protoc_insertion_point(namespace_scope) +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::Odb::Lib::Protobuf::ProductModel::Net* +Arena::CreateMaybeMessage< ::Odb::Lib::Protobuf::ProductModel::Net >(Arena* arena) { + return Arena::CreateMessageInternal< ::Odb::Lib::Protobuf::ProductModel::Net >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/OdbDesignLib/ProtoBuf/net.pb.h b/OdbDesignLib/ProtoBuf/net.pb.h new file mode 100644 index 00000000..8ba9aa45 --- /dev/null +++ b/OdbDesignLib/ProtoBuf/net.pb.h @@ -0,0 +1,418 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: net.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_net_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_net_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3021000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "pinconnection.pb.h" +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_net_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_net_2eproto { + static const uint32_t offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_net_2eproto; +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { +class Net; +struct NetDefaultTypeInternal; +extern NetDefaultTypeInternal _Net_default_instance_; +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb +PROTOBUF_NAMESPACE_OPEN +template<> ::Odb::Lib::Protobuf::ProductModel::Net* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Net>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { + +// =================================================================== + +class Net final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.ProductModel.Net) */ { + public: + inline Net() : Net(nullptr) {} + ~Net() override; + explicit PROTOBUF_CONSTEXPR Net(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + Net(const Net& from); + Net(Net&& from) noexcept + : Net() { + *this = ::std::move(from); + } + + inline Net& operator=(const Net& from) { + CopyFrom(from); + return *this; + } + inline Net& operator=(Net&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Net& default_instance() { + return *internal_default_instance(); + } + static inline const Net* internal_default_instance() { + return reinterpret_cast( + &_Net_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(Net& a, Net& b) { + a.Swap(&b); + } + inline void Swap(Net* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Net* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Net* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const Net& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const Net& from) { + Net::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Net* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "Odb.Lib.Protobuf.ProductModel.Net"; + } + protected: + explicit Net(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kPinConnectionsFieldNumber = 2, + kNameFieldNumber = 1, + kIndexFieldNumber = 3, + }; + // repeated .Odb.Lib.Protobuf.ProductModel.PinConnection pinConnections = 2; + int pinconnections_size() const; + private: + int _internal_pinconnections_size() const; + public: + void clear_pinconnections(); + ::Odb::Lib::Protobuf::ProductModel::PinConnection* mutable_pinconnections(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::PinConnection >* + mutable_pinconnections(); + private: + const ::Odb::Lib::Protobuf::ProductModel::PinConnection& _internal_pinconnections(int index) const; + ::Odb::Lib::Protobuf::ProductModel::PinConnection* _internal_add_pinconnections(); + public: + const ::Odb::Lib::Protobuf::ProductModel::PinConnection& pinconnections(int index) const; + ::Odb::Lib::Protobuf::ProductModel::PinConnection* add_pinconnections(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::PinConnection >& + pinconnections() const; + + // optional string name = 1; + bool has_name() const; + private: + bool _internal_has_name() const; + public: + void clear_name(); + const std::string& name() const; + template + void set_name(ArgT0&& arg0, ArgT... args); + std::string* mutable_name(); + PROTOBUF_NODISCARD std::string* release_name(); + void set_allocated_name(std::string* name); + private: + const std::string& _internal_name() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); + std::string* _internal_mutable_name(); + public: + + // optional uint32 index = 3; + bool has_index() const; + private: + bool _internal_has_index() const; + public: + void clear_index(); + uint32_t index() const; + void set_index(uint32_t value); + private: + uint32_t _internal_index() const; + void _internal_set_index(uint32_t value); + public: + + // @@protoc_insertion_point(class_scope:Odb.Lib.Protobuf.ProductModel.Net) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::PinConnection > pinconnections_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + uint32_t index_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_net_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Net + +// optional string name = 1; +inline bool Net::_internal_has_name() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool Net::has_name() const { + return _internal_has_name(); +} +inline void Net::clear_name() { + _impl_.name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& Net::name() const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Net.name) + return _internal_name(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void Net::set_name(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:Odb.Lib.Protobuf.ProductModel.Net.name) +} +inline std::string* Net::mutable_name() { + std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.ProductModel.Net.name) + return _s; +} +inline const std::string& Net::_internal_name() const { + return _impl_.name_.Get(); +} +inline void Net::_internal_set_name(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(value, GetArenaForAllocation()); +} +inline std::string* Net::_internal_mutable_name() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.name_.Mutable(GetArenaForAllocation()); +} +inline std::string* Net::release_name() { + // @@protoc_insertion_point(field_release:Odb.Lib.Protobuf.ProductModel.Net.name) + if (!_internal_has_name()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.name_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void Net::set_allocated_name(std::string* name) { + if (name != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:Odb.Lib.Protobuf.ProductModel.Net.name) +} + +// repeated .Odb.Lib.Protobuf.ProductModel.PinConnection pinConnections = 2; +inline int Net::_internal_pinconnections_size() const { + return _impl_.pinconnections_.size(); +} +inline int Net::pinconnections_size() const { + return _internal_pinconnections_size(); +} +inline ::Odb::Lib::Protobuf::ProductModel::PinConnection* Net::mutable_pinconnections(int index) { + // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.ProductModel.Net.pinConnections) + return _impl_.pinconnections_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::PinConnection >* +Net::mutable_pinconnections() { + // @@protoc_insertion_point(field_mutable_list:Odb.Lib.Protobuf.ProductModel.Net.pinConnections) + return &_impl_.pinconnections_; +} +inline const ::Odb::Lib::Protobuf::ProductModel::PinConnection& Net::_internal_pinconnections(int index) const { + return _impl_.pinconnections_.Get(index); +} +inline const ::Odb::Lib::Protobuf::ProductModel::PinConnection& Net::pinconnections(int index) const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Net.pinConnections) + return _internal_pinconnections(index); +} +inline ::Odb::Lib::Protobuf::ProductModel::PinConnection* Net::_internal_add_pinconnections() { + return _impl_.pinconnections_.Add(); +} +inline ::Odb::Lib::Protobuf::ProductModel::PinConnection* Net::add_pinconnections() { + ::Odb::Lib::Protobuf::ProductModel::PinConnection* _add = _internal_add_pinconnections(); + // @@protoc_insertion_point(field_add:Odb.Lib.Protobuf.ProductModel.Net.pinConnections) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::PinConnection >& +Net::pinconnections() const { + // @@protoc_insertion_point(field_list:Odb.Lib.Protobuf.ProductModel.Net.pinConnections) + return _impl_.pinconnections_; +} + +// optional uint32 index = 3; +inline bool Net::_internal_has_index() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool Net::has_index() const { + return _internal_has_index(); +} +inline void Net::clear_index() { + _impl_.index_ = 0u; + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline uint32_t Net::_internal_index() const { + return _impl_.index_; +} +inline uint32_t Net::index() const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Net.index) + return _internal_index(); +} +inline void Net::_internal_set_index(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.index_ = value; +} +inline void Net::set_index(uint32_t value) { + _internal_set_index(value); + // @@protoc_insertion_point(field_set:Odb.Lib.Protobuf.ProductModel.Net.index) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_net_2eproto diff --git a/OdbDesignLib/ProtoBuf/package.pb.cc b/OdbDesignLib/ProtoBuf/package.pb.cc new file mode 100644 index 00000000..44e2d54b --- /dev/null +++ b/OdbDesignLib/ProtoBuf/package.pb.cc @@ -0,0 +1,522 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: package.proto + +#include "package.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { +PROTOBUF_CONSTEXPR Package_PinsByNameEntry_DoNotUse::Package_PinsByNameEntry_DoNotUse( + ::_pbi::ConstantInitialized) {} +struct Package_PinsByNameEntry_DoNotUseDefaultTypeInternal { + PROTOBUF_CONSTEXPR Package_PinsByNameEntry_DoNotUseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~Package_PinsByNameEntry_DoNotUseDefaultTypeInternal() {} + union { + Package_PinsByNameEntry_DoNotUse _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Package_PinsByNameEntry_DoNotUseDefaultTypeInternal _Package_PinsByNameEntry_DoNotUse_default_instance_; +PROTOBUF_CONSTEXPR Package::Package( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.pins_)*/{} + , /*decltype(_impl_.pinsbyname_)*/{::_pbi::ConstantInitialized()} + , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.index_)*/0u} {} +struct PackageDefaultTypeInternal { + PROTOBUF_CONSTEXPR PackageDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~PackageDefaultTypeInternal() {} + union { + Package _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PackageDefaultTypeInternal _Package_default_instance_; +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb +static ::_pb::Metadata file_level_metadata_package_2eproto[2]; +static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_package_2eproto = nullptr; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_package_2eproto = nullptr; + +const uint32_t TableStruct_package_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Package_PinsByNameEntry_DoNotUse, _has_bits_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Package_PinsByNameEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Package_PinsByNameEntry_DoNotUse, key_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Package_PinsByNameEntry_DoNotUse, value_), + 0, + 1, + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Package, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Package, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Package, _impl_.name_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Package, _impl_.pins_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Package, _impl_.pinsbyname_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Package, _impl_.index_), + 0, + ~0u, + ~0u, + 1, +}; +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, 8, -1, sizeof(::Odb::Lib::Protobuf::ProductModel::Package_PinsByNameEntry_DoNotUse)}, + { 10, 20, -1, sizeof(::Odb::Lib::Protobuf::ProductModel::Package)}, +}; + +static const ::_pb::Message* const file_default_instances[] = { + &::Odb::Lib::Protobuf::ProductModel::_Package_PinsByNameEntry_DoNotUse_default_instance_._instance, + &::Odb::Lib::Protobuf::ProductModel::_Package_default_instance_._instance, +}; + +const char descriptor_table_protodef_package_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\rpackage.proto\022\035Odb.Lib.Protobuf.Produc" + "tModel\032\tpin.proto\"\230\002\n\007Package\022\021\n\004name\030\001 " + "\001(\tH\000\210\001\001\0220\n\004pins\030\002 \003(\0132\".Odb.Lib.Protobu" + "f.ProductModel.Pin\022J\n\npinsByName\030\003 \003(\01326" + ".Odb.Lib.Protobuf.ProductModel.Package.P" + "insByNameEntry\022\022\n\005index\030\004 \001(\rH\001\210\001\001\032U\n\017Pi" + "nsByNameEntry\022\013\n\003key\030\001 \001(\t\0221\n\005value\030\002 \001(" + "\0132\".Odb.Lib.Protobuf.ProductModel.Pin:\0028" + "\001B\007\n\005_nameB\010\n\006_indexb\006proto3" + ; +static const ::_pbi::DescriptorTable* const descriptor_table_package_2eproto_deps[1] = { + &::descriptor_table_pin_2eproto, +}; +static ::_pbi::once_flag descriptor_table_package_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_package_2eproto = { + false, false, 348, descriptor_table_protodef_package_2eproto, + "package.proto", + &descriptor_table_package_2eproto_once, descriptor_table_package_2eproto_deps, 1, 2, + schemas, file_default_instances, TableStruct_package_2eproto::offsets, + file_level_metadata_package_2eproto, file_level_enum_descriptors_package_2eproto, + file_level_service_descriptors_package_2eproto, +}; +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_package_2eproto_getter() { + return &descriptor_table_package_2eproto; +} + +// Force running AddDescriptors() at dynamic initialization time. +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_package_2eproto(&descriptor_table_package_2eproto); +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { + +// =================================================================== + +Package_PinsByNameEntry_DoNotUse::Package_PinsByNameEntry_DoNotUse() {} +Package_PinsByNameEntry_DoNotUse::Package_PinsByNameEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : SuperType(arena) {} +void Package_PinsByNameEntry_DoNotUse::MergeFrom(const Package_PinsByNameEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::PROTOBUF_NAMESPACE_ID::Metadata Package_PinsByNameEntry_DoNotUse::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_package_2eproto_getter, &descriptor_table_package_2eproto_once, + file_level_metadata_package_2eproto[0]); +} + +// =================================================================== + +class Package::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_name(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_index(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } +}; + +void Package::clear_pins() { + _impl_.pins_.Clear(); +} +void Package::clear_pinsbyname() { + _impl_.pinsbyname_.Clear(); +} +Package::Package(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + if (arena != nullptr && !is_message_owned) { + arena->OwnCustomDestructor(this, &Package::ArenaDtor); + } + // @@protoc_insertion_point(arena_constructor:Odb.Lib.Protobuf.ProductModel.Package) +} +Package::Package(const Package& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + Package* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.pins_){from._impl_.pins_} + , /*decltype(_impl_.pinsbyname_)*/{} + , decltype(_impl_.name_){} + , decltype(_impl_.index_){}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_impl_.pinsbyname_.MergeFrom(from._impl_.pinsbyname_); + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_name()) { + _this->_impl_.name_.Set(from._internal_name(), + _this->GetArenaForAllocation()); + } + _this->_impl_.index_ = from._impl_.index_; + // @@protoc_insertion_point(copy_constructor:Odb.Lib.Protobuf.ProductModel.Package) +} + +inline void Package::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.pins_){arena} + , /*decltype(_impl_.pinsbyname_)*/{::_pbi::ArenaInitialized(), arena} + , decltype(_impl_.name_){} + , decltype(_impl_.index_){0u} + }; + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +Package::~Package() { + // @@protoc_insertion_point(destructor:Odb.Lib.Protobuf.ProductModel.Package) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + ArenaDtor(this); + return; + } + SharedDtor(); +} + +inline void Package::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.pins_.~RepeatedPtrField(); + _impl_.pinsbyname_.Destruct(); + _impl_.pinsbyname_.~MapField(); + _impl_.name_.Destroy(); +} + +void Package::ArenaDtor(void* object) { + Package* _this = reinterpret_cast< Package* >(object); + _this->_impl_.pinsbyname_.Destruct(); +} +void Package::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Package::Clear() { +// @@protoc_insertion_point(message_clear_start:Odb.Lib.Protobuf.ProductModel.Package) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.pins_.Clear(); + _impl_.pinsbyname_.Clear(); + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + _impl_.name_.ClearNonDefaultToEmpty(); + } + _impl_.index_ = 0u; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* Package::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // optional string name = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_name(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "Odb.Lib.Protobuf.ProductModel.Package.name")); + } else + goto handle_unusual; + continue; + // repeated .Odb.Lib.Protobuf.ProductModel.Pin pins = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_pins(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); + } else + goto handle_unusual; + continue; + // map pinsByName = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(&_impl_.pinsbyname_, ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); + } else + goto handle_unusual; + continue; + // optional uint32 index = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + _Internal::set_has_index(&has_bits); + _impl_.index_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + _impl_._has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* Package::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:Odb.Lib.Protobuf.ProductModel.Package) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // optional string name = 1; + if (_internal_has_name()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_name().data(), static_cast(this->_internal_name().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "Odb.Lib.Protobuf.ProductModel.Package.name"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_name(), target); + } + + // repeated .Odb.Lib.Protobuf.ProductModel.Pin pins = 2; + for (unsigned i = 0, + n = static_cast(this->_internal_pins_size()); i < n; i++) { + const auto& repfield = this->_internal_pins(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream); + } + + // map pinsByName = 3; + if (!this->_internal_pinsbyname().empty()) { + using MapType = ::_pb::Map; + using WireHelper = Package_PinsByNameEntry_DoNotUse::Funcs; + const auto& map_field = this->_internal_pinsbyname(); + auto check_utf8 = [](const MapType::value_type& entry) { + (void)entry; + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + entry.first.data(), static_cast(entry.first.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "Odb.Lib.Protobuf.ProductModel.Package.PinsByNameEntry.key"); + }; + + if (stream->IsSerializationDeterministic() && map_field.size() > 1) { + for (const auto& entry : ::_pbi::MapSorterPtr(map_field)) { + target = WireHelper::InternalSerialize(3, entry.first, entry.second, target, stream); + check_utf8(entry); + } + } else { + for (const auto& entry : map_field) { + target = WireHelper::InternalSerialize(3, entry.first, entry.second, target, stream); + check_utf8(entry); + } + } + } + + // optional uint32 index = 4; + if (_internal_has_index()) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_index(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:Odb.Lib.Protobuf.ProductModel.Package) + return target; +} + +size_t Package::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:Odb.Lib.Protobuf.ProductModel.Package) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated .Odb.Lib.Protobuf.ProductModel.Pin pins = 2; + total_size += 1UL * this->_internal_pins_size(); + for (const auto& msg : this->_impl_.pins_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + // map pinsByName = 3; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_pinsbyname_size()); + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Pin >::const_iterator + it = this->_internal_pinsbyname().begin(); + it != this->_internal_pinsbyname().end(); ++it) { + total_size += Package_PinsByNameEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second); + } + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + // optional string name = 1; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); + } + + // optional uint32 index = 4; + if (cached_has_bits & 0x00000002u) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_index()); + } + + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Package::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Package::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Package::GetClassData() const { return &_class_data_; } + + +void Package::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:Odb.Lib.Protobuf.ProductModel.Package) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_impl_.pins_.MergeFrom(from._impl_.pins_); + _this->_impl_.pinsbyname_.MergeFrom(from._impl_.pinsbyname_); + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_set_name(from._internal_name()); + } + if (cached_has_bits & 0x00000002u) { + _this->_impl_.index_ = from._impl_.index_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Package::CopyFrom(const Package& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:Odb.Lib.Protobuf.ProductModel.Package) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Package::IsInitialized() const { + return true; +} + +void Package::InternalSwap(Package* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + _impl_.pins_.InternalSwap(&other->_impl_.pins_); + _impl_.pinsbyname_.InternalSwap(&other->_impl_.pinsbyname_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.name_, lhs_arena, + &other->_impl_.name_, rhs_arena + ); + swap(_impl_.index_, other->_impl_.index_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Package::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_package_2eproto_getter, &descriptor_table_package_2eproto_once, + file_level_metadata_package_2eproto[1]); +} + +// @@protoc_insertion_point(namespace_scope) +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::Odb::Lib::Protobuf::ProductModel::Package_PinsByNameEntry_DoNotUse* +Arena::CreateMaybeMessage< ::Odb::Lib::Protobuf::ProductModel::Package_PinsByNameEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::Odb::Lib::Protobuf::ProductModel::Package_PinsByNameEntry_DoNotUse >(arena); +} +template<> PROTOBUF_NOINLINE ::Odb::Lib::Protobuf::ProductModel::Package* +Arena::CreateMaybeMessage< ::Odb::Lib::Protobuf::ProductModel::Package >(Arena* arena) { + return Arena::CreateMessageInternal< ::Odb::Lib::Protobuf::ProductModel::Package >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/OdbDesignLib/ProtoBuf/package.pb.h b/OdbDesignLib/ProtoBuf/package.pb.h new file mode 100644 index 00000000..4a1402f5 --- /dev/null +++ b/OdbDesignLib/ProtoBuf/package.pb.h @@ -0,0 +1,507 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: package.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_package_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_package_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3021000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +#include "pin.pb.h" +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_package_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_package_2eproto { + static const uint32_t offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_package_2eproto; +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { +class Package; +struct PackageDefaultTypeInternal; +extern PackageDefaultTypeInternal _Package_default_instance_; +class Package_PinsByNameEntry_DoNotUse; +struct Package_PinsByNameEntry_DoNotUseDefaultTypeInternal; +extern Package_PinsByNameEntry_DoNotUseDefaultTypeInternal _Package_PinsByNameEntry_DoNotUse_default_instance_; +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb +PROTOBUF_NAMESPACE_OPEN +template<> ::Odb::Lib::Protobuf::ProductModel::Package* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Package>(Arena*); +template<> ::Odb::Lib::Protobuf::ProductModel::Package_PinsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Package_PinsByNameEntry_DoNotUse>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { + +// =================================================================== + +class Package_PinsByNameEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry { +public: + typedef ::PROTOBUF_NAMESPACE_ID::internal::MapEntry SuperType; + Package_PinsByNameEntry_DoNotUse(); + explicit PROTOBUF_CONSTEXPR Package_PinsByNameEntry_DoNotUse( + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit Package_PinsByNameEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena); + void MergeFrom(const Package_PinsByNameEntry_DoNotUse& other); + static const Package_PinsByNameEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_Package_PinsByNameEntry_DoNotUse_default_instance_); } + static bool ValidateKey(std::string* s) { + return ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(s->data(), static_cast(s->size()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "Odb.Lib.Protobuf.ProductModel.Package.PinsByNameEntry.key"); + } + static bool ValidateValue(void*) { return true; } + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + friend struct ::TableStruct_package_2eproto; +}; + +// ------------------------------------------------------------------- + +class Package final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.ProductModel.Package) */ { + public: + inline Package() : Package(nullptr) {} + ~Package() override; + explicit PROTOBUF_CONSTEXPR Package(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + Package(const Package& from); + Package(Package&& from) noexcept + : Package() { + *this = ::std::move(from); + } + + inline Package& operator=(const Package& from) { + CopyFrom(from); + return *this; + } + inline Package& operator=(Package&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Package& default_instance() { + return *internal_default_instance(); + } + static inline const Package* internal_default_instance() { + return reinterpret_cast( + &_Package_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + friend void swap(Package& a, Package& b) { + a.Swap(&b); + } + inline void Swap(Package* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Package* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Package* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const Package& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const Package& from) { + Package::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Package* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "Odb.Lib.Protobuf.ProductModel.Package"; + } + protected: + explicit Package(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + private: + static void ArenaDtor(void* object); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + + // accessors ------------------------------------------------------- + + enum : int { + kPinsFieldNumber = 2, + kPinsByNameFieldNumber = 3, + kNameFieldNumber = 1, + kIndexFieldNumber = 4, + }; + // repeated .Odb.Lib.Protobuf.ProductModel.Pin pins = 2; + int pins_size() const; + private: + int _internal_pins_size() const; + public: + void clear_pins(); + ::Odb::Lib::Protobuf::ProductModel::Pin* mutable_pins(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Pin >* + mutable_pins(); + private: + const ::Odb::Lib::Protobuf::ProductModel::Pin& _internal_pins(int index) const; + ::Odb::Lib::Protobuf::ProductModel::Pin* _internal_add_pins(); + public: + const ::Odb::Lib::Protobuf::ProductModel::Pin& pins(int index) const; + ::Odb::Lib::Protobuf::ProductModel::Pin* add_pins(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Pin >& + pins() const; + + // map pinsByName = 3; + int pinsbyname_size() const; + private: + int _internal_pinsbyname_size() const; + public: + void clear_pinsbyname(); + private: + const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Pin >& + _internal_pinsbyname() const; + ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Pin >* + _internal_mutable_pinsbyname(); + public: + const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Pin >& + pinsbyname() const; + ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Pin >* + mutable_pinsbyname(); + + // optional string name = 1; + bool has_name() const; + private: + bool _internal_has_name() const; + public: + void clear_name(); + const std::string& name() const; + template + void set_name(ArgT0&& arg0, ArgT... args); + std::string* mutable_name(); + PROTOBUF_NODISCARD std::string* release_name(); + void set_allocated_name(std::string* name); + private: + const std::string& _internal_name() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); + std::string* _internal_mutable_name(); + public: + + // optional uint32 index = 4; + bool has_index() const; + private: + bool _internal_has_index() const; + public: + void clear_index(); + uint32_t index() const; + void set_index(uint32_t value); + private: + uint32_t _internal_index() const; + void _internal_set_index(uint32_t value); + public: + + // @@protoc_insertion_point(class_scope:Odb.Lib.Protobuf.ProductModel.Package) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Pin > pins_; + ::PROTOBUF_NAMESPACE_ID::internal::MapField< + Package_PinsByNameEntry_DoNotUse, + std::string, ::Odb::Lib::Protobuf::ProductModel::Pin, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE> pinsbyname_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + uint32_t index_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_package_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// Package + +// optional string name = 1; +inline bool Package::_internal_has_name() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool Package::has_name() const { + return _internal_has_name(); +} +inline void Package::clear_name() { + _impl_.name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& Package::name() const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Package.name) + return _internal_name(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void Package::set_name(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:Odb.Lib.Protobuf.ProductModel.Package.name) +} +inline std::string* Package::mutable_name() { + std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.ProductModel.Package.name) + return _s; +} +inline const std::string& Package::_internal_name() const { + return _impl_.name_.Get(); +} +inline void Package::_internal_set_name(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(value, GetArenaForAllocation()); +} +inline std::string* Package::_internal_mutable_name() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.name_.Mutable(GetArenaForAllocation()); +} +inline std::string* Package::release_name() { + // @@protoc_insertion_point(field_release:Odb.Lib.Protobuf.ProductModel.Package.name) + if (!_internal_has_name()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.name_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void Package::set_allocated_name(std::string* name) { + if (name != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:Odb.Lib.Protobuf.ProductModel.Package.name) +} + +// repeated .Odb.Lib.Protobuf.ProductModel.Pin pins = 2; +inline int Package::_internal_pins_size() const { + return _impl_.pins_.size(); +} +inline int Package::pins_size() const { + return _internal_pins_size(); +} +inline ::Odb::Lib::Protobuf::ProductModel::Pin* Package::mutable_pins(int index) { + // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.ProductModel.Package.pins) + return _impl_.pins_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Pin >* +Package::mutable_pins() { + // @@protoc_insertion_point(field_mutable_list:Odb.Lib.Protobuf.ProductModel.Package.pins) + return &_impl_.pins_; +} +inline const ::Odb::Lib::Protobuf::ProductModel::Pin& Package::_internal_pins(int index) const { + return _impl_.pins_.Get(index); +} +inline const ::Odb::Lib::Protobuf::ProductModel::Pin& Package::pins(int index) const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Package.pins) + return _internal_pins(index); +} +inline ::Odb::Lib::Protobuf::ProductModel::Pin* Package::_internal_add_pins() { + return _impl_.pins_.Add(); +} +inline ::Odb::Lib::Protobuf::ProductModel::Pin* Package::add_pins() { + ::Odb::Lib::Protobuf::ProductModel::Pin* _add = _internal_add_pins(); + // @@protoc_insertion_point(field_add:Odb.Lib.Protobuf.ProductModel.Package.pins) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::Odb::Lib::Protobuf::ProductModel::Pin >& +Package::pins() const { + // @@protoc_insertion_point(field_list:Odb.Lib.Protobuf.ProductModel.Package.pins) + return _impl_.pins_; +} + +// map pinsByName = 3; +inline int Package::_internal_pinsbyname_size() const { + return _impl_.pinsbyname_.size(); +} +inline int Package::pinsbyname_size() const { + return _internal_pinsbyname_size(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Pin >& +Package::_internal_pinsbyname() const { + return _impl_.pinsbyname_.GetMap(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Pin >& +Package::pinsbyname() const { + // @@protoc_insertion_point(field_map:Odb.Lib.Protobuf.ProductModel.Package.pinsByName) + return _internal_pinsbyname(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Pin >* +Package::_internal_mutable_pinsbyname() { + return _impl_.pinsbyname_.MutableMap(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::ProductModel::Pin >* +Package::mutable_pinsbyname() { + // @@protoc_insertion_point(field_mutable_map:Odb.Lib.Protobuf.ProductModel.Package.pinsByName) + return _internal_mutable_pinsbyname(); +} + +// optional uint32 index = 4; +inline bool Package::_internal_has_index() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool Package::has_index() const { + return _internal_has_index(); +} +inline void Package::clear_index() { + _impl_.index_ = 0u; + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline uint32_t Package::_internal_index() const { + return _impl_.index_; +} +inline uint32_t Package::index() const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Package.index) + return _internal_index(); +} +inline void Package::_internal_set_index(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.index_ = value; +} +inline void Package::set_index(uint32_t value) { + _internal_set_index(value); + // @@protoc_insertion_point(field_set:Odb.Lib.Protobuf.ProductModel.Package.index) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_package_2eproto diff --git a/OdbDesignLib/ProtoBuf/part.pb.cc b/OdbDesignLib/ProtoBuf/part.pb.cc new file mode 100644 index 00000000..ac767b34 --- /dev/null +++ b/OdbDesignLib/ProtoBuf/part.pb.cc @@ -0,0 +1,322 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: part.proto + +#include "part.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { +PROTOBUF_CONSTEXPR Part::Part( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}} {} +struct PartDefaultTypeInternal { + PROTOBUF_CONSTEXPR PartDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~PartDefaultTypeInternal() {} + union { + Part _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PartDefaultTypeInternal _Part_default_instance_; +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb +static ::_pb::Metadata file_level_metadata_part_2eproto[1]; +static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_part_2eproto = nullptr; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_part_2eproto = nullptr; + +const uint32_t TableStruct_part_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Part, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Part, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Part, _impl_.name_), + 0, +}; +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, 7, -1, sizeof(::Odb::Lib::Protobuf::ProductModel::Part)}, +}; + +static const ::_pb::Message* const file_default_instances[] = { + &::Odb::Lib::Protobuf::ProductModel::_Part_default_instance_._instance, +}; + +const char descriptor_table_protodef_part_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\npart.proto\022\035Odb.Lib.Protobuf.ProductMo" + "del\"\"\n\004Part\022\021\n\004name\030\001 \001(\tH\000\210\001\001B\007\n\005_nameb" + "\006proto3" + ; +static ::_pbi::once_flag descriptor_table_part_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_part_2eproto = { + false, false, 87, descriptor_table_protodef_part_2eproto, + "part.proto", + &descriptor_table_part_2eproto_once, nullptr, 0, 1, + schemas, file_default_instances, TableStruct_part_2eproto::offsets, + file_level_metadata_part_2eproto, file_level_enum_descriptors_part_2eproto, + file_level_service_descriptors_part_2eproto, +}; +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_part_2eproto_getter() { + return &descriptor_table_part_2eproto; +} + +// Force running AddDescriptors() at dynamic initialization time. +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_part_2eproto(&descriptor_table_part_2eproto); +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { + +// =================================================================== + +class Part::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_name(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } +}; + +Part::Part(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:Odb.Lib.Protobuf.ProductModel.Part) +} +Part::Part(const Part& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + Part* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.name_){}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_name()) { + _this->_impl_.name_.Set(from._internal_name(), + _this->GetArenaForAllocation()); + } + // @@protoc_insertion_point(copy_constructor:Odb.Lib.Protobuf.ProductModel.Part) +} + +inline void Part::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.name_){} + }; + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +Part::~Part() { + // @@protoc_insertion_point(destructor:Odb.Lib.Protobuf.ProductModel.Part) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void Part::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.name_.Destroy(); +} + +void Part::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Part::Clear() { +// @@protoc_insertion_point(message_clear_start:Odb.Lib.Protobuf.ProductModel.Part) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + _impl_.name_.ClearNonDefaultToEmpty(); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* Part::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // optional string name = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_name(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "Odb.Lib.Protobuf.ProductModel.Part.name")); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + _impl_._has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* Part::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:Odb.Lib.Protobuf.ProductModel.Part) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // optional string name = 1; + if (_internal_has_name()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_name().data(), static_cast(this->_internal_name().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "Odb.Lib.Protobuf.ProductModel.Part.name"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_name(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:Odb.Lib.Protobuf.ProductModel.Part) + return target; +} + +size_t Part::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:Odb.Lib.Protobuf.ProductModel.Part) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // optional string name = 1; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Part::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Part::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Part::GetClassData() const { return &_class_data_; } + + +void Part::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:Odb.Lib.Protobuf.ProductModel.Part) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_has_name()) { + _this->_internal_set_name(from._internal_name()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Part::CopyFrom(const Part& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:Odb.Lib.Protobuf.ProductModel.Part) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Part::IsInitialized() const { + return true; +} + +void Part::InternalSwap(Part* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.name_, lhs_arena, + &other->_impl_.name_, rhs_arena + ); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Part::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_part_2eproto_getter, &descriptor_table_part_2eproto_once, + file_level_metadata_part_2eproto[0]); +} + +// @@protoc_insertion_point(namespace_scope) +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::Odb::Lib::Protobuf::ProductModel::Part* +Arena::CreateMaybeMessage< ::Odb::Lib::Protobuf::ProductModel::Part >(Arena* arena) { + return Arena::CreateMessageInternal< ::Odb::Lib::Protobuf::ProductModel::Part >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/OdbDesignLib/ProtoBuf/part.pb.h b/OdbDesignLib/ProtoBuf/part.pb.h new file mode 100644 index 00000000..0b188753 --- /dev/null +++ b/OdbDesignLib/ProtoBuf/part.pb.h @@ -0,0 +1,317 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: part.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_part_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_part_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3021000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_part_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_part_2eproto { + static const uint32_t offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_part_2eproto; +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { +class Part; +struct PartDefaultTypeInternal; +extern PartDefaultTypeInternal _Part_default_instance_; +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb +PROTOBUF_NAMESPACE_OPEN +template<> ::Odb::Lib::Protobuf::ProductModel::Part* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Part>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { + +// =================================================================== + +class Part final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.ProductModel.Part) */ { + public: + inline Part() : Part(nullptr) {} + ~Part() override; + explicit PROTOBUF_CONSTEXPR Part(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + Part(const Part& from); + Part(Part&& from) noexcept + : Part() { + *this = ::std::move(from); + } + + inline Part& operator=(const Part& from) { + CopyFrom(from); + return *this; + } + inline Part& operator=(Part&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Part& default_instance() { + return *internal_default_instance(); + } + static inline const Part* internal_default_instance() { + return reinterpret_cast( + &_Part_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(Part& a, Part& b) { + a.Swap(&b); + } + inline void Swap(Part* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Part* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Part* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const Part& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const Part& from) { + Part::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Part* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "Odb.Lib.Protobuf.ProductModel.Part"; + } + protected: + explicit Part(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kNameFieldNumber = 1, + }; + // optional string name = 1; + bool has_name() const; + private: + bool _internal_has_name() const; + public: + void clear_name(); + const std::string& name() const; + template + void set_name(ArgT0&& arg0, ArgT... args); + std::string* mutable_name(); + PROTOBUF_NODISCARD std::string* release_name(); + void set_allocated_name(std::string* name); + private: + const std::string& _internal_name() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); + std::string* _internal_mutable_name(); + public: + + // @@protoc_insertion_point(class_scope:Odb.Lib.Protobuf.ProductModel.Part) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_part_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Part + +// optional string name = 1; +inline bool Part::_internal_has_name() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool Part::has_name() const { + return _internal_has_name(); +} +inline void Part::clear_name() { + _impl_.name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& Part::name() const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Part.name) + return _internal_name(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void Part::set_name(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:Odb.Lib.Protobuf.ProductModel.Part.name) +} +inline std::string* Part::mutable_name() { + std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.ProductModel.Part.name) + return _s; +} +inline const std::string& Part::_internal_name() const { + return _impl_.name_.Get(); +} +inline void Part::_internal_set_name(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(value, GetArenaForAllocation()); +} +inline std::string* Part::_internal_mutable_name() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.name_.Mutable(GetArenaForAllocation()); +} +inline std::string* Part::release_name() { + // @@protoc_insertion_point(field_release:Odb.Lib.Protobuf.ProductModel.Part.name) + if (!_internal_has_name()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.name_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void Part::set_allocated_name(std::string* name) { + if (name != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:Odb.Lib.Protobuf.ProductModel.Part.name) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_part_2eproto diff --git a/OdbDesignLib/ProtoBuf/pin.pb.cc b/OdbDesignLib/ProtoBuf/pin.pb.cc new file mode 100644 index 00000000..a51df15d --- /dev/null +++ b/OdbDesignLib/ProtoBuf/pin.pb.cc @@ -0,0 +1,362 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: pin.proto + +#include "pin.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { +PROTOBUF_CONSTEXPR Pin::Pin( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.index_)*/0u} {} +struct PinDefaultTypeInternal { + PROTOBUF_CONSTEXPR PinDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~PinDefaultTypeInternal() {} + union { + Pin _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PinDefaultTypeInternal _Pin_default_instance_; +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb +static ::_pb::Metadata file_level_metadata_pin_2eproto[1]; +static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_pin_2eproto = nullptr; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_pin_2eproto = nullptr; + +const uint32_t TableStruct_pin_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Pin, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Pin, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Pin, _impl_.name_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Pin, _impl_.index_), + 0, + 1, +}; +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, 8, -1, sizeof(::Odb::Lib::Protobuf::ProductModel::Pin)}, +}; + +static const ::_pb::Message* const file_default_instances[] = { + &::Odb::Lib::Protobuf::ProductModel::_Pin_default_instance_._instance, +}; + +const char descriptor_table_protodef_pin_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\tpin.proto\022\035Odb.Lib.Protobuf.ProductMod" + "el\"\?\n\003Pin\022\021\n\004name\030\001 \001(\tH\000\210\001\001\022\022\n\005index\030\002 " + "\001(\rH\001\210\001\001B\007\n\005_nameB\010\n\006_indexb\006proto3" + ; +static ::_pbi::once_flag descriptor_table_pin_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_pin_2eproto = { + false, false, 115, descriptor_table_protodef_pin_2eproto, + "pin.proto", + &descriptor_table_pin_2eproto_once, nullptr, 0, 1, + schemas, file_default_instances, TableStruct_pin_2eproto::offsets, + file_level_metadata_pin_2eproto, file_level_enum_descriptors_pin_2eproto, + file_level_service_descriptors_pin_2eproto, +}; +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_pin_2eproto_getter() { + return &descriptor_table_pin_2eproto; +} + +// Force running AddDescriptors() at dynamic initialization time. +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_pin_2eproto(&descriptor_table_pin_2eproto); +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { + +// =================================================================== + +class Pin::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_name(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_index(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } +}; + +Pin::Pin(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:Odb.Lib.Protobuf.ProductModel.Pin) +} +Pin::Pin(const Pin& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + Pin* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.name_){} + , decltype(_impl_.index_){}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_name()) { + _this->_impl_.name_.Set(from._internal_name(), + _this->GetArenaForAllocation()); + } + _this->_impl_.index_ = from._impl_.index_; + // @@protoc_insertion_point(copy_constructor:Odb.Lib.Protobuf.ProductModel.Pin) +} + +inline void Pin::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.name_){} + , decltype(_impl_.index_){0u} + }; + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +Pin::~Pin() { + // @@protoc_insertion_point(destructor:Odb.Lib.Protobuf.ProductModel.Pin) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void Pin::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.name_.Destroy(); +} + +void Pin::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Pin::Clear() { +// @@protoc_insertion_point(message_clear_start:Odb.Lib.Protobuf.ProductModel.Pin) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + _impl_.name_.ClearNonDefaultToEmpty(); + } + _impl_.index_ = 0u; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* Pin::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // optional string name = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_name(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "Odb.Lib.Protobuf.ProductModel.Pin.name")); + } else + goto handle_unusual; + continue; + // optional uint32 index = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + _Internal::set_has_index(&has_bits); + _impl_.index_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + _impl_._has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* Pin::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:Odb.Lib.Protobuf.ProductModel.Pin) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // optional string name = 1; + if (_internal_has_name()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_name().data(), static_cast(this->_internal_name().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "Odb.Lib.Protobuf.ProductModel.Pin.name"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_name(), target); + } + + // optional uint32 index = 2; + if (_internal_has_index()) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_index(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:Odb.Lib.Protobuf.ProductModel.Pin) + return target; +} + +size_t Pin::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:Odb.Lib.Protobuf.ProductModel.Pin) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + // optional string name = 1; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); + } + + // optional uint32 index = 2; + if (cached_has_bits & 0x00000002u) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_index()); + } + + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Pin::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Pin::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Pin::GetClassData() const { return &_class_data_; } + + +void Pin::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:Odb.Lib.Protobuf.ProductModel.Pin) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_set_name(from._internal_name()); + } + if (cached_has_bits & 0x00000002u) { + _this->_impl_.index_ = from._impl_.index_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Pin::CopyFrom(const Pin& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:Odb.Lib.Protobuf.ProductModel.Pin) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Pin::IsInitialized() const { + return true; +} + +void Pin::InternalSwap(Pin* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.name_, lhs_arena, + &other->_impl_.name_, rhs_arena + ); + swap(_impl_.index_, other->_impl_.index_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Pin::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_pin_2eproto_getter, &descriptor_table_pin_2eproto_once, + file_level_metadata_pin_2eproto[0]); +} + +// @@protoc_insertion_point(namespace_scope) +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::Odb::Lib::Protobuf::ProductModel::Pin* +Arena::CreateMaybeMessage< ::Odb::Lib::Protobuf::ProductModel::Pin >(Arena* arena) { + return Arena::CreateMessageInternal< ::Odb::Lib::Protobuf::ProductModel::Pin >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/OdbDesignLib/ProtoBuf/pin.pb.h b/OdbDesignLib/ProtoBuf/pin.pb.h new file mode 100644 index 00000000..39888942 --- /dev/null +++ b/OdbDesignLib/ProtoBuf/pin.pb.h @@ -0,0 +1,360 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: pin.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_pin_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_pin_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3021000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_pin_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_pin_2eproto { + static const uint32_t offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_pin_2eproto; +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { +class Pin; +struct PinDefaultTypeInternal; +extern PinDefaultTypeInternal _Pin_default_instance_; +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb +PROTOBUF_NAMESPACE_OPEN +template<> ::Odb::Lib::Protobuf::ProductModel::Pin* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Pin>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { + +// =================================================================== + +class Pin final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.ProductModel.Pin) */ { + public: + inline Pin() : Pin(nullptr) {} + ~Pin() override; + explicit PROTOBUF_CONSTEXPR Pin(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + Pin(const Pin& from); + Pin(Pin&& from) noexcept + : Pin() { + *this = ::std::move(from); + } + + inline Pin& operator=(const Pin& from) { + CopyFrom(from); + return *this; + } + inline Pin& operator=(Pin&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Pin& default_instance() { + return *internal_default_instance(); + } + static inline const Pin* internal_default_instance() { + return reinterpret_cast( + &_Pin_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(Pin& a, Pin& b) { + a.Swap(&b); + } + inline void Swap(Pin* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Pin* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Pin* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const Pin& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const Pin& from) { + Pin::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Pin* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "Odb.Lib.Protobuf.ProductModel.Pin"; + } + protected: + explicit Pin(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kNameFieldNumber = 1, + kIndexFieldNumber = 2, + }; + // optional string name = 1; + bool has_name() const; + private: + bool _internal_has_name() const; + public: + void clear_name(); + const std::string& name() const; + template + void set_name(ArgT0&& arg0, ArgT... args); + std::string* mutable_name(); + PROTOBUF_NODISCARD std::string* release_name(); + void set_allocated_name(std::string* name); + private: + const std::string& _internal_name() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); + std::string* _internal_mutable_name(); + public: + + // optional uint32 index = 2; + bool has_index() const; + private: + bool _internal_has_index() const; + public: + void clear_index(); + uint32_t index() const; + void set_index(uint32_t value); + private: + uint32_t _internal_index() const; + void _internal_set_index(uint32_t value); + public: + + // @@protoc_insertion_point(class_scope:Odb.Lib.Protobuf.ProductModel.Pin) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + uint32_t index_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_pin_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Pin + +// optional string name = 1; +inline bool Pin::_internal_has_name() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool Pin::has_name() const { + return _internal_has_name(); +} +inline void Pin::clear_name() { + _impl_.name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& Pin::name() const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Pin.name) + return _internal_name(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void Pin::set_name(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:Odb.Lib.Protobuf.ProductModel.Pin.name) +} +inline std::string* Pin::mutable_name() { + std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.ProductModel.Pin.name) + return _s; +} +inline const std::string& Pin::_internal_name() const { + return _impl_.name_.Get(); +} +inline void Pin::_internal_set_name(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(value, GetArenaForAllocation()); +} +inline std::string* Pin::_internal_mutable_name() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.name_.Mutable(GetArenaForAllocation()); +} +inline std::string* Pin::release_name() { + // @@protoc_insertion_point(field_release:Odb.Lib.Protobuf.ProductModel.Pin.name) + if (!_internal_has_name()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.name_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void Pin::set_allocated_name(std::string* name) { + if (name != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:Odb.Lib.Protobuf.ProductModel.Pin.name) +} + +// optional uint32 index = 2; +inline bool Pin::_internal_has_index() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool Pin::has_index() const { + return _internal_has_index(); +} +inline void Pin::clear_index() { + _impl_.index_ = 0u; + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline uint32_t Pin::_internal_index() const { + return _impl_.index_; +} +inline uint32_t Pin::index() const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Pin.index) + return _internal_index(); +} +inline void Pin::_internal_set_index(uint32_t value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.index_ = value; +} +inline void Pin::set_index(uint32_t value) { + _internal_set_index(value); + // @@protoc_insertion_point(field_set:Odb.Lib.Protobuf.ProductModel.Pin.index) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_pin_2eproto diff --git a/OdbDesignLib/ProtoBuf/pinconnection.pb.cc b/OdbDesignLib/ProtoBuf/pinconnection.pb.cc new file mode 100644 index 00000000..f9f91d6a --- /dev/null +++ b/OdbDesignLib/ProtoBuf/pinconnection.pb.cc @@ -0,0 +1,445 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: pinconnection.proto + +#include "pinconnection.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { +PROTOBUF_CONSTEXPR PinConnection::PinConnection( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.component_)*/nullptr + , /*decltype(_impl_.pin_)*/nullptr} {} +struct PinConnectionDefaultTypeInternal { + PROTOBUF_CONSTEXPR PinConnectionDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~PinConnectionDefaultTypeInternal() {} + union { + PinConnection _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PinConnectionDefaultTypeInternal _PinConnection_default_instance_; +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb +static ::_pb::Metadata file_level_metadata_pinconnection_2eproto[1]; +static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_pinconnection_2eproto = nullptr; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_pinconnection_2eproto = nullptr; + +const uint32_t TableStruct_pinconnection_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::PinConnection, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::PinConnection, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::PinConnection, _impl_.name_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::PinConnection, _impl_.component_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::PinConnection, _impl_.pin_), + 0, + 1, + 2, +}; +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, 9, -1, sizeof(::Odb::Lib::Protobuf::ProductModel::PinConnection)}, +}; + +static const ::_pb::Message* const file_default_instances[] = { + &::Odb::Lib::Protobuf::ProductModel::_PinConnection_default_instance_._instance, +}; + +const char descriptor_table_protodef_pinconnection_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\023pinconnection.proto\022\035Odb.Lib.Protobuf." + "ProductModel\032\017component.proto\032\tpin.proto" + "\"\271\001\n\rPinConnection\022\021\n\004name\030\001 \001(\tH\000\210\001\001\022@\n" + "\tcomponent\030\002 \001(\0132(.Odb.Lib.Protobuf.Prod" + "uctModel.ComponentH\001\210\001\001\0224\n\003pin\030\003 \001(\0132\".O" + "db.Lib.Protobuf.ProductModel.PinH\002\210\001\001B\007\n" + "\005_nameB\014\n\n_componentB\006\n\004_pinb\006proto3" + ; +static const ::_pbi::DescriptorTable* const descriptor_table_pinconnection_2eproto_deps[2] = { + &::descriptor_table_component_2eproto, + &::descriptor_table_pin_2eproto, +}; +static ::_pbi::once_flag descriptor_table_pinconnection_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_pinconnection_2eproto = { + false, false, 276, descriptor_table_protodef_pinconnection_2eproto, + "pinconnection.proto", + &descriptor_table_pinconnection_2eproto_once, descriptor_table_pinconnection_2eproto_deps, 2, 1, + schemas, file_default_instances, TableStruct_pinconnection_2eproto::offsets, + file_level_metadata_pinconnection_2eproto, file_level_enum_descriptors_pinconnection_2eproto, + file_level_service_descriptors_pinconnection_2eproto, +}; +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_pinconnection_2eproto_getter() { + return &descriptor_table_pinconnection_2eproto; +} + +// Force running AddDescriptors() at dynamic initialization time. +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_pinconnection_2eproto(&descriptor_table_pinconnection_2eproto); +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { + +// =================================================================== + +class PinConnection::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_name(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static const ::Odb::Lib::Protobuf::ProductModel::Component& component(const PinConnection* msg); + static void set_has_component(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static const ::Odb::Lib::Protobuf::ProductModel::Pin& pin(const PinConnection* msg); + static void set_has_pin(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } +}; + +const ::Odb::Lib::Protobuf::ProductModel::Component& +PinConnection::_Internal::component(const PinConnection* msg) { + return *msg->_impl_.component_; +} +const ::Odb::Lib::Protobuf::ProductModel::Pin& +PinConnection::_Internal::pin(const PinConnection* msg) { + return *msg->_impl_.pin_; +} +void PinConnection::clear_component() { + if (_impl_.component_ != nullptr) _impl_.component_->Clear(); + _impl_._has_bits_[0] &= ~0x00000002u; +} +void PinConnection::clear_pin() { + if (_impl_.pin_ != nullptr) _impl_.pin_->Clear(); + _impl_._has_bits_[0] &= ~0x00000004u; +} +PinConnection::PinConnection(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:Odb.Lib.Protobuf.ProductModel.PinConnection) +} +PinConnection::PinConnection(const PinConnection& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + PinConnection* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.name_){} + , decltype(_impl_.component_){nullptr} + , decltype(_impl_.pin_){nullptr}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_name()) { + _this->_impl_.name_.Set(from._internal_name(), + _this->GetArenaForAllocation()); + } + if (from._internal_has_component()) { + _this->_impl_.component_ = new ::Odb::Lib::Protobuf::ProductModel::Component(*from._impl_.component_); + } + if (from._internal_has_pin()) { + _this->_impl_.pin_ = new ::Odb::Lib::Protobuf::ProductModel::Pin(*from._impl_.pin_); + } + // @@protoc_insertion_point(copy_constructor:Odb.Lib.Protobuf.ProductModel.PinConnection) +} + +inline void PinConnection::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.name_){} + , decltype(_impl_.component_){nullptr} + , decltype(_impl_.pin_){nullptr} + }; + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +PinConnection::~PinConnection() { + // @@protoc_insertion_point(destructor:Odb.Lib.Protobuf.ProductModel.PinConnection) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void PinConnection::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.name_.Destroy(); + if (this != internal_default_instance()) delete _impl_.component_; + if (this != internal_default_instance()) delete _impl_.pin_; +} + +void PinConnection::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void PinConnection::Clear() { +// @@protoc_insertion_point(message_clear_start:Odb.Lib.Protobuf.ProductModel.PinConnection) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x00000001u) { + _impl_.name_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000002u) { + GOOGLE_DCHECK(_impl_.component_ != nullptr); + _impl_.component_->Clear(); + } + if (cached_has_bits & 0x00000004u) { + GOOGLE_DCHECK(_impl_.pin_ != nullptr); + _impl_.pin_->Clear(); + } + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* PinConnection::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // optional string name = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_name(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "Odb.Lib.Protobuf.ProductModel.PinConnection.name")); + } else + goto handle_unusual; + continue; + // optional .Odb.Lib.Protobuf.ProductModel.Component component = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr = ctx->ParseMessage(_internal_mutable_component(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .Odb.Lib.Protobuf.ProductModel.Pin pin = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + ptr = ctx->ParseMessage(_internal_mutable_pin(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + _impl_._has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* PinConnection::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:Odb.Lib.Protobuf.ProductModel.PinConnection) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // optional string name = 1; + if (_internal_has_name()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_name().data(), static_cast(this->_internal_name().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "Odb.Lib.Protobuf.ProductModel.PinConnection.name"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_name(), target); + } + + // optional .Odb.Lib.Protobuf.ProductModel.Component component = 2; + if (_internal_has_component()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::component(this), + _Internal::component(this).GetCachedSize(), target, stream); + } + + // optional .Odb.Lib.Protobuf.ProductModel.Pin pin = 3; + if (_internal_has_pin()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::pin(this), + _Internal::pin(this).GetCachedSize(), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:Odb.Lib.Protobuf.ProductModel.PinConnection) + return target; +} + +size_t PinConnection::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:Odb.Lib.Protobuf.ProductModel.PinConnection) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000007u) { + // optional string name = 1; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); + } + + // optional .Odb.Lib.Protobuf.ProductModel.Component component = 2; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.component_); + } + + // optional .Odb.Lib.Protobuf.ProductModel.Pin pin = 3; + if (cached_has_bits & 0x00000004u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.pin_); + } + + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PinConnection::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + PinConnection::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PinConnection::GetClassData() const { return &_class_data_; } + + +void PinConnection::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:Odb.Lib.Protobuf.ProductModel.PinConnection) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_set_name(from._internal_name()); + } + if (cached_has_bits & 0x00000002u) { + _this->_internal_mutable_component()->::Odb::Lib::Protobuf::ProductModel::Component::MergeFrom( + from._internal_component()); + } + if (cached_has_bits & 0x00000004u) { + _this->_internal_mutable_pin()->::Odb::Lib::Protobuf::ProductModel::Pin::MergeFrom( + from._internal_pin()); + } + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void PinConnection::CopyFrom(const PinConnection& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:Odb.Lib.Protobuf.ProductModel.PinConnection) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PinConnection::IsInitialized() const { + return true; +} + +void PinConnection::InternalSwap(PinConnection* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.name_, lhs_arena, + &other->_impl_.name_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(PinConnection, _impl_.pin_) + + sizeof(PinConnection::_impl_.pin_) + - PROTOBUF_FIELD_OFFSET(PinConnection, _impl_.component_)>( + reinterpret_cast(&_impl_.component_), + reinterpret_cast(&other->_impl_.component_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata PinConnection::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_pinconnection_2eproto_getter, &descriptor_table_pinconnection_2eproto_once, + file_level_metadata_pinconnection_2eproto[0]); +} + +// @@protoc_insertion_point(namespace_scope) +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::Odb::Lib::Protobuf::ProductModel::PinConnection* +Arena::CreateMaybeMessage< ::Odb::Lib::Protobuf::ProductModel::PinConnection >(Arena* arena) { + return Arena::CreateMessageInternal< ::Odb::Lib::Protobuf::ProductModel::PinConnection >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/OdbDesignLib/ProtoBuf/pinconnection.pb.h b/OdbDesignLib/ProtoBuf/pinconnection.pb.h new file mode 100644 index 00000000..19df9e11 --- /dev/null +++ b/OdbDesignLib/ProtoBuf/pinconnection.pb.h @@ -0,0 +1,533 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: pinconnection.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_pinconnection_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_pinconnection_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3021000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "component.pb.h" +#include "pin.pb.h" +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_pinconnection_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_pinconnection_2eproto { + static const uint32_t offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_pinconnection_2eproto; +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { +class PinConnection; +struct PinConnectionDefaultTypeInternal; +extern PinConnectionDefaultTypeInternal _PinConnection_default_instance_; +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb +PROTOBUF_NAMESPACE_OPEN +template<> ::Odb::Lib::Protobuf::ProductModel::PinConnection* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::PinConnection>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { + +// =================================================================== + +class PinConnection final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.ProductModel.PinConnection) */ { + public: + inline PinConnection() : PinConnection(nullptr) {} + ~PinConnection() override; + explicit PROTOBUF_CONSTEXPR PinConnection(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + PinConnection(const PinConnection& from); + PinConnection(PinConnection&& from) noexcept + : PinConnection() { + *this = ::std::move(from); + } + + inline PinConnection& operator=(const PinConnection& from) { + CopyFrom(from); + return *this; + } + inline PinConnection& operator=(PinConnection&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const PinConnection& default_instance() { + return *internal_default_instance(); + } + static inline const PinConnection* internal_default_instance() { + return reinterpret_cast( + &_PinConnection_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(PinConnection& a, PinConnection& b) { + a.Swap(&b); + } + inline void Swap(PinConnection* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(PinConnection* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + PinConnection* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const PinConnection& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const PinConnection& from) { + PinConnection::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(PinConnection* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "Odb.Lib.Protobuf.ProductModel.PinConnection"; + } + protected: + explicit PinConnection(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kNameFieldNumber = 1, + kComponentFieldNumber = 2, + kPinFieldNumber = 3, + }; + // optional string name = 1; + bool has_name() const; + private: + bool _internal_has_name() const; + public: + void clear_name(); + const std::string& name() const; + template + void set_name(ArgT0&& arg0, ArgT... args); + std::string* mutable_name(); + PROTOBUF_NODISCARD std::string* release_name(); + void set_allocated_name(std::string* name); + private: + const std::string& _internal_name() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); + std::string* _internal_mutable_name(); + public: + + // optional .Odb.Lib.Protobuf.ProductModel.Component component = 2; + bool has_component() const; + private: + bool _internal_has_component() const; + public: + void clear_component(); + const ::Odb::Lib::Protobuf::ProductModel::Component& component() const; + PROTOBUF_NODISCARD ::Odb::Lib::Protobuf::ProductModel::Component* release_component(); + ::Odb::Lib::Protobuf::ProductModel::Component* mutable_component(); + void set_allocated_component(::Odb::Lib::Protobuf::ProductModel::Component* component); + private: + const ::Odb::Lib::Protobuf::ProductModel::Component& _internal_component() const; + ::Odb::Lib::Protobuf::ProductModel::Component* _internal_mutable_component(); + public: + void unsafe_arena_set_allocated_component( + ::Odb::Lib::Protobuf::ProductModel::Component* component); + ::Odb::Lib::Protobuf::ProductModel::Component* unsafe_arena_release_component(); + + // optional .Odb.Lib.Protobuf.ProductModel.Pin pin = 3; + bool has_pin() const; + private: + bool _internal_has_pin() const; + public: + void clear_pin(); + const ::Odb::Lib::Protobuf::ProductModel::Pin& pin() const; + PROTOBUF_NODISCARD ::Odb::Lib::Protobuf::ProductModel::Pin* release_pin(); + ::Odb::Lib::Protobuf::ProductModel::Pin* mutable_pin(); + void set_allocated_pin(::Odb::Lib::Protobuf::ProductModel::Pin* pin); + private: + const ::Odb::Lib::Protobuf::ProductModel::Pin& _internal_pin() const; + ::Odb::Lib::Protobuf::ProductModel::Pin* _internal_mutable_pin(); + public: + void unsafe_arena_set_allocated_pin( + ::Odb::Lib::Protobuf::ProductModel::Pin* pin); + ::Odb::Lib::Protobuf::ProductModel::Pin* unsafe_arena_release_pin(); + + // @@protoc_insertion_point(class_scope:Odb.Lib.Protobuf.ProductModel.PinConnection) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::Odb::Lib::Protobuf::ProductModel::Component* component_; + ::Odb::Lib::Protobuf::ProductModel::Pin* pin_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_pinconnection_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// PinConnection + +// optional string name = 1; +inline bool PinConnection::_internal_has_name() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool PinConnection::has_name() const { + return _internal_has_name(); +} +inline void PinConnection::clear_name() { + _impl_.name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& PinConnection::name() const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.PinConnection.name) + return _internal_name(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void PinConnection::set_name(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:Odb.Lib.Protobuf.ProductModel.PinConnection.name) +} +inline std::string* PinConnection::mutable_name() { + std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.ProductModel.PinConnection.name) + return _s; +} +inline const std::string& PinConnection::_internal_name() const { + return _impl_.name_.Get(); +} +inline void PinConnection::_internal_set_name(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(value, GetArenaForAllocation()); +} +inline std::string* PinConnection::_internal_mutable_name() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.name_.Mutable(GetArenaForAllocation()); +} +inline std::string* PinConnection::release_name() { + // @@protoc_insertion_point(field_release:Odb.Lib.Protobuf.ProductModel.PinConnection.name) + if (!_internal_has_name()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.name_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void PinConnection::set_allocated_name(std::string* name) { + if (name != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:Odb.Lib.Protobuf.ProductModel.PinConnection.name) +} + +// optional .Odb.Lib.Protobuf.ProductModel.Component component = 2; +inline bool PinConnection::_internal_has_component() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + PROTOBUF_ASSUME(!value || _impl_.component_ != nullptr); + return value; +} +inline bool PinConnection::has_component() const { + return _internal_has_component(); +} +inline const ::Odb::Lib::Protobuf::ProductModel::Component& PinConnection::_internal_component() const { + const ::Odb::Lib::Protobuf::ProductModel::Component* p = _impl_.component_; + return p != nullptr ? *p : reinterpret_cast( + ::Odb::Lib::Protobuf::ProductModel::_Component_default_instance_); +} +inline const ::Odb::Lib::Protobuf::ProductModel::Component& PinConnection::component() const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.PinConnection.component) + return _internal_component(); +} +inline void PinConnection::unsafe_arena_set_allocated_component( + ::Odb::Lib::Protobuf::ProductModel::Component* component) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.component_); + } + _impl_.component_ = component; + if (component) { + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:Odb.Lib.Protobuf.ProductModel.PinConnection.component) +} +inline ::Odb::Lib::Protobuf::ProductModel::Component* PinConnection::release_component() { + _impl_._has_bits_[0] &= ~0x00000002u; + ::Odb::Lib::Protobuf::ProductModel::Component* temp = _impl_.component_; + _impl_.component_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::Odb::Lib::Protobuf::ProductModel::Component* PinConnection::unsafe_arena_release_component() { + // @@protoc_insertion_point(field_release:Odb.Lib.Protobuf.ProductModel.PinConnection.component) + _impl_._has_bits_[0] &= ~0x00000002u; + ::Odb::Lib::Protobuf::ProductModel::Component* temp = _impl_.component_; + _impl_.component_ = nullptr; + return temp; +} +inline ::Odb::Lib::Protobuf::ProductModel::Component* PinConnection::_internal_mutable_component() { + _impl_._has_bits_[0] |= 0x00000002u; + if (_impl_.component_ == nullptr) { + auto* p = CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Component>(GetArenaForAllocation()); + _impl_.component_ = p; + } + return _impl_.component_; +} +inline ::Odb::Lib::Protobuf::ProductModel::Component* PinConnection::mutable_component() { + ::Odb::Lib::Protobuf::ProductModel::Component* _msg = _internal_mutable_component(); + // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.ProductModel.PinConnection.component) + return _msg; +} +inline void PinConnection::set_allocated_component(::Odb::Lib::Protobuf::ProductModel::Component* component) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.component_); + } + if (component) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(component)); + if (message_arena != submessage_arena) { + component = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, component, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + _impl_.component_ = component; + // @@protoc_insertion_point(field_set_allocated:Odb.Lib.Protobuf.ProductModel.PinConnection.component) +} + +// optional .Odb.Lib.Protobuf.ProductModel.Pin pin = 3; +inline bool PinConnection::_internal_has_pin() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + PROTOBUF_ASSUME(!value || _impl_.pin_ != nullptr); + return value; +} +inline bool PinConnection::has_pin() const { + return _internal_has_pin(); +} +inline const ::Odb::Lib::Protobuf::ProductModel::Pin& PinConnection::_internal_pin() const { + const ::Odb::Lib::Protobuf::ProductModel::Pin* p = _impl_.pin_; + return p != nullptr ? *p : reinterpret_cast( + ::Odb::Lib::Protobuf::ProductModel::_Pin_default_instance_); +} +inline const ::Odb::Lib::Protobuf::ProductModel::Pin& PinConnection::pin() const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.PinConnection.pin) + return _internal_pin(); +} +inline void PinConnection::unsafe_arena_set_allocated_pin( + ::Odb::Lib::Protobuf::ProductModel::Pin* pin) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.pin_); + } + _impl_.pin_ = pin; + if (pin) { + _impl_._has_bits_[0] |= 0x00000004u; + } else { + _impl_._has_bits_[0] &= ~0x00000004u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:Odb.Lib.Protobuf.ProductModel.PinConnection.pin) +} +inline ::Odb::Lib::Protobuf::ProductModel::Pin* PinConnection::release_pin() { + _impl_._has_bits_[0] &= ~0x00000004u; + ::Odb::Lib::Protobuf::ProductModel::Pin* temp = _impl_.pin_; + _impl_.pin_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::Odb::Lib::Protobuf::ProductModel::Pin* PinConnection::unsafe_arena_release_pin() { + // @@protoc_insertion_point(field_release:Odb.Lib.Protobuf.ProductModel.PinConnection.pin) + _impl_._has_bits_[0] &= ~0x00000004u; + ::Odb::Lib::Protobuf::ProductModel::Pin* temp = _impl_.pin_; + _impl_.pin_ = nullptr; + return temp; +} +inline ::Odb::Lib::Protobuf::ProductModel::Pin* PinConnection::_internal_mutable_pin() { + _impl_._has_bits_[0] |= 0x00000004u; + if (_impl_.pin_ == nullptr) { + auto* p = CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Pin>(GetArenaForAllocation()); + _impl_.pin_ = p; + } + return _impl_.pin_; +} +inline ::Odb::Lib::Protobuf::ProductModel::Pin* PinConnection::mutable_pin() { + ::Odb::Lib::Protobuf::ProductModel::Pin* _msg = _internal_mutable_pin(); + // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.ProductModel.PinConnection.pin) + return _msg; +} +inline void PinConnection::set_allocated_pin(::Odb::Lib::Protobuf::ProductModel::Pin* pin) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.pin_); + } + if (pin) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(pin)); + if (message_arena != submessage_arena) { + pin = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, pin, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000004u; + } else { + _impl_._has_bits_[0] &= ~0x00000004u; + } + _impl_.pin_ = pin; + // @@protoc_insertion_point(field_set_allocated:Odb.Lib.Protobuf.ProductModel.PinConnection.pin) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_pinconnection_2eproto diff --git a/OdbDesignLib/ProtoBuf/via.pb.cc b/OdbDesignLib/ProtoBuf/via.pb.cc new file mode 100644 index 00000000..975b7cfb --- /dev/null +++ b/OdbDesignLib/ProtoBuf/via.pb.cc @@ -0,0 +1,369 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: via.proto + +#include "via.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { +PROTOBUF_CONSTEXPR Via::Via( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.boardside_)*/0} {} +struct ViaDefaultTypeInternal { + PROTOBUF_CONSTEXPR ViaDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~ViaDefaultTypeInternal() {} + union { + Via _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ViaDefaultTypeInternal _Via_default_instance_; +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb +static ::_pb::Metadata file_level_metadata_via_2eproto[1]; +static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_via_2eproto = nullptr; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_via_2eproto = nullptr; + +const uint32_t TableStruct_via_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Via, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Via, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Via, _impl_.name_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::ProductModel::Via, _impl_.boardside_), + 0, + 1, +}; +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, 8, -1, sizeof(::Odb::Lib::Protobuf::ProductModel::Via)}, +}; + +static const ::_pb::Message* const file_default_instances[] = { + &::Odb::Lib::Protobuf::ProductModel::_Via_default_instance_._instance, +}; + +const char descriptor_table_protodef_via_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\tvia.proto\022\035Odb.Lib.Protobuf.ProductMod" + "el\032\013enums.proto\"d\n\003Via\022\021\n\004name\030\001 \001(\tH\000\210\001" + "\001\0223\n\tboardSide\030\002 \001(\0162\033.Odb.Lib.Protobuf." + "BoardSideH\001\210\001\001B\007\n\005_nameB\014\n\n_boardSideb\006p" + "roto3" + ; +static const ::_pbi::DescriptorTable* const descriptor_table_via_2eproto_deps[1] = { + &::descriptor_table_enums_2eproto, +}; +static ::_pbi::once_flag descriptor_table_via_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_via_2eproto = { + false, false, 165, descriptor_table_protodef_via_2eproto, + "via.proto", + &descriptor_table_via_2eproto_once, descriptor_table_via_2eproto_deps, 1, 1, + schemas, file_default_instances, TableStruct_via_2eproto::offsets, + file_level_metadata_via_2eproto, file_level_enum_descriptors_via_2eproto, + file_level_service_descriptors_via_2eproto, +}; +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_via_2eproto_getter() { + return &descriptor_table_via_2eproto; +} + +// Force running AddDescriptors() at dynamic initialization time. +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_via_2eproto(&descriptor_table_via_2eproto); +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { + +// =================================================================== + +class Via::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static void set_has_name(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_boardside(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } +}; + +Via::Via(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:Odb.Lib.Protobuf.ProductModel.Via) +} +Via::Via(const Via& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + Via* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.name_){} + , decltype(_impl_.boardside_){}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_name()) { + _this->_impl_.name_.Set(from._internal_name(), + _this->GetArenaForAllocation()); + } + _this->_impl_.boardside_ = from._impl_.boardside_; + // @@protoc_insertion_point(copy_constructor:Odb.Lib.Protobuf.ProductModel.Via) +} + +inline void Via::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.name_){} + , decltype(_impl_.boardside_){0} + }; + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +Via::~Via() { + // @@protoc_insertion_point(destructor:Odb.Lib.Protobuf.ProductModel.Via) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void Via::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.name_.Destroy(); +} + +void Via::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Via::Clear() { +// @@protoc_insertion_point(message_clear_start:Odb.Lib.Protobuf.ProductModel.Via) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + _impl_.name_.ClearNonDefaultToEmpty(); + } + _impl_.boardside_ = 0; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* Via::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // optional string name = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_name(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "Odb.Lib.Protobuf.ProductModel.Via.name")); + } else + goto handle_unusual; + continue; + // optional .Odb.Lib.Protobuf.BoardSide boardSide = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_boardside(static_cast<::Odb::Lib::Protobuf::BoardSide>(val)); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + _impl_._has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* Via::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:Odb.Lib.Protobuf.ProductModel.Via) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // optional string name = 1; + if (_internal_has_name()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_name().data(), static_cast(this->_internal_name().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "Odb.Lib.Protobuf.ProductModel.Via.name"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_name(), target); + } + + // optional .Odb.Lib.Protobuf.BoardSide boardSide = 2; + if (_internal_has_boardside()) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 2, this->_internal_boardside(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:Odb.Lib.Protobuf.ProductModel.Via) + return target; +} + +size_t Via::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:Odb.Lib.Protobuf.ProductModel.Via) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + // optional string name = 1; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); + } + + // optional .Odb.Lib.Protobuf.BoardSide boardSide = 2; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_boardside()); + } + + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Via::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Via::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Via::GetClassData() const { return &_class_data_; } + + +void Via::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:Odb.Lib.Protobuf.ProductModel.Via) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_set_name(from._internal_name()); + } + if (cached_has_bits & 0x00000002u) { + _this->_impl_.boardside_ = from._impl_.boardside_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Via::CopyFrom(const Via& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:Odb.Lib.Protobuf.ProductModel.Via) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Via::IsInitialized() const { + return true; +} + +void Via::InternalSwap(Via* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.name_, lhs_arena, + &other->_impl_.name_, rhs_arena + ); + swap(_impl_.boardside_, other->_impl_.boardside_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Via::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_via_2eproto_getter, &descriptor_table_via_2eproto_once, + file_level_metadata_via_2eproto[0]); +} + +// @@protoc_insertion_point(namespace_scope) +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::Odb::Lib::Protobuf::ProductModel::Via* +Arena::CreateMaybeMessage< ::Odb::Lib::Protobuf::ProductModel::Via >(Arena* arena) { + return Arena::CreateMessageInternal< ::Odb::Lib::Protobuf::ProductModel::Via >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/OdbDesignLib/ProtoBuf/via.pb.h b/OdbDesignLib/ProtoBuf/via.pb.h new file mode 100644 index 00000000..02baad12 --- /dev/null +++ b/OdbDesignLib/ProtoBuf/via.pb.h @@ -0,0 +1,361 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: via.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_via_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_via_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3021000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "enums.pb.h" +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_via_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_via_2eproto { + static const uint32_t offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_via_2eproto; +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { +class Via; +struct ViaDefaultTypeInternal; +extern ViaDefaultTypeInternal _Via_default_instance_; +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb +PROTOBUF_NAMESPACE_OPEN +template<> ::Odb::Lib::Protobuf::ProductModel::Via* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Via>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace Odb { +namespace Lib { +namespace Protobuf { +namespace ProductModel { + +// =================================================================== + +class Via final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.ProductModel.Via) */ { + public: + inline Via() : Via(nullptr) {} + ~Via() override; + explicit PROTOBUF_CONSTEXPR Via(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + Via(const Via& from); + Via(Via&& from) noexcept + : Via() { + *this = ::std::move(from); + } + + inline Via& operator=(const Via& from) { + CopyFrom(from); + return *this; + } + inline Via& operator=(Via&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Via& default_instance() { + return *internal_default_instance(); + } + static inline const Via* internal_default_instance() { + return reinterpret_cast( + &_Via_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(Via& a, Via& b) { + a.Swap(&b); + } + inline void Swap(Via* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Via* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Via* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const Via& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const Via& from) { + Via::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Via* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "Odb.Lib.Protobuf.ProductModel.Via"; + } + protected: + explicit Via(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kNameFieldNumber = 1, + kBoardSideFieldNumber = 2, + }; + // optional string name = 1; + bool has_name() const; + private: + bool _internal_has_name() const; + public: + void clear_name(); + const std::string& name() const; + template + void set_name(ArgT0&& arg0, ArgT... args); + std::string* mutable_name(); + PROTOBUF_NODISCARD std::string* release_name(); + void set_allocated_name(std::string* name); + private: + const std::string& _internal_name() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); + std::string* _internal_mutable_name(); + public: + + // optional .Odb.Lib.Protobuf.BoardSide boardSide = 2; + bool has_boardside() const; + private: + bool _internal_has_boardside() const; + public: + void clear_boardside(); + ::Odb::Lib::Protobuf::BoardSide boardside() const; + void set_boardside(::Odb::Lib::Protobuf::BoardSide value); + private: + ::Odb::Lib::Protobuf::BoardSide _internal_boardside() const; + void _internal_set_boardside(::Odb::Lib::Protobuf::BoardSide value); + public: + + // @@protoc_insertion_point(class_scope:Odb.Lib.Protobuf.ProductModel.Via) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + int boardside_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_via_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Via + +// optional string name = 1; +inline bool Via::_internal_has_name() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool Via::has_name() const { + return _internal_has_name(); +} +inline void Via::clear_name() { + _impl_.name_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& Via::name() const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Via.name) + return _internal_name(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void Via::set_name(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:Odb.Lib.Protobuf.ProductModel.Via.name) +} +inline std::string* Via::mutable_name() { + std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.ProductModel.Via.name) + return _s; +} +inline const std::string& Via::_internal_name() const { + return _impl_.name_.Get(); +} +inline void Via::_internal_set_name(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.name_.Set(value, GetArenaForAllocation()); +} +inline std::string* Via::_internal_mutable_name() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.name_.Mutable(GetArenaForAllocation()); +} +inline std::string* Via::release_name() { + // @@protoc_insertion_point(field_release:Odb.Lib.Protobuf.ProductModel.Via.name) + if (!_internal_has_name()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.name_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void Via::set_allocated_name(std::string* name) { + if (name != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:Odb.Lib.Protobuf.ProductModel.Via.name) +} + +// optional .Odb.Lib.Protobuf.BoardSide boardSide = 2; +inline bool Via::_internal_has_boardside() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool Via::has_boardside() const { + return _internal_has_boardside(); +} +inline void Via::clear_boardside() { + _impl_.boardside_ = 0; + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline ::Odb::Lib::Protobuf::BoardSide Via::_internal_boardside() const { + return static_cast< ::Odb::Lib::Protobuf::BoardSide >(_impl_.boardside_); +} +inline ::Odb::Lib::Protobuf::BoardSide Via::boardside() const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.ProductModel.Via.boardSide) + return _internal_boardside(); +} +inline void Via::_internal_set_boardside(::Odb::Lib::Protobuf::BoardSide value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.boardside_ = value; +} +inline void Via::set_boardside(::Odb::Lib::Protobuf::BoardSide value) { + _internal_set_boardside(value); + // @@protoc_insertion_point(field_set:Odb.Lib.Protobuf.ProductModel.Via.boardSide) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace ProductModel +} // namespace Protobuf +} // namespace Lib +} // namespace Odb + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_via_2eproto diff --git a/OdbDesignLib/protoc/component.proto b/OdbDesignLib/protoc/component.proto new file mode 100644 index 00000000..25b15cb6 --- /dev/null +++ b/OdbDesignLib/protoc/component.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +//// https://protobuf.dev/reference/cpp/cpp-generated/#message +//option optimize_for = CODE_SIZE; + +import "enums.proto"; +import "part.proto"; +import "package.proto"; + +package Odb.Lib.Protobuf.ProductModel; + +// +// Component.h +// + +message Component { + + // std::string m_refDes; + // std::string m_partName; + // std::shared_ptr m_pPackage; + // unsigned int m_index; + // BoardSide m_side; + // std::shared_ptr m_pPart; + + optional string refDes = 1; + optional string partName = 2; + optional Package package = 3; + optional uint32 index = 4; + optional BoardSide side = 5; + optional Part part = 6; + +} \ No newline at end of file diff --git a/OdbDesignLib/protoc/design.proto b/OdbDesignLib/protoc/design.proto index 92909540..a70a6324 100644 --- a/OdbDesignLib/protoc/design.proto +++ b/OdbDesignLib/protoc/design.proto @@ -3,10 +3,13 @@ syntax = "proto3"; //// https://protobuf.dev/reference/cpp/cpp-generated/#message //option optimize_for = CODE_SIZE; -package Odb.Lib.Protobuf; - - import "filearchive.proto"; +import "net.proto"; +import "package.proto"; +import "component.proto"; +import "part.proto"; + +package Odb.Lib.Protobuf.ProductModel; // // Design.h @@ -14,6 +17,33 @@ import "filearchive.proto"; message Design { - optional FileArchive fileArchive = 1; + // std::string m_productModel; + // std::string m_name; + + // std::shared_ptr m_pFileModel; + + // Net::Vector m_nets; + // Net::StringMap m_netsByName; + + // Package::Vector m_packages; + // Package::StringMap m_packagesByName; + + // Component::Vector m_components; + // Component::StringMap m_componentsByName; + + // Part::Vector m_parts; + // Part::StringMap m_partsByName; + optional string productModel = 1; + optional string name = 2; + optional FileArchive fileModel = 3; + repeated Net nets = 4; + map netsByName = 5; + repeated Package packages = 6; + map packagesByName = 7; + repeated Component components = 8; + map componentsByName = 9; + repeated Part parts = 10; + map partsByName = 11; + } \ No newline at end of file diff --git a/OdbDesignLib/protoc/net.proto b/OdbDesignLib/protoc/net.proto new file mode 100644 index 00000000..9dbf5df8 --- /dev/null +++ b/OdbDesignLib/protoc/net.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +//// https://protobuf.dev/reference/cpp/cpp-generated/#message +//option optimize_for = CODE_SIZE; + +import "pinconnection.proto"; + +package Odb.Lib.Protobuf.ProductModel; + +// +// Net.h +// + +message Net { + + // std::string m_name; + // PinConnection::Vector m_pinConnections; + // unsigned int m_index; + + optional string name = 1; + repeated PinConnection pinConnections = 2; + optional uint32 index = 3; + +} \ No newline at end of file diff --git a/OdbDesignLib/protoc/package.proto b/OdbDesignLib/protoc/package.proto new file mode 100644 index 00000000..ee5a74d6 --- /dev/null +++ b/OdbDesignLib/protoc/package.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +//// https://protobuf.dev/reference/cpp/cpp-generated/#message +//option optimize_for = CODE_SIZE; + +import "pin.proto"; + +package Odb.Lib.Protobuf.ProductModel; + +// +// Package.h +// + +message Package { + + // std::string m_name; + // Pin::Vector m_pins; + // Pin::StringMap m_pinsByName; + // unsigned int m_index; + + optional string name = 1; + repeated Pin pins = 2; + map pinsByName = 3; + optional uint32 index = 4; +} \ No newline at end of file diff --git a/OdbDesignLib/protoc/part.proto b/OdbDesignLib/protoc/part.proto new file mode 100644 index 00000000..1acaaa9e --- /dev/null +++ b/OdbDesignLib/protoc/part.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +//// https://protobuf.dev/reference/cpp/cpp-generated/#message +//option optimize_for = CODE_SIZE; + +package Odb.Lib.Protobuf.ProductModel; + +// +// Part.h +// + +message Part { + + optional string name = 1; + +} \ No newline at end of file diff --git a/OdbDesignLib/protoc/pin.proto b/OdbDesignLib/protoc/pin.proto new file mode 100644 index 00000000..ec1c2628 --- /dev/null +++ b/OdbDesignLib/protoc/pin.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +//// https://protobuf.dev/reference/cpp/cpp-generated/#message +//option optimize_for = CODE_SIZE; + +package Odb.Lib.Protobuf.ProductModel; + +// +// Pin.h +// + +message Pin { + + optional string name = 1; + optional uint32 index = 2; + +} \ No newline at end of file diff --git a/OdbDesignLib/protoc/pinconnection.proto b/OdbDesignLib/protoc/pinconnection.proto new file mode 100644 index 00000000..cef956c6 --- /dev/null +++ b/OdbDesignLib/protoc/pinconnection.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +//// https://protobuf.dev/reference/cpp/cpp-generated/#message +//option optimize_for = CODE_SIZE; + +import "component.proto"; +import "pin.proto"; + +package Odb.Lib.Protobuf.ProductModel; + +// +// PinConnection.h +// + +message PinConnection { + + // std::string m_name; + // std::shared_ptr m_pComponent; + // std::shared_ptr m_pPin; + + optional string name = 1; + optional Component component = 2; + optional Pin pin = 3; + +} \ No newline at end of file diff --git a/OdbDesignLib/protoc/via.proto b/OdbDesignLib/protoc/via.proto new file mode 100644 index 00000000..4ca99391 --- /dev/null +++ b/OdbDesignLib/protoc/via.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +//// https://protobuf.dev/reference/cpp/cpp-generated/#message +//option optimize_for = CODE_SIZE; + +import "enums.proto"; + +package Odb.Lib.Protobuf.ProductModel; + +// +// Via.h +// + +message Via { + + optional string name = 1; + optional BoardSide boardSide = 2; + +} \ No newline at end of file diff --git a/OdbDesignServer/CMakeLists.txt b/OdbDesignServer/CMakeLists.txt index c6cdded3..0f9e4b69 100644 --- a/OdbDesignServer/CMakeLists.txt +++ b/OdbDesignServer/CMakeLists.txt @@ -1,7 +1,7 @@ # CMakeList.txt : CMake project for OdbDesignServer # -add_executable(OdbDesignServer "main.cpp" "Controllers/HelloWorldController.h" "Controllers/HelloWorldController.cpp" "OdbDesignServerApp.h" "OdbDesignServerApp.cpp" "OdbDesignServer.h" "Controllers/FileUploadController.h" "Controllers/FileUploadController.cpp" "Controllers/FileModelController.h" "Controllers/FileModelController.cpp" "Controllers/HealthCheckController.h" "Controllers/HealthCheckController.cpp") +add_executable(OdbDesignServer "main.cpp" "Controllers/HelloWorldController.h" "Controllers/HelloWorldController.cpp" "OdbDesignServerApp.h" "OdbDesignServerApp.cpp" "OdbDesignServer.h" "Controllers/FileUploadController.h" "Controllers/FileUploadController.cpp" "Controllers/FileModelController.h" "Controllers/FileModelController.cpp" "Controllers/HealthCheckController.h" "Controllers/HealthCheckController.cpp" "Controllers/DesignsController.h" "Controllers/DesignsController.cpp") ## PCH file (GLOB_RECURSE ODBDESIGN_SERVER_HEADER_FILES "*.h") diff --git a/OdbDesignServer/Controllers/DesignsController.cpp b/OdbDesignServer/Controllers/DesignsController.cpp new file mode 100644 index 00000000..062dd934 --- /dev/null +++ b/OdbDesignServer/Controllers/DesignsController.cpp @@ -0,0 +1,13 @@ +#include "DesignsController.h" + +namespace Odb::App::Server +{ + DesignsController::DesignsController(Odb::Lib::App::IOdbServerApp& serverApp) + : RouteController(serverApp) + { + } + + void DesignsController::register_routes() + { + } +} \ No newline at end of file diff --git a/OdbDesignServer/Controllers/DesignsController.h b/OdbDesignServer/Controllers/DesignsController.h new file mode 100644 index 00000000..9ef7c7a4 --- /dev/null +++ b/OdbDesignServer/Controllers/DesignsController.h @@ -0,0 +1,19 @@ +#pragma once + +#include "App/RouteController.h" + +namespace Odb::App::Server +{ + class DesignsController : public Odb::Lib::App::RouteController + { + public: + + DesignsController(Odb::Lib::App::IOdbServerApp& serverApp); + + // Inherited via RouteController + void register_routes() override; + + private: + + }; +} diff --git a/OdbDesignServer/Controllers/FileModelController.cpp b/OdbDesignServer/Controllers/FileModelController.cpp index c5a753b0..47ac9f4c 100644 --- a/OdbDesignServer/Controllers/FileModelController.cpp +++ b/OdbDesignServer/Controllers/FileModelController.cpp @@ -43,146 +43,326 @@ namespace Odb::App::Server CROW_ROUTE(m_serverApp.crow_app(), "/filemodels") ([&](const crow::request& req) { - return this->designs_list_route_handler(req); + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + + return this->filemodels_list_route_handler(req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/filemodel/") + CROW_ROUTE(m_serverApp.crow_app(), "/filemodels/") ([&](const crow::request& req, std::string designName) { - return this->designs_route_handler(designName, req); + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + + return this->filemodels_route_handler(designName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/filemodel//steps/") + CROW_ROUTE(m_serverApp.crow_app(), "/filemodels//steps/") ([&](const crow::request& req, std::string designName, std::string stepName) { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + return this->steps_route_handler(designName, stepName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/filemodel//steps") + CROW_ROUTE(m_serverApp.crow_app(), "/filemodels//steps") ([&](const crow::request& req, std::string designName) { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + return this->steps_list_route_handler(designName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/filemodel//steps//eda_data") + CROW_ROUTE(m_serverApp.crow_app(), "/filemodels//steps//eda_data") ([&](const crow::request& req, std::string designName, std::string stepName) { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + return this->steps_edadata_route_handler(designName, stepName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/filemodel//steps//attrlist") + CROW_ROUTE(m_serverApp.crow_app(), "/filemodels//steps//attrlist") ([&](const crow::request& req, std::string designName, std::string stepName) { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + return this->steps_attrlist_route_handler(designName, stepName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/filemodel//steps//profile") + CROW_ROUTE(m_serverApp.crow_app(), "/filemodels//steps//profile") ([&](const crow::request& req, std::string designName, std::string stepName) { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + return this->steps_profile_route_handler(designName, stepName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/filemodel//steps//stephdr") + CROW_ROUTE(m_serverApp.crow_app(), "/filemodels//steps//stephdr") ([&](const crow::request& req, std::string designName, std::string stepName) { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + return this->steps_stephdr_route_handler(designName, stepName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/filemodel//steps//netlists/") + CROW_ROUTE(m_serverApp.crow_app(), "/filemodels//steps//netlists/") ([&](const crow::request& req, std::string designName, std::string stepName, std::string netlistName) { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + return this->steps_netlists_route_handler(designName, stepName, netlistName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/filemodel//steps//netlists") + CROW_ROUTE(m_serverApp.crow_app(), "/filemodels//steps//netlists") ([&](const crow::request& req, std::string designName, std::string stepName) { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + return this->steps_netlists_list_route_handler(designName, stepName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/filemodel//steps//layers/") + CROW_ROUTE(m_serverApp.crow_app(), "/filemodels//steps//layers/") ([&](const crow::request& req, std::string designName, std::string stepName, std::string layerName) { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + return this->steps_layers_route_handler(designName, stepName, layerName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/filemodel//steps//layers") + CROW_ROUTE(m_serverApp.crow_app(), "/filemodels//steps//layers") ([&](const crow::request& req, std::string designName, std::string stepName) { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + return this->steps_layers_list_route_handler(designName, stepName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/filemodel//steps//layer//components") + CROW_ROUTE(m_serverApp.crow_app(), "/filemodels//steps//layer//components") ([&](const crow::request& req, std::string designName, std::string stepName, std::string layerName) { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + return this->steps_layers_components_route_handler(designName, stepName, layerName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/filemodel//steps//layers//features") + CROW_ROUTE(m_serverApp.crow_app(), "/filemodels//steps//layers//features") ([&](const crow::request& req, std::string designName, std::string stepName, std::string layerName) { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + return this->steps_layers_features_route_handler(designName, stepName, layerName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/filemodel//steps//layers//attrlist") + CROW_ROUTE(m_serverApp.crow_app(), "/filemodels//steps//layers//attrlist") ([&](const crow::request& req, std::string designName, std::string stepName, std::string layerName) { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + return this->steps_layers_attrlist_route_handler(designName, stepName, layerName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/filemodel//symbols/") + CROW_ROUTE(m_serverApp.crow_app(), "/filemodels//symbols/") ([&](const crow::request& req, std::string designName, std::string symbolName) { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + return this->symbols_route_handler(designName, symbolName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/filemodel//symbols//features") + CROW_ROUTE(m_serverApp.crow_app(), "/filemodels//symbols//features") ([&](const crow::request& req, std::string designName, std::string symbolName) { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + return this->symbols_features_route_handler(designName, symbolName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/filemodel//symbols//attrlist") + CROW_ROUTE(m_serverApp.crow_app(), "/filemodels//symbols//attrlist") ([&](const crow::request& req, std::string designName, std::string symbolName) { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + return this->symbols_attrlist_route_handler(designName, symbolName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/filemodel//symbols") + CROW_ROUTE(m_serverApp.crow_app(), "/filemodels//symbols") ([&](const crow::request& req, std::string designName) { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + return this->symbols_list_route_handler(designName, req); }); - //register_route_handler("/filemodel/misc/attrlist", std::bind(&FileModelController::misc_attrlist_route_handler, this, std::placeholders::_1)); - //register_route_handler("/filemodel/matrix/matrix", std::bind(&FileModelController::matrix_matrix_route_handler, this, std::placeholders::_1)); - //register_route_handler("/filemodel/misc/info", std::bind(&FileModelController::misc_info_route_handler, this, std::placeholders::_1)); + //register_route_handler("/filemodels/misc/attrlist", std::bind(&FileModelController::misc_attrlist_route_handler, this, std::placeholders::_1)); + //register_route_handler("/filemodels/matrix/matrix", std::bind(&FileModelController::matrix_matrix_route_handler, this, std::placeholders::_1)); + //register_route_handler("/filemodels/misc/info", std::bind(&FileModelController::misc_info_route_handler, this, std::placeholders::_1)); - CROW_ROUTE(m_serverApp.crow_app(), "/filemodel//misc/attrlist") + CROW_ROUTE(m_serverApp.crow_app(), "/filemodels//misc/attrlist") ([&](const crow::request& req, std::string designName) { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + return this->misc_attrlist_route_handler(designName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/filemodel//matrix/matrix") + CROW_ROUTE(m_serverApp.crow_app(), "/filemodels//matrix/matrix") ([&](const crow::request& req, std::string designName) { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + return this->matrix_matrix_route_handler(designName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/filemodel//misc/info") + CROW_ROUTE(m_serverApp.crow_app(), "/filemodels//misc/info") ([&](const crow::request& req, std::string designName) { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + return this->misc_info_route_handler(designName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/filemodel//fonts/standard") + CROW_ROUTE(m_serverApp.crow_app(), "/filemodels//fonts/standard") ([&](const crow::request& req, std::string designName) { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + return this->fonts_standard_route_handler(designName, req); }); } + crow::response FileModelController::filemodels_route_handler(const std::string& designName, const crow::request& req) + { + auto designNameDecoded = UrlEncoding::decode(designName); + if (designNameDecoded.empty()) + { + return crow::response(crow::status::BAD_REQUEST, "design name not specified"); + } + + auto pFileArchive = m_serverApp.designs().GetFileArchive(designNameDecoded); + if (pFileArchive == nullptr) + { + std::stringstream ss; + ss << "design: \"" << designNameDecoded << "\" not found"; + return crow::response(crow::status::NOT_FOUND, ss.str()); + } + + return crow::response(JsonCrowReturnable(*pFileArchive)); + } + crow::response FileModelController::steps_edadata_route_handler(const std::string& designName, const std::string& stepName, const crow::request& req) @@ -871,28 +1051,9 @@ namespace Odb::App::Server crow::json::wvalue jsonResponse; jsonResponse["symbols"] = std::move(symbolNames); return crow::response(jsonResponse); - } - - crow::response FileModelController::designs_route_handler(const std::string& designName, const crow::request& req) - { - auto designNameDecoded = UrlEncoding::decode(designName); - if (designNameDecoded.empty()) - { - return crow::response(crow::status::BAD_REQUEST, "design name not specified"); - } - - auto pFileArchive = m_serverApp.designs().GetFileArchive(designNameDecoded); - if (pFileArchive == nullptr) - { - std::stringstream ss; - ss << "design: \"" << designNameDecoded << "\" not found"; - return crow::response(crow::status::NOT_FOUND, ss.str()); - } - - return crow::response(JsonCrowReturnable(*pFileArchive)); - } + } - crow::response FileModelController::designs_list_route_handler(const crow::request& req) + crow::response FileModelController::filemodels_list_route_handler(const crow::request& req) { const auto& fileArchives = m_serverApp.designs().getUnloadedDesignNames(); diff --git a/OdbDesignServer/Controllers/FileModelController.h b/OdbDesignServer/Controllers/FileModelController.h index da6404d7..1f7fd490 100644 --- a/OdbDesignServer/Controllers/FileModelController.h +++ b/OdbDesignServer/Controllers/FileModelController.h @@ -11,11 +11,11 @@ namespace Odb::App::Server FileModelController(Odb::Lib::App::IOdbServerApp& serverApp); //virtual ~FileModelController() = default; - virtual void register_routes() override; + void register_routes() override; private: - crow::response designs_route_handler(const std::string& designName, const crow::request& req); - crow::response designs_list_route_handler(const crow::request& req); + crow::response filemodels_route_handler(const std::string& designName, const crow::request& req); + crow::response filemodels_list_route_handler(const crow::request& req); crow::response steps_route_handler(const std::string& designName, const std::string& stepName, const crow::request& req); crow::response steps_edadata_route_handler(const std::string& designName, const std::string& stepName, const crow::request& req); diff --git a/OdbDesignServer/Controllers/FileUploadController.cpp b/OdbDesignServer/Controllers/FileUploadController.cpp index 88c19152..1d97cbe7 100644 --- a/OdbDesignServer/Controllers/FileUploadController.cpp +++ b/OdbDesignServer/Controllers/FileUploadController.cpp @@ -12,9 +12,17 @@ namespace Odb::App::Server void FileUploadController::register_routes() { - CROW_ROUTE(m_serverApp.crow_app(), "/designs/upload/").methods(crow::HTTPMethod::POST) + CROW_ROUTE(m_serverApp.crow_app(), "/files/upload/") + .methods(crow::HTTPMethod::POST) ([&](const crow::request& req, std::string filename) { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + const auto& contentType = req.get_header_value("Content-Type"); if (contentType != "application/octet-stream") { @@ -24,21 +32,38 @@ namespace Odb::App::Server return handleOctetStreamUpload(filename, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/designs/upload").methods(crow::HTTPMethod::POST) + CROW_ROUTE(m_serverApp.crow_app(), "/files/upload") + .methods(crow::HTTPMethod::POST) ([&](const crow::request& req) { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + const auto& contentType = req.get_header_value("Content-Type"); - if (contentType != "multipart/form-upload") + if (contentType.find("multipart/form-data") != 0) { - return crow::response(crow::status::BAD_REQUEST, "unsupported content type: this endpoint only accepts 'multipart/form-upload'"); + // "Content-Type" header doesn't start with "multipart/form-data" + return crow::response(crow::status::BAD_REQUEST, "unsupported content type: this endpoint only accepts 'multipart/form-data'"); } return handleMultipartFormUpload(req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/designs/list").methods(crow::HTTPMethod::GET) + CROW_ROUTE(m_serverApp.crow_app(), "/files/list") + .methods(crow::HTTPMethod::GET) ([&](const crow::request& req) - { + { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + return makeLoadedDesignsResponse(); }); @@ -95,12 +120,16 @@ namespace Odb::App::Server const auto& part_value = part.second; CROW_LOG_DEBUG << "Part: " << part_name; - if ("InputFile" != part_name) + if (MULTIPART_FORMDATA_PART_NAME != part_name) { // log to debug and skip rest of the loop CROW_LOG_DEBUG << " Value: " << part_value.body << '\n'; continue; } + else + { + CROW_LOG_ERROR << "multipart/form-data POST failed! Part name was: [" << part_name << "], which is not supported. Part name should be [" << MULTIPART_FORMDATA_PART_NAME << "]."; + } // Extract the file name auto headers_it = part_value.headers.find("Content-Disposition"); diff --git a/OdbDesignServer/Controllers/FileUploadController.h b/OdbDesignServer/Controllers/FileUploadController.h index 48483e9d..76419b22 100644 --- a/OdbDesignServer/Controllers/FileUploadController.h +++ b/OdbDesignServer/Controllers/FileUploadController.h @@ -18,7 +18,11 @@ namespace Odb::App::Server crow::response makeLoadedDesignsResponse() const; + // TODO: actually implement sanitizeFilename() std::string sanitizeFilename(const std::string& filename) const; + + constexpr static const inline char MULTIPART_FORMDATA_PART_NAME[] = "file"; + //constexpr static const inline char MULTIPART_FORMDATA_PART_NAME[] = "InputFile" }; } diff --git a/OdbDesignServer/Controllers/HealthCheckController.h b/OdbDesignServer/Controllers/HealthCheckController.h index f1c16f5a..d9f12b41 100644 --- a/OdbDesignServer/Controllers/HealthCheckController.h +++ b/OdbDesignServer/Controllers/HealthCheckController.h @@ -12,7 +12,7 @@ namespace Odb::App::Server public: HealthCheckController(Odb::Lib::App::IOdbServerApp& serverApp); - virtual void register_routes() override; + void register_routes() override; private: crow::response health_check_live(const crow::request& req); diff --git a/OdbDesignServer/OdbDesignServerApp.cpp b/OdbDesignServer/OdbDesignServerApp.cpp index 0ea772aa..55bba60a 100644 --- a/OdbDesignServer/OdbDesignServerApp.cpp +++ b/OdbDesignServer/OdbDesignServerApp.cpp @@ -4,8 +4,10 @@ #include "Controllers/FileUploadController.h" #include "Controllers/FileModelController.h" #include "Controllers/HealthCheckController.h" +#include "Controllers/DesignsController.h" #include "macros.h" +using namespace Odb::Lib::App; namespace Odb::App::Server { @@ -18,12 +20,32 @@ namespace Odb::App::Server //{ //} - Utils::ExitCode OdbDesignServerApp::Run() + //Utils::ExitCode OdbDesignServerApp::Run() + //{ + // // + // // do any initialization here + // // + + // auto result = OdbServerAppBase::Run(); + + // // + // // do any cleanup here + // // + + // return result; + //} + + void OdbDesignServerApp::add_controllers() { - // - // do any initialization here - // + m_vecControllers.push_back(std::make_shared(*this)); + m_vecControllers.push_back(std::make_shared(*this)); + m_vecControllers.push_back(std::make_shared(*this)); + m_vecControllers.push_back(std::make_shared(*this)); + m_vecControllers.push_back(std::make_shared(*this)); + } + bool OdbDesignServerApp::preServerRun() + { // CORS auto& cors = crow_app().get_middleware(); if (Utils::IsProduction()) @@ -41,18 +63,10 @@ namespace Odb::App::Server //cors.global().origin("73.157.184.219"); } - return OdbServerAppBase::Run(); + // add authentication + auto basicRequestAuth = std::make_unique(BasicRequestAuthentication()); + request_auth(std::move(basicRequestAuth)); - // - // do any cleanup here - // + return true; } - - void OdbDesignServerApp::add_controllers() - { - m_vecControllers.push_back(std::make_shared(*this)); - m_vecControllers.push_back(std::make_shared(*this)); - m_vecControllers.push_back(std::make_shared(*this)); - m_vecControllers.push_back(std::make_shared(*this)); - } } \ No newline at end of file diff --git a/OdbDesignServer/OdbDesignServerApp.h b/OdbDesignServer/OdbDesignServerApp.h index c5b5ab21..0995631c 100644 --- a/OdbDesignServer/OdbDesignServerApp.h +++ b/OdbDesignServer/OdbDesignServerApp.h @@ -12,10 +12,15 @@ namespace Odb::App::Server OdbDesignServerApp(int argc, char* argv[]); //~OdbDesignServerApp(); - Utils::ExitCode Run() override; + //Utils::ExitCode Run() override; protected: void add_controllers() override; + + // Inherited via OdbServerAppBase + bool preServerRun() override; + //bool postServerRun() override; + }; } diff --git a/OdbDesignTests/CMakeLists.txt b/OdbDesignTests/CMakeLists.txt index 3dd6ab06..67b62429 100644 --- a/OdbDesignTests/CMakeLists.txt +++ b/OdbDesignTests/CMakeLists.txt @@ -7,9 +7,9 @@ add_executable(OdbDesignTests "Fixtures/FileArchiveLoadFixture.h" "Fixtures/FileArchiveLoadFixture.cpp" "TestTests.cpp" - "DesignLoadTests.cpp" - "Fixtures/DesignNameValueParamTest.h" - "FileArchiveLoadTests.cpp" + "DesignCacheLoadTests.cpp" + "Fixtures/DesignNameValueParamTest.h" + "FileArchiveTests.cpp" ) target_link_libraries(OdbDesignTests PRIVATE GTest::gtest_main) @@ -18,4 +18,8 @@ target_link_libraries(OdbDesignTests PRIVATE GTest::gtest_main) target_link_libraries(OdbDesignTests PRIVATE OdbDesign) include(GoogleTest) -gtest_discover_tests(OdbDesignTests) \ No newline at end of file +gtest_discover_tests(OdbDesignTests) + +## PCH +file (GLOB_RECURSE OdbDesignTests_HEADER_FILES "*.h") +target_precompile_headers(OdbDesignTests PRIVATE ${OdbDesignTests_HEADER_FILES}) \ No newline at end of file diff --git a/OdbDesignTests/DesignCacheLoadTests.cpp b/OdbDesignTests/DesignCacheLoadTests.cpp new file mode 100644 index 00000000..23e75251 --- /dev/null +++ b/OdbDesignTests/DesignCacheLoadTests.cpp @@ -0,0 +1,25 @@ +#include +#include "Fixtures/FileArchiveLoadFixture.h" +#include "OdbDesign.h" + +//using namespace Odb::Lib::App; +using namespace Odb::Lib::FileModel; +using namespace Odb::Test::Fixtures; +using namespace std::filesystem; + +namespace Odb::Test +{ + TEST_F(FileArchiveLoadFixture, Load_Design_Succeeds_sample_design_tgz) + { + //ASSERT_TRUE(exists(getDesignPath("sample_design.tgz"))); + auto pDesign = m_pDesignCache->GetDesign("sample_design"); + ASSERT_NE(pDesign, nullptr); + } + + TEST_F(FileArchiveLoadFixture, Load_Design_Succeeds_designodb_rigidflex_tgz) + { + //ASSERT_TRUE(exists(getDesignPath("designodb_rigidflex.tgz"))); + auto pDesign = m_pDesignCache->GetDesign("designodb_rigidflex"); + ASSERT_NE(pDesign, nullptr); + } +} \ No newline at end of file diff --git a/OdbDesignTests/FileArchiveTests.cpp b/OdbDesignTests/FileArchiveTests.cpp new file mode 100644 index 00000000..b0cb7fc5 --- /dev/null +++ b/OdbDesignTests/FileArchiveTests.cpp @@ -0,0 +1,156 @@ +#include +#include "Fixtures/FileArchiveLoadFixture.h" +#include "OdbDesign.h" + +//using namespace Odb::Lib::App; +using namespace Odb::Lib::FileModel; +using namespace Odb::Test::Fixtures; + +namespace Odb::Test +{ + TEST_F(FileArchiveLoadFixture, Test_DesignOdb_RigidFlexDesign_CanHasCorrectData) + { + auto rigidFlexDesignPath = getDesignPath("designodb_rigidflex.tgz"); + + Odb::Lib::FileModel::Design::FileArchive rigidFlexOdbDesign(rigidFlexDesignPath.string()); + auto success = rigidFlexOdbDesign.ParseFileModel(); + ASSERT_TRUE(success); + + const auto& findStep = rigidFlexOdbDesign.GetStepsByName().find("cellular_flip-phone"); + ASSERT_NE(findStep, rigidFlexOdbDesign.GetStepsByName().end()); + + // step + auto& pStep = findStep->second; + auto name = pStep->GetName(); + ASSERT_STREQ(name.c_str(), "cellular_flip-phone"); + + // eda data + auto& edaData = pStep->GetEdaDataFile(); + auto& netRecords = edaData.GetNetRecords(); + ASSERT_GT(netRecords.size(), 20); + + auto& pNetRecord = netRecords[20]; + ASSERT_GT(pNetRecord->m_subnetRecords.size(), 44); + auto& pSubnetRecord = pNetRecord->m_subnetRecords[44]; + + auto subnetType = pSubnetRecord->type; + ASSERT_EQ(subnetType, Odb::Lib::FileModel::Design::EdaDataFile::NetRecord::SubnetRecord::Type::Toeprint); + //auto pToeprintSubnetRecord = pSubnetRecord; + //auto viaType = pToeprintSubnetRecord->type; + //if (viaType == Odb::Lib::FileModel::Design::EdaDataFile::NetRecord::ToeprintSubnetRecord::Type::Via) + //{ + //} + + auto& packageRecords = edaData.GetPackageRecords(); + ASSERT_GT(packageRecords.size(), 0); + auto& pPackageRecord = packageRecords[0]; + const auto& packageName = pPackageRecord->name; + ASSERT_STREQ(packageName.c_str(), "BYX101471_B1"); + + // layers + auto& layersByName = pStep->GetLayersByName(); + ASSERT_GT(layersByName.size(), 0); + + auto layerFind = layersByName.find(Odb::Lib::FileModel::Design::ComponentsFile::TOP_COMPONENTS_LAYER_NAME); + ASSERT_NE(layerFind, layersByName.end()); + auto& pLayer = layerFind->second; + ASSERT_NE(pLayer, nullptr); + auto layerName = pLayer->GetName(); + ASSERT_STREQ(layerName.c_str(), "comp_+_top"); + + // netlist + const auto& netlistsByName = pStep->GetNetlistsByName(); + ASSERT_GT(netlistsByName.size(), 0); + + auto netlistFind = netlistsByName.find("cadnet"); + ASSERT_NE(netlistFind, netlistsByName.end()); + auto& pNetlist = netlistFind->second; + ASSERT_NE(pNetlist, nullptr); + + auto netlistName = pNetlist->GetName(); + ASSERT_STREQ(netlistName.c_str(), "cadnet"); + + auto& netListNetRecords = pNetlist->GetNetRecords(); + ASSERT_GT(netListNetRecords.size(), 0); + //for (auto& netRecord : netListNetRecords) + //{ + // if (netRecord->netName == "") + // { + + // } + //} + } + + TEST_F(FileArchiveLoadFixture, Test_SampleDesign_CanHasCorrectData) + { + auto rigidFlexDesignPath = getDesignPath("sample_design.tgz"); + + Odb::Lib::FileModel::Design::FileArchive rigidFlexOdbDesign(rigidFlexDesignPath.string()); + auto success = rigidFlexOdbDesign.ParseFileModel(); + ASSERT_TRUE(success); + + const auto& findStep = rigidFlexOdbDesign.GetStepsByName().find("step"); + ASSERT_NE(findStep, rigidFlexOdbDesign.GetStepsByName().end()); + + // step + auto& pStep = findStep->second; + auto name = pStep->GetName(); + ASSERT_STREQ(name.c_str(), "step"); + + // eda data + auto& edaData = pStep->GetEdaDataFile(); + auto& netRecords = edaData.GetNetRecords(); + ASSERT_GT(netRecords.size(), 20); + + auto& pNetRecord = netRecords[20]; + ASSERT_GT(pNetRecord->m_subnetRecords.size(), 44); + auto& pSubnetRecord = pNetRecord->m_subnetRecords[44]; + + auto subnetType = pSubnetRecord->type; + ASSERT_EQ(subnetType, Odb::Lib::FileModel::Design::EdaDataFile::NetRecord::SubnetRecord::Type::Trace); + //auto pToeprintSubnetRecord = pSubnetRecord; + //auto viaType = pToeprintSubnetRecord->type; + //if (viaType == Odb::Lib::FileModel::Design::EdaDataFile::NetRecord::ToeprintSubnetRecord::Type::Via) + //{ + //} + + auto& packageRecords = edaData.GetPackageRecords(); + ASSERT_GT(packageRecords.size(), 0); + auto& pPackageRecord = packageRecords[0]; + const auto& packageName = pPackageRecord->name; + ASSERT_STREQ(packageName.c_str(), "MH_188NP"); + + // layers + auto& layersByName = pStep->GetLayersByName(); + ASSERT_GT(layersByName.size(), 0); + + auto layerFind = layersByName.find(Odb::Lib::FileModel::Design::ComponentsFile::TOP_COMPONENTS_LAYER_NAME); + ASSERT_NE(layerFind, layersByName.end()); + auto& pLayer = layerFind->second; + ASSERT_NE(pLayer, nullptr); + auto layerName = pLayer->GetName(); + ASSERT_STREQ(layerName.c_str(), "comp_+_top"); + + // netlist + const auto& netlistsByName = pStep->GetNetlistsByName(); + ASSERT_GT(netlistsByName.size(), 0); + + auto netlistFind = netlistsByName.find("cadnet"); + ASSERT_NE(netlistFind, netlistsByName.end()); + auto& pNetlist = netlistFind->second; + ASSERT_NE(pNetlist, nullptr); + + auto netlistName = pNetlist->GetName(); + ASSERT_STREQ(netlistName.c_str(), "cadnet"); + + auto& netListNetRecords = pNetlist->GetNetRecords(); + ASSERT_GT(netListNetRecords.size(), 0); + //for (auto& netRecord : netListNetRecords) + //{ + // if (netRecord->netName == "") + // { + + // } + //} + } +} \ No newline at end of file diff --git a/OdbDesignTests/Fixtures/FileArchiveLoadFixture.cpp b/OdbDesignTests/Fixtures/FileArchiveLoadFixture.cpp index db2de856..5908adff 100644 --- a/OdbDesignTests/Fixtures/FileArchiveLoadFixture.cpp +++ b/OdbDesignTests/Fixtures/FileArchiveLoadFixture.cpp @@ -1,24 +1,28 @@ #include "FileArchiveLoadFixture.h" #include +#include "Logger.h" using namespace std::filesystem; //using namespace Odb::Lib; using namespace Odb::Lib::App; +using namespace Utils; namespace Odb::Test::Fixtures { FileArchiveLoadFixture::FileArchiveLoadFixture() : m_testDataDir() , m_pDesignCache(nullptr) - { } void FileArchiveLoadFixture::SetUp() - { - ASSERT_FALSE(getTestDataDir().empty()); - - m_testDataDir = getTestDataDir(); + { + //Logger::instance()->start(); + + ASSERT_FALSE(getTestDataDir().empty()); + m_testDataDir = getTestDataDir(); + m_testDataDir = m_testDataDir.make_preferred(); + ASSERT_TRUE(exists(m_testDataDir)); m_pDesignCache = std::unique_ptr(new DesignCache(m_testDataDir.string())); @@ -27,7 +31,8 @@ namespace Odb::Test::Fixtures std::string FileArchiveLoadFixture::getTestDataDir() { - auto szTestDataDir = std::getenv("ODB_TEST_DATA_DIR"); + auto szTestDataDir = std::getenv(ODB_TEST_DATA_DIR_ENV_NAME); + if (szTestDataDir == nullptr) szTestDataDir = ""; //if (szTestDataDir == nullptr) throw std::runtime_error("ODB_TEST_DATA_DIR environment variable is not set"); //if (!exists(szTestDataDir)) throw std::runtime_error("ODB_TEST_DATA_DIR environment variable is set to a non-existent directory"); return szTestDataDir; @@ -49,6 +54,8 @@ namespace Odb::Test::Fixtures } } } + + //Logger::instance()->stop(); } path FileArchiveLoadFixture::getDesignPath(const std::string& filename) const diff --git a/OdbDesignTests/Fixtures/FileArchiveLoadFixture.h b/OdbDesignTests/Fixtures/FileArchiveLoadFixture.h index 17ec34c9..7ae12555 100644 --- a/OdbDesignTests/Fixtures/FileArchiveLoadFixture.h +++ b/OdbDesignTests/Fixtures/FileArchiveLoadFixture.h @@ -25,5 +25,7 @@ namespace Odb::Test::Fixtures std::string getTestDataDir(); std::filesystem::path getDesignPath(const std::string& filename) const; + constexpr const static inline char ODB_TEST_DATA_DIR_ENV_NAME[] = "ODB_TEST_DATA_DIR"; + }; } diff --git a/OdbDesignTests/ParseFileModelTests.cpp b/OdbDesignTests/ParseFileModelTests.cpp deleted file mode 100644 index f334f68b..00000000 --- a/OdbDesignTests/ParseFileModelTests.cpp +++ /dev/null @@ -1,96 +0,0 @@ -#include -#include "Fixtures/FileArchiveLoadFixture.h" -#include "OdbDesign.h" -#include - -//using namespace Odb::Lib::App; -using namespace Odb::Lib::FileModel; -using namespace Odb::Test::Fixtures; - - -bool TestRigidFlexDesign() -{ - std::string rigidFlexDesignPath; - if (Odb::Lib::IsMsvc()) - { - rigidFlexDesignPath = R"(C:\Users\nmill\OneDrive\Documents\ODB++\Samples\designodb_rigidflex.tgz)"; - } - else - { - rigidFlexDesignPath = R"(/mnt/c/Users/nmill/OneDrive/Documents/ODB++/Samples/designodb_rigidflex.tgz)"; - } - - std::cout << "Processing " << rigidFlexDesignPath << "... " << std::endl; - - Odb::Lib::FileModel::Design::FileArchive rigidFlexOdbDesign(rigidFlexDesignPath); - auto success = rigidFlexOdbDesign.ParseFileModel(); - if (!success) - { - return false; - } - - const auto& findStep = rigidFlexOdbDesign.GetStepsByName().find("cellular_flip-phone"); - if (findStep != rigidFlexOdbDesign.GetStepsByName().end()) - { - // step - auto& pStep = findStep->second; - auto name = pStep->GetName(); - - // eda data - auto& edaData = pStep->GetEdaDataFile(); - auto& netRecords = edaData.GetNetRecords(); - if (netRecords.size() > 20) - { - auto& pNetRecord = netRecords[20]; - if (pNetRecord->m_subnetRecords.size() > 44) - { - auto& pSubnetRecord = pNetRecord->m_subnetRecords[44]; - auto subnetType = pSubnetRecord->type; - if (subnetType == Odb::Lib::FileModel::Design::EdaDataFile::NetRecord::SubnetRecord::Type::Toeprint) - { - //auto pToeprintSubnetRecord = pSubnetRecord; - //auto viaType = pToeprintSubnetRecord->type; - //if (viaType == Odb::Lib::FileModel::Design::EdaDataFile::NetRecord::ToeprintSubnetRecord::Type::Via) - //{ - - //} - } - } - } - - auto& packageRecords = edaData.GetPackageRecords(); - if (packageRecords.size() > 0) - { - auto& pPackageRecord = packageRecords[0]; - auto packageName = pPackageRecord->name; - } - - // layers - auto& layersByName = pStep->GetLayersByName(); - auto layerFind = layersByName.find(Odb::Lib::FileModel::Design::ComponentsFile::TOP_COMPONENTS_LAYER_NAME); - if (layerFind != layersByName.end()) - { - auto& pLayer = layerFind->second; - auto layerName = pLayer->GetName(); - } - - // netlist - const auto& netlistsByName = pStep->GetNetlistsByName(); - auto netlistFind = netlistsByName.find("cadnet"); - if (netlistFind != netlistsByName.end()) - { - auto& pNetlist = netlistFind->second; - auto netlistName = pNetlist->GetName(); - auto& netListNetRecords = pNetlist->GetNetRecords(); - for (auto& netRecord : netListNetRecords) - { - if (netRecord->netName == "") - { - - } - } - } - } - - return true; -} \ No newline at end of file diff --git a/Utils/ExitCode.h b/Utils/ExitCode.h index 780f133a..f8efeae1 100644 --- a/Utils/ExitCode.h +++ b/Utils/ExitCode.h @@ -10,6 +10,8 @@ namespace Utils FailedInitSsl = 2, FailedInitSslDirDoesNotExist = 3, FailedInitLoadDesign = 4, - UnknownError + PreServerRunFailed = 5, + PostServerRunFailed = 6, + UnknownError = 7 }; } diff --git a/Utils/Logger.cpp b/Utils/Logger.cpp index 7fa77dd7..a22a6c41 100644 --- a/Utils/Logger.cpp +++ b/Utils/Logger.cpp @@ -13,8 +13,10 @@ namespace Utils : m_level(Level::Info) , m_logFilename(DEFAULT_LOG_FILENAME) , m_outputTypes(OutputTypes::StdOut | OutputTypes::File) + //, m_enableInternalLogging(false) //, m_logFileStream(m_logFilename, std::ios::out | std::ios::app) - , m_logMessageLoop([&](Message& message) + , m_logMessageLoop( + [&](Message& message) { return this->logMessage(message); }) @@ -168,30 +170,45 @@ namespace Utils bool Logger::logMessage(const Message& logMessage) { + std::cout << "[Logger::logMessage] enter, formatting message" << std::endl; + auto message = formatLogMessage(logMessage); + std::cout << "[Logger::logMessage] message formatted, writing to cout and cerr" << std::endl; + if (logMessage.level >= m_level) { if (m_outputTypes & OutputTypes::StdOut) std::cout << message << std::flush; if (m_outputTypes & OutputTypes::StdErr) std::cerr << message << std::flush; } + //else if (logMessage.level == Level::Error || // logMessage.level == Level::Warn) //{ // if (m_outputTypes & OutputTypes::StdErr) std::cerr << message << std::flush; //} + std::cout << "[Logger::logMessage] wrote to cout and cerr, writing to file..." << std::endl; + if (m_outputTypes & OutputTypes::File) { + std::cout << "[Logger::logMessage] opening log file stream (" << m_logFilename << ")..." << std::endl; + m_logFileStream.open(m_logFilename, std::ios::out | std::ios::app); if (m_logFileStream) { + std::cout << "[Logger::logMessage] file stream opened, writing to file..." << std::endl; + m_logFileStream << message << std::flush; //m_logFileStream.flush(); m_logFileStream.close(); + + std::cout << "[Logger::logMessage] wrote to file and closed stream" << std::endl; } } + std::cout << "[Logger::logMessage] exit" << std::endl; + return true; } diff --git a/Utils/Logger.h b/Utils/Logger.h index 8866b33a..a220a6bc 100644 --- a/Utils/Logger.h +++ b/Utils/Logger.h @@ -105,6 +105,8 @@ namespace Utils WorkQueueLoopThread m_logMessageLoop; + //bool m_enableInternalLogging = false; + //bool processWorkItem(struct LogMessage& logMessage) override; bool logMessage(const struct Message& logMessage); diff --git a/Utils/ThreadSafeQueue.h b/Utils/ThreadSafeQueue.h index eb266883..661c9245 100644 --- a/Utils/ThreadSafeQueue.h +++ b/Utils/ThreadSafeQueue.h @@ -164,12 +164,12 @@ namespace Utils template typename ThreadSafeQueue::wait_result ThreadSafeQueue::wait() { - logInternal("ThreadSafeQueue::wait() enter, taking lock..."); + logInternal("[ThreadSafeQueue::wait] enter, taking lock..."); // wait until _queue is not empty _OR_ interrupt has been set std::unique_lock lock(_m); - logInternal("ThreadSafeQueue::wait() lock taken, begin waiting..."); + logInternal("[ThreadSafeQueue::wait] lock taken, begin waiting..."); _cv.wait(lock, [&] @@ -178,7 +178,7 @@ namespace Utils }); std::stringstream ss; - ss << "ThreadSafeQueue::wait() wait returned, exiting (_queue.size() => " << _queue.size() << ", _interrupted = " << _interrupted.load() << ')'; + ss << "[ThreadSafeQueue::wait] wait returned, exiting (_queue.size() => " << _queue.size() << ", _interrupted = " << _interrupted.load() << ')'; logInternal(ss.str()); // return whether _interrupted was tripped @@ -195,12 +195,12 @@ namespace Utils template typename ThreadSafeQueue::wait_result ThreadSafeQueue::wait(std::chrono::milliseconds wait_ms) { - logInternal("ThreadSafeQueue::wait() enter, taking lock..."); + logInternal("[ThreadSafeQueue::wait] enter, taking lock..."); // wait until _queue is not empty _OR_ interrupt has been set std::unique_lock lock(_m); - logInternal("ThreadSafeQueue::wait() lock taken, begin waiting..."); + logInternal("[ThreadSafeQueue::wait] lock taken, begin waiting..."); auto expired = !_cv.wait_for(lock, wait_ms, // NOLINT(clion-misra-cpp2008-5-3-1) [&] @@ -209,7 +209,7 @@ namespace Utils }); std::stringstream ss; - ss << "ThreadSafeQueue::wait() wait returned, exiting (_queue.size() => " << _queue.size() << ", _interrupted = " << _interrupted.load() << ')'; + ss << "[ThreadSafeQueue::wait] wait returned, exiting (_queue.size() => " << _queue.size() << ", _interrupted = " << _interrupted.load() << ')'; logInternal(ss.str()); wait_result wait_result; diff --git a/Utils/WorkQueueLoopThread.h b/Utils/WorkQueueLoopThread.h index 067ca363..f27db03f 100644 --- a/Utils/WorkQueueLoopThread.h +++ b/Utils/WorkQueueLoopThread.h @@ -19,7 +19,7 @@ namespace Utils typedef std::function processWorkItemFunc; WorkQueueLoopThread(); - explicit WorkQueueLoopThread(processWorkItemFunc processWorkItemProc); + explicit WorkQueueLoopThread(processWorkItemFunc processWorkItemProc/*, bool enableInternalLogging*/); void addWorkItem(TWorkItem&& workItem); //void addWorkItem(TWorkItem& workItem); @@ -37,7 +37,7 @@ namespace Utils processWorkItemFunc _processWorkItemProc; const bool _StopProcessingOnWorkItemFail{ true }; - const bool _EnableInternalLogging{ false }; + bool _enableInternalLogging{ false }; }; @@ -56,11 +56,12 @@ namespace Utils } template - WorkQueueLoopThread::WorkQueueLoopThread(WorkQueueLoopThread::processWorkItemFunc processWorkItemProc) + WorkQueueLoopThread::WorkQueueLoopThread(WorkQueueLoopThread::processWorkItemFunc processWorkItemProc/*, bool enableInternalLogging*/) : _stopProcessingWorkItemsFlag(false) , _processWorkItemProc(processWorkItemProc) + //, _enableInternalLogging(enableInternalLogging) { - if (_EnableInternalLogging) + if (_enableInternalLogging) { _workItemQueue.registerInternalLogHandler([&](const std::string& m) { diff --git a/Utils/libarchive_extract.cpp b/Utils/libarchive_extract.cpp index df2f43b0..2985709c 100644 --- a/Utils/libarchive_extract.cpp +++ b/Utils/libarchive_extract.cpp @@ -3,15 +3,20 @@ #include #include #include +#include "Logger.h" // from: https://github.com/libarchive/libarchive/wiki/Examples#user-content-A_Complete_Extractor +using namespace std::filesystem; + namespace Utils { int copy_data(struct archive* ar, struct archive* aw); const bool SECURE_EXTRACTION = true; + const size_t BYTES_PER_KB = 1024UL; + const size_t READ_OPEN_BLOCK_SIZE = BYTES_PER_KB * 10UL; bool extract(const char* filename, const char* destDir) { @@ -31,10 +36,8 @@ namespace Utils { flags |= ARCHIVE_EXTRACT_SECURE_SYMLINKS; flags |= ARCHIVE_EXTRACT_SECURE_NODOTDOT; - flags |= ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; - } - - const size_t READ_OPEN_BLOCK_SIZE = 1024 * 10; + //flags |= ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; + } a = archive_read_new(); archive_read_support_format_all(a); @@ -64,14 +67,21 @@ namespace Utils } // prepend destPath to beginning of entry to extract it in the destination path - auto entryPathname = archive_entry_pathname(entry); + std::string entryPathname = archive_entry_pathname(entry); std::filesystem::path entryDestinationPathname(destDir); - entryDestinationPathname /= entryPathname; + entryDestinationPathname /= entryPathname; + //auto relativeEntryDestinationPathname = relative(entryDestinationPathname, current_path()); + + logdebug("Extracting, destination dir: [" + std::string(destDir) + "]"); + logdebug("Extracting, entry path name: [" + entryPathname + "]"); + logdebug("Extracting, destination path name: [" + entryDestinationPathname.string() + "]"); + //loginfo("Extracting, relative destination path name: [" + relativeEntryDestinationPathname.string() + "]"); + archive_entry_set_pathname(entry, entryDestinationPathname.string().c_str()); r = archive_write_header(ext, entry); if (r < ARCHIVE_OK) - fprintf(stderr, "%s\n", archive_error_string(ext)); + fprintf(stderr, "archive_write_header failed: %s\n", archive_error_string(ext)); else if (archive_entry_size(entry) > 0) { r = copy_data(a, ext); if (r < ARCHIVE_OK) diff --git a/deploy/kube/OdbDesignServer-SwaggerUI/deployment.yaml b/deploy/kube/OdbDesignServer-SwaggerUI/deployment.yaml new file mode 100644 index 00000000..e2b70a41 --- /dev/null +++ b/deploy/kube/OdbDesignServer-SwaggerUI/deployment.yaml @@ -0,0 +1,37 @@ +################################################################################################## +# odbdesign-server-swaggerui deployment +################################################################################################## +apiVersion: apps/v1 +kind: Deployment +metadata: + name: odbdesign-server-swaggerui-v1 + labels: + app: odbdesign-server-swaggerui + version: v1 +spec: + replicas: 1 + selector: + matchLabels: + app: odbdesign-server-swaggerui + version: v1 + template: + metadata: + labels: + app: odbdesign-server-swaggerui + version: v1 + spec: + containers: + - name: odbdesign-server-swaggerui + image: ghcr.io/nam20485/odbdesignserver-swaggerui:nam20485-latest + imagePullPolicy: Always + ports: + - containerPort: 8080 + name: oss-dep-port + resources: + limits: + cpu: "1" + memory: 1Gi + requests: + cpu: 500m + memory: 500Mi + diff --git a/deploy/kube/OdbDesignServer-SwaggerUI/service.yaml b/deploy/kube/OdbDesignServer-SwaggerUI/service.yaml new file mode 100644 index 00000000..5f9649e0 --- /dev/null +++ b/deploy/kube/OdbDesignServer-SwaggerUI/service.yaml @@ -0,0 +1,18 @@ +################################################################################################## +# odbdesign-server-swaggerui service +################################################################################################## +apiVersion: v1 +kind: Service +metadata: + name: odbdesign-server-swaggerui-service + labels: + app: odbdesign-server-swaggerui + service: odbdesign-server-swaggerui +spec: + ports: + - port: 80 + name: oss-svc-port + targetPort: oss-dep-port + selector: + app: odbdesign-server-swaggerui + diff --git a/deploy/kube/OdbDesignServer/deployment.yaml b/deploy/kube/OdbDesignServer/deployment.yaml index d20ce89b..e6cb55cf 100644 --- a/deploy/kube/OdbDesignServer/deployment.yaml +++ b/deploy/kube/OdbDesignServer/deployment.yaml @@ -27,13 +27,24 @@ spec: ports: - containerPort: 8888 name: ods-dep-port + env: + - name: ODBDESIGN_SERVER_REQUEST_USERNAME + valueFrom: + secretKeyRef: + name: odbdesign-server-request-secret + key: ODBDESIGN_SERVER_REQUEST_USERNAME + - name: ODBDESIGN_SERVER_REQUEST_PASSWORD + valueFrom: + secretKeyRef: + name: odbdesign-server-request-secret + key: ODBDESIGN_SERVER_REQUEST_PASSWORD resources: limits: - cpu: "2" - memory: 2Gi - requests: cpu: "1" memory: 1Gi + requests: + cpu: 500m + memory: 500Mi livenessProbe: httpGet: path: /healthz/live diff --git a/deploy/kube/OdbDesignServer/service.yaml b/deploy/kube/OdbDesignServer/service.yaml index d245786d..4a08e646 100644 --- a/deploy/kube/OdbDesignServer/service.yaml +++ b/deploy/kube/OdbDesignServer/service.yaml @@ -17,6 +17,7 @@ spec: # nodePort: 30888 # name: ods-svc-port ## ClusterIP/regular ingress-style access + # type: ClusterIP ports: - port: 80 name: ods-svc-port diff --git a/deploy/kube/default-ingress.yaml b/deploy/kube/default-ingress.yaml new file mode 100644 index 00000000..5acdbc0d --- /dev/null +++ b/deploy/kube/default-ingress.yaml @@ -0,0 +1,29 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: default-ingress + namespace: default + annotations: + alb.ingress.kubernetes.io/load-balancer-name: default-ingress + alb.ingress.kubernetes.io/target-type: ip + alb.ingress.kubernetes.io/scheme: internet-facing + alb.ingress.kubernetes.io/healthcheck-path: /healthz/live +spec: + ingressClassName: alb + rules: + - http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: odbdesign-server-service + port: + name: ods-svc-port + - path: /swagger + pathType: Prefix + backend: + service: + name: odbdesign-server-swaggerui-service + port: + name: oss-svc-port \ No newline at end of file diff --git a/deploy/kube/prometheus/ingress.yaml b/deploy/kube/prometheus/ingress.yaml deleted file mode 100644 index ec7d94db..00000000 --- a/deploy/kube/prometheus/ingress.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: prometheus-ingress - namespace: lens-metrics -spec: - rules: - - host: prometheus.precision5820 - http: - paths: - - pathType: Prefix - path: "/" - backend: - service: - name: prometheus - port: - number: 80 - \ No newline at end of file diff --git a/docs/BUILD.md b/docs/BUILD.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/README.md b/docs/README.md index 95efb644..edaf2d72 100644 --- a/docs/README.md +++ b/docs/README.md @@ -53,7 +53,7 @@ The diagram describes the current state of parser implementation and data availa [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/nam20485/OdbDesign/badge)](https://securityscorecards.dev/viewer/?uri=github.com/nam20485/OdbDesign) ->The majority of tested projects have a muc lower score, so OdbDesign's 7.8 score represents a remarkably high level of security. +>The majority of tested projects have a much lower score, so OdbDesign's 7.8 score represents a remarkably high level of security. ### CI/CD Build diff --git a/scripts/deploy.ps1 b/scripts/deploy.ps1 index 9ec1af25..a7b6ed3b 100644 --- a/scripts/deploy.ps1 +++ b/scripts/deploy.ps1 @@ -7,38 +7,36 @@ param( [string]$DeploymentName ) -#$clusterName = "k3d-k3dcluster" -#$deploymentName = "odbdesign-server-v1" -#$serviceName = "odbdesign-server-service" -#$ingressName = "odbdesign-server-ingress" -#$image = "ghcr.io/nam20485/odbdesign:nam20485-latest" - # set kubeconfig - kubectl config use-context $ClusterName if ($LASTEXITCODE -ne 0) { Exit 1 } -#kubectl get deployment $deploymentName -#if ($LASTEXITCODE -ne 0) { - kubectl apply -f deploy/kube/OdbDesignServer/deployment.yaml -#} +# +# odbdesign-server-v1 +# + +# apply manifests +kubectl apply -f deploy/kube/OdbDesignServer/deployment.yaml +kubectl apply -f deploy/kube/OdbDesignServer/service.yaml + +# restart deployment +kubectl rollout restart deployment/$DeploymentName +kubectl rollout status deployment/$DeploymentName -#kubectl get svc $serviceName -#if ($LASTEXITCODE -ne 0) { - kubectl apply -f deploy/kube/OdbDesignServer/service.yaml -#} -#kubectl get ingress$ingressName -#if ($LASTEXITCODE -ne 0) { - kubectl apply -f deploy/kube/OdbDesignServer/ingress.yaml -#} +# +# Swagger UI +# -# kubectl set image deployment/$deploymentName odbdesign-server=$image +# apply manifests +kubectl apply -f deploy/kube/OdbDesignServer-SwaggerUI/deployment.yaml +kubectl apply -f deploy/kube/OdbDesignServer-SwaggerUI/service.yaml -# initiate rolling update -kubectl rollout restart deployment/$DeploymentName +# restart deployment +kubectl rollout restart deployment/odbdesign-server-swaggerui-v1 +kubectl rollout status deployment/odbdesign-server-swaggerui-v1 -# wait for kubectl deployment to finish -kubectl rollout status deployment/$DeploymentName +# apply ingress manifest +kubectl apply -f deploy/kube/default-ingress.yaml diff --git a/swagger/odbdesign-server-0.9-swagger.yaml b/swagger/odbdesign-server-0.9-swagger.yaml new file mode 100644 index 00000000..3e8a1db4 --- /dev/null +++ b/swagger/odbdesign-server-0.9-swagger.yaml @@ -0,0 +1,499 @@ +openapi: 3.0.1 +info: + title: OdbDesign Server API + description: OdbDesign Server REST API + version: "0.9" + contact: + name: Nathan Miller + email: nmiller217@gmail.com + license: + name: MIT +servers: + - url: http://default-ingress-1165108808.us-west-2.elb.amazonaws.com + - url: http://localhost:8888 +tags: + - name: "file upload" + - name: "filemodel" + #- name: "hello world" + #- name: "health check" + - name: "steps" + - name: "layers" + - name: "symbols" +paths: + /files/list: + get: + tags: ["file upload"] + parameters: [] + responses: + "200": + description: "" + security: + - BasicAuth: [] + /files/upload/{name}: + post: + tags: ["file upload"] + parameters: + - name: name + in: path + required: true + schema: + type: string + requestBody: + content: + application/octet-stream: + schema: + type: string + format: binary + responses: + "200": + description: "" + security: + - BasicAuth: [] + /files/upload: + post: + tags: ["file upload"] + parameters: [] + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: array + items: + type: string + format: binary + responses: + "200": + description: "" + security: + - BasicAuth: [] + /filemodels: + get: + tags: ["filemodel"] + responses: + "200": + description: "" + security: + - BasicAuth: [] + /filemodels/{name}: + get: + tags: ["filemodel"] + parameters: + - name: name + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /filemodels/{name}/misc/attrlist: + get: + tags: ["filemodel"] + parameters: + - name: name + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /filemodels/{name}/misc/info: + get: + tags: ["filemodel"] + parameters: + - name: name + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /filemodels/{name}/matrix/matrix: + get: + tags: ["filemodel"] + parameters: + - name: name + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /filemodels/{name}/fonts/standard: + get: + tags: ["filemodel"] + parameters: + - name: name + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /filemodels/{name}/steps: + get: + tags: ["steps"] + parameters: + - name: name + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /filemodels/{name}/steps/{step}: + get: + tags: ["steps"] + parameters: + - name: name + in: path + required: true + schema: + type: string + - name: step + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /filemodels/{name}/steps/{step}/eda_data: + get: + tags: ["steps"] + parameters: + - name: name + in: path + required: true + schema: + type: string + - name: step + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /filemodels/{name}/steps/{step}/attrlist: + get: + tags: ["steps"] + parameters: + - name: name + in: path + required: true + schema: + type: string + - name: step + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /filemodels/{name}/steps/{step}/profile: + get: + tags: ["steps"] + parameters: + - name: name + in: path + required: true + schema: + type: string + - name: step + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /filemodels/{name}/steps/{step}/stephdr: + get: + tags: ["steps"] + parameters: + - name: name + in: path + required: true + schema: + type: string + - name: step + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /filemodels/{name}/steps/{step}/netlists: + get: + tags: ["steps"] + parameters: + - name: name + in: path + required: true + schema: + type: string + - name: step + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /filemodels/{name}/steps/{step}/netlists/{netlist}: + get: + tags: ["steps"] + parameters: + - name: name + in: path + required: true + schema: + type: string + - name: step + in: path + required: true + schema: + type: string + - name: netlist + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /filemodels/{name}/steps/{step}/layers: + get: + tags: ["layers"] + parameters: + - name: name + in: path + required: true + schema: + type: string + - name: step + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /filemodels/{name}/steps/{step}/layers/{layer}: + get: + tags: ["layers"] + parameters: + - name: name + in: path + required: true + schema: + type: string + - name: step + in: path + required: true + schema: + type: string + - name: layer + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /filemodels/{name}/steps/{step}/layers/{layer}/components: + get: + tags: ["layers"] + parameters: + - name: name + in: path + required: true + schema: + type: string + - name: step + in: path + required: true + schema: + type: string + - name: layer + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /filemodels/{name}/steps/{step}/layers/{layer}/features: + get: + tags: ["layers"] + parameters: + - name: name + in: path + required: true + schema: + type: string + - name: step + in: path + required: true + schema: + type: string + - name: layer + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /filemodels/{name}/steps/{step}/layers/{layer}/attrlist: + get: + tags: ["layers"] + parameters: + - name: name + in: path + required: true + schema: + type: string + - name: step + in: path + required: true + schema: + type: string + - name: layer + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /filemodels/{name}/symbols: + get: + tags: ["symbols"] + parameters: + - name: name + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /filemodels/{name}/symbols/{symbol}: + get: + tags: ["symbols"] + parameters: + - name: name + in: path + required: true + schema: + type: string + - name: symbol + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /filemodels/{name}/symbols/{symbol}/features: + get: + tags: ["symbols"] + parameters: + - name: name + in: path + required: true + schema: + type: string + - name: symbol + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /filemodels/{name}/symbols/{symbol}/attrlist: + get: + tags: ["symbols"] + parameters: + - name: name + in: path + required: true + schema: + type: string + - name: symbol + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] +components: + securitySchemes: + BasicAuth: + type: http + scheme: basic + schemas: + odbdesign-server-schema: + type: object + properties: + id: + type: integer + format: int64