From faa154ffd66a14732f661be8a8c7881ac8f05d66 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sat, 27 Jan 2024 11:59:02 -0800 Subject: [PATCH 01/42] implement IProtobuffable serializarion for product model (design) classes --- OdbDesignLib/ProductModel/Component.cpp | 24 ++++ OdbDesignLib/ProductModel/Component.h | 8 +- OdbDesignLib/ProductModel/Design.cpp | 118 ++++++++++++++++++++ OdbDesignLib/ProductModel/Design.h | 10 +- OdbDesignLib/ProductModel/Net.cpp | 27 +++++ OdbDesignLib/ProductModel/Net.h | 8 +- OdbDesignLib/ProductModel/Package.cpp | 37 ++++++ OdbDesignLib/ProductModel/Package.h | 8 +- OdbDesignLib/ProductModel/Part.cpp | 15 +++ OdbDesignLib/ProductModel/Part.h | 8 +- OdbDesignLib/ProductModel/Pin.cpp | 17 +++ OdbDesignLib/ProductModel/Pin.h | 10 +- OdbDesignLib/ProductModel/PinConnection.cpp | 18 +++ OdbDesignLib/ProductModel/PinConnection.h | 8 +- OdbDesignLib/ProductModel/Via.cpp | 16 +++ OdbDesignLib/ProductModel/Via.h | 8 +- 16 files changed, 330 insertions(+), 10 deletions(-) diff --git a/OdbDesignLib/ProductModel/Component.cpp b/OdbDesignLib/ProductModel/Component.cpp index d7a32219..e91e654d 100644 --- a/OdbDesignLib/ProductModel/Component.cpp +++ b/OdbDesignLib/ProductModel/Component.cpp @@ -1,5 +1,7 @@ #include "Component.h" #include "Component.h" +#include "Component.h" +#include "Component.h" namespace Odb::Lib::ProductModel @@ -48,4 +50,26 @@ namespace Odb::Lib::ProductModel return m_pPart; } + std::unique_ptr Component::to_protobuf() const + { + auto pComponentMsg = std::unique_ptr(); + pComponentMsg->set_refdes(m_refDes); + pComponentMsg->set_partname(m_partName); + pComponentMsg->set_index(m_index); + pComponentMsg->set_side(static_cast(m_side)); + pComponentMsg->set_allocated_package(m_pPackage->to_protobuf().release()); + pComponentMsg->set_allocated_part(m_pPart->to_protobuf().release()); + return pComponentMsg; + } + + void Component::from_protobuf(const Odb::Lib::Protobuf::ProductModel::Component& message) + { + m_refDes = message.refdes(); + m_partName = message.partname(); + m_index = message.index(); + m_side = static_cast(message.side()); + m_pPackage->from_protobuf(message.package()); + m_pPart->from_protobuf(message.part()); + } + } // namespace Odb::Lib::ProductModel \ No newline at end of file diff --git a/OdbDesignLib/ProductModel/Component.h b/OdbDesignLib/ProductModel/Component.h index 4beba57e..4d6b94ce 100644 --- a/OdbDesignLib/ProductModel/Component.h +++ b/OdbDesignLib/ProductModel/Component.h @@ -9,11 +9,13 @@ #include "Package.h" #include "../enums.h" #include "Part.h" +#include "../ProtoBuf/component.pb.h" +#include "../IProtoBuffable.h" namespace Odb::Lib::ProductModel { - class ODBDESIGN_EXPORT Component + class ODBDESIGN_EXPORT Component : IProtoBuffable { public: Component(std::string refDes, std::string partName, std::shared_ptr pPackage, unsigned int index, BoardSide side, std::shared_ptr pPart); @@ -26,6 +28,10 @@ namespace Odb::Lib::ProductModel BoardSide GetSide() const; std::shared_ptr GetPart() const; + // Inherited via IProtoBuffable + std::unique_ptr to_protobuf() const override; + void from_protobuf(const Odb::Lib::Protobuf::ProductModel::Component& message) override; + typedef std::vector> Vector; typedef std::map> StringMap; diff --git a/OdbDesignLib/ProductModel/Design.cpp b/OdbDesignLib/ProductModel/Design.cpp index 55b8c35a..c5a2f0b3 100644 --- a/OdbDesignLib/ProductModel/Design.cpp +++ b/OdbDesignLib/ProductModel/Design.cpp @@ -1,3 +1,5 @@ +#include "Design.h" +#include "Design.h" #include #include "Design.h" #include "Package.h" @@ -124,6 +126,122 @@ namespace Odb::Lib::ProductModel return m_pFileModel; } + std::unique_ptr Design::to_protobuf() const + { + auto pDesignMsg = std::unique_ptr(); + pDesignMsg->set_name(m_name); + pDesignMsg->set_productmodel(m_productModel); + + pDesignMsg->set_allocated_filemodel(m_pFileModel->to_protobuf().release()); + + for (const auto& pNet : m_nets) + { + pDesignMsg->add_nets()->CopyFrom(*pNet->to_protobuf()); + } + + for (const auto& kvNet : m_netsByName) + { + (*pDesignMsg->mutable_netsbyname())[kvNet.first] = *kvNet.second->to_protobuf(); + } + + for (const auto& pPackage : m_packages) + { + pDesignMsg->add_packages()->CopyFrom(*pPackage->to_protobuf()); + } + + for (const auto& kvPackage : m_packagesByName) + { + (*pDesignMsg->mutable_packagesbyname())[kvPackage.first] = *kvPackage.second->to_protobuf(); + } + + for (const auto& pComponent : m_components) + { + pDesignMsg->add_components()->CopyFrom(*pComponent->to_protobuf()); + } + + for (const auto& kvComponent : m_componentsByName) + { + (*pDesignMsg->mutable_componentsbyname())[kvComponent.first] = *kvComponent.second->to_protobuf(); + } + + for (const auto& pPart : m_parts) + { + pDesignMsg->add_parts()->CopyFrom(*pPart->to_protobuf()); + } + + for (const auto& kvPart : m_partsByName) + { + (*pDesignMsg->mutable_partsbyname())[kvPart.first] = *kvPart.second->to_protobuf(); + } + + return pDesignMsg; + } + + void Design::from_protobuf(const Odb::Lib::Protobuf::ProductModel::Design& message) + { + m_name = message.name(); + m_productModel = message.productmodel(); + + m_pFileModel = std::make_shared(""); + m_pFileModel->from_protobuf(message.filemodel()); + + for (const auto& pNetMsg : message.nets()) + { + auto pNet = std::make_shared("", -1); + pNet->from_protobuf(pNetMsg); + m_nets.push_back(pNet); + } + + for (const auto& kvNetMsg : message.netsbyname()) + { + auto pNet = std::make_shared("", -1); + pNet->from_protobuf(kvNetMsg.second); + m_netsByName[kvNetMsg.first] = pNet; + } + + for (const auto& pPackageMsg : message.packages()) + { + auto pPackage = std::make_shared("", -1); + pPackage->from_protobuf(pPackageMsg); + m_packages.push_back(pPackage); + } + + for (const auto& kvPackageMsg : message.packagesbyname()) + { + auto pPackage = std::make_shared("", -1); + pPackage->from_protobuf(kvPackageMsg.second); + m_packagesByName[kvPackageMsg.first] = pPackage; + } + + for (const auto& pComponentMsg : message.components()) + { + auto pComponent = std::make_shared("", "", nullptr, -1, BoardSide::BsNone, nullptr); + pComponent->from_protobuf(pComponentMsg); + m_components.push_back(pComponent); + } + + for (const auto& kvComponentMsg : message.componentsbyname()) + { + auto pComponent = std::make_shared("", "", nullptr, -1, BoardSide::BsNone, nullptr); + pComponent->from_protobuf(kvComponentMsg.second); + m_componentsByName[kvComponentMsg.first] = pComponent; + } + + for (const auto& pPartMsg : message.parts()) + { + auto pPart = std::make_shared(""); + pPart->from_protobuf(pPartMsg); + m_parts.push_back(pPart); + } + + for (const auto& kvPartMsg : message.partsbyname()) + { + auto pPart = std::make_shared(""); + pPart->from_protobuf(kvPartMsg.second); + m_partsByName[kvPartMsg.first] = pPart; + } + } + bool Design::BuildAllComponents() { if (m_pFileModel == nullptr) return false; diff --git a/OdbDesignLib/ProductModel/Design.h b/OdbDesignLib/ProductModel/Design.h index 7a9b28ad..88cbef93 100644 --- a/OdbDesignLib/ProductModel/Design.h +++ b/OdbDesignLib/ProductModel/Design.h @@ -9,12 +9,14 @@ #include "Via.h" #include "Package.h" #include "Part.h" -#include "../FileModel/Design/StepDirectory.h" +//#include "../FileModel/Design/StepDirectory.h" +#include "../ProtoBuf/design.pb.h" +#include "../IProtoBuffable.h" namespace Odb::Lib::ProductModel { - class ODBDESIGN_EXPORT Design + class ODBDESIGN_EXPORT Design : IProtoBuffable { public: Design(); @@ -43,6 +45,10 @@ namespace Odb::Lib::ProductModel std::shared_ptr GetFileModel() const; + // Inherited via IProtoBuffable + std::unique_ptr to_protobuf() const override; + void from_protobuf(const Odb::Lib::Protobuf::ProductModel::Design& message) override; + typedef std::vector> Vector; typedef std::map> StringMap; diff --git a/OdbDesignLib/ProductModel/Net.cpp b/OdbDesignLib/ProductModel/Net.cpp index 89afda7a..86d5d417 100644 --- a/OdbDesignLib/ProductModel/Net.cpp +++ b/OdbDesignLib/ProductModel/Net.cpp @@ -1,4 +1,6 @@ #include "Net.h" +#include "Net.h" +#include "Net.h" namespace Odb::Lib::ProductModel @@ -34,4 +36,29 @@ namespace Odb::Lib::ProductModel m_pinConnections.push_back(std::make_shared(pComponent, pPin)); return true; } + + std::unique_ptr Odb::Lib::ProductModel::Net::to_protobuf() const + { + auto pNetMsg = std::unique_ptr(); + pNetMsg->set_name(m_name); + pNetMsg->set_index(m_index); + for (auto& pPinConnection : m_pinConnections) + { + auto pPinConnectionMsg = pPinConnection->to_protobuf(); + pNetMsg->add_pinconnections()->CopyFrom(*pPinConnectionMsg); + } + return pNetMsg; + } + + void Odb::Lib::ProductModel::Net::from_protobuf(const Odb::Lib::Protobuf::ProductModel::Net& message) + { + m_name = message.name(); + m_index = message.index(); + for (auto& pinConnectionMsg : message.pinconnections()) + { + auto pPinConnection = std::make_shared(nullptr, nullptr); + pPinConnection->from_protobuf(pinConnectionMsg); + m_pinConnections.push_back(pPinConnection); + } + } } diff --git a/OdbDesignLib/ProductModel/Net.h b/OdbDesignLib/ProductModel/Net.h index 8c00422e..c47442fc 100644 --- a/OdbDesignLib/ProductModel/Net.h +++ b/OdbDesignLib/ProductModel/Net.h @@ -8,11 +8,13 @@ #include "PinConnection.h" #include "Component.h" #include "Pin.h" +#include "../ProtoBuf/net.pb.h" +#include "../IProtoBuffable.h" namespace Odb::Lib::ProductModel { - class ODBDESIGN_EXPORT Net + class ODBDESIGN_EXPORT Net : IProtoBuffable { public: Net(std::string name, unsigned int index); @@ -23,6 +25,10 @@ namespace Odb::Lib::ProductModel unsigned int GetIndex() const; bool AddPinConnection(std::shared_ptr pComponent, std::shared_ptr pPin); + // Inherited via IProtoBuffable + std::unique_ptr to_protobuf() const override; + void from_protobuf(const Odb::Lib::Protobuf::ProductModel::Net& message) override; + typedef std::vector> Vector; typedef std::map> StringMap; diff --git a/OdbDesignLib/ProductModel/Package.cpp b/OdbDesignLib/ProductModel/Package.cpp index 0b43225c..ebb83daf 100644 --- a/OdbDesignLib/ProductModel/Package.cpp +++ b/OdbDesignLib/ProductModel/Package.cpp @@ -1,6 +1,8 @@ #include "Package.h" #include "Package.h" #include "Package.h" +#include "Package.h" +#include "Package.h" namespace Odb::Lib::ProductModel { @@ -26,6 +28,41 @@ namespace Odb::Lib::ProductModel return m_pins; } + std::unique_ptr Package::to_protobuf() const + { + auto pPackageMsg = std::unique_ptr(); + pPackageMsg->set_name(m_name); + pPackageMsg->set_index(m_index); + for (const auto& pPin : m_pins) + { + auto pPinMsg = pPin->to_protobuf(); + pPackageMsg->add_pins()->CopyFrom(*pPinMsg); + } + for (const auto& kvPin : m_pinsByName) + { + (*pPackageMsg->mutable_pinsbyname())[kvPin.first] = *kvPin.second->to_protobuf(); + } + return pPackageMsg; + } + + void Package::from_protobuf(const Odb::Lib::Protobuf::ProductModel::Package& message) + { + m_name = message.name(); + m_index = message.index(); + for (const auto& pinMsg : message.pins()) + { + auto pPin = std::make_shared("", 0); + pPin->from_protobuf(pinMsg); + m_pins.push_back(pPin); + } + for (const auto& kvPinMsg : message.pinsbyname()) + { + auto pPin = std::make_shared("", 0); + pPin->from_protobuf(kvPinMsg.second); + m_pinsByName[kvPinMsg.first] = pPin; + } + } + unsigned int Package::GetIndex() const { return m_index; diff --git a/OdbDesignLib/ProductModel/Package.h b/OdbDesignLib/ProductModel/Package.h index 978bdeef..a03356f1 100644 --- a/OdbDesignLib/ProductModel/Package.h +++ b/OdbDesignLib/ProductModel/Package.h @@ -6,11 +6,13 @@ #include #include #include "Pin.h" +#include "../ProtoBuf/package.pb.h" +#include "../IProtoBuffable.h" namespace Odb::Lib::ProductModel { - class ODBDESIGN_EXPORT Package + class ODBDESIGN_EXPORT Package : IProtoBuffable { public: Package(std::string name, unsigned int index); @@ -25,6 +27,10 @@ namespace Odb::Lib::ProductModel const Pin::StringMap& GetPinsByName() const; const Pin::Vector& GetPins() const; + // Inherited via IProtoBuffable + std::unique_ptr to_protobuf() const override; + void from_protobuf(const Odb::Lib::Protobuf::ProductModel::Package& message) override; + typedef std::vector> Vector; typedef std::map> StringMap; diff --git a/OdbDesignLib/ProductModel/Part.cpp b/OdbDesignLib/ProductModel/Part.cpp index c873e9ca..1165e797 100644 --- a/OdbDesignLib/ProductModel/Part.cpp +++ b/OdbDesignLib/ProductModel/Part.cpp @@ -1,4 +1,6 @@ #include "Part.h" +#include "Part.h" +#include "Part.h" namespace Odb::Lib::ProductModel { @@ -6,8 +8,21 @@ namespace Odb::Lib::ProductModel : m_name(name) { } + std::string Part::GetName() const { return m_name; } + + std::unique_ptr Odb::Lib::ProductModel::Part::to_protobuf() const + { + auto pPartMsg = std::unique_ptr(); + pPartMsg->set_name(m_name); + return pPartMsg; + } + + void Odb::Lib::ProductModel::Part::from_protobuf(const Odb::Lib::Protobuf::ProductModel::Part& message) + { + m_name = message.name(); + } } \ No newline at end of file diff --git a/OdbDesignLib/ProductModel/Part.h b/OdbDesignLib/ProductModel/Part.h index a47426e4..6455a677 100644 --- a/OdbDesignLib/ProductModel/Part.h +++ b/OdbDesignLib/ProductModel/Part.h @@ -5,10 +5,12 @@ #include #include #include +#include "../ProtoBuf/part.pb.h" +#include "../IProtoBuffable.h" namespace Odb::Lib::ProductModel { - class Part + class ODBDESIGN_EXPORT Part : public IProtoBuffable { public: Part(std::string name); @@ -18,6 +20,10 @@ namespace Odb::Lib::ProductModel typedef std::vector> Vector; typedef std::map> StringMap; + // Inherited via IProtoBuffable + std::unique_ptr to_protobuf() const override; + void from_protobuf(const Odb::Lib::Protobuf::ProductModel::Part& message) override; + private: std::string m_name; diff --git a/OdbDesignLib/ProductModel/Pin.cpp b/OdbDesignLib/ProductModel/Pin.cpp index 4f44e40a..0cfad4fe 100644 --- a/OdbDesignLib/ProductModel/Pin.cpp +++ b/OdbDesignLib/ProductModel/Pin.cpp @@ -1,4 +1,7 @@ #include "Pin.h" +#include "Pin.h" +#include "Pin.h" +#include "Pin.h" namespace Odb::Lib::ProductModel @@ -18,4 +21,18 @@ namespace Odb::Lib::ProductModel { return m_index; } + + std::unique_ptr Odb::Lib::ProductModel::Pin::to_protobuf() const + { + auto pPinMessage = std::make_unique(); + pPinMessage->set_name(m_name); + pPinMessage->set_index(m_index); + return pPinMessage; + } + + void Pin::from_protobuf(const Odb::Lib::Protobuf::ProductModel::Pin& message) + { + m_name = message.name(); + m_index = message.index(); + } } diff --git a/OdbDesignLib/ProductModel/Pin.h b/OdbDesignLib/ProductModel/Pin.h index 286206a9..97272df5 100644 --- a/OdbDesignLib/ProductModel/Pin.h +++ b/OdbDesignLib/ProductModel/Pin.h @@ -5,11 +5,13 @@ #include #include #include +#include "../ProtoBuf/pin.pb.h" +#include "../IProtoBuffable.h" namespace Odb::Lib::ProductModel { - class ODBDESIGN_EXPORT Pin + class ODBDESIGN_EXPORT Pin : public IProtoBuffable { public: Pin(std::string name, unsigned int index); @@ -21,9 +23,13 @@ namespace Odb::Lib::ProductModel typedef std::vector> Vector; typedef std::map> StringMap; + // Inherited via IProtoBuffable + std::unique_ptr to_protobuf() const override; + void from_protobuf(const Odb::Lib::Protobuf::ProductModel::Pin& message) override; + private: std::string m_name; - unsigned int m_index; + unsigned int m_index; }; } // namespace Odb::Lib::ProductModel diff --git a/OdbDesignLib/ProductModel/PinConnection.cpp b/OdbDesignLib/ProductModel/PinConnection.cpp index 9da28a20..eb54de2d 100644 --- a/OdbDesignLib/ProductModel/PinConnection.cpp +++ b/OdbDesignLib/ProductModel/PinConnection.cpp @@ -1,6 +1,8 @@ #include "PinConnection.h" #include "PinConnection.h" #include "PinConnection.h" +#include "PinConnection.h" +#include "PinConnection.h" namespace Odb::Lib::ProductModel @@ -36,4 +38,20 @@ namespace Odb::Lib::ProductModel return m_pComponent; } + std::unique_ptr PinConnection::to_protobuf() const + { + auto pPinConnectionMsg = std::unique_ptr(); + pPinConnectionMsg->set_name(m_name); + pPinConnectionMsg->set_allocated_component(m_pComponent->to_protobuf().release()); + pPinConnectionMsg->set_allocated_pin(m_pPin->to_protobuf().release()); + return pPinConnectionMsg; + } + + void PinConnection::from_protobuf(const Odb::Lib::Protobuf::ProductModel::PinConnection& message) + { + m_name = message.name(); + m_pComponent->from_protobuf(message.component()); + m_pPin->from_protobuf(message.pin()); + } + } // namespace Odb::Lib::ProductModel diff --git a/OdbDesignLib/ProductModel/PinConnection.h b/OdbDesignLib/ProductModel/PinConnection.h index b5508c63..78a8f2e5 100644 --- a/OdbDesignLib/ProductModel/PinConnection.h +++ b/OdbDesignLib/ProductModel/PinConnection.h @@ -7,11 +7,13 @@ #include #include "Component.h" #include "Pin.h" +#include "../ProtoBuf/pinconnection.pb.h" +#include "../IProtoBuffable.h" namespace Odb::Lib::ProductModel { - class ODBDESIGN_EXPORT PinConnection + class ODBDESIGN_EXPORT PinConnection : IProtoBuffable { public: PinConnection(std::shared_ptr pComponent, std::shared_ptr pPin); @@ -22,6 +24,10 @@ namespace Odb::Lib::ProductModel std::shared_ptr GetPin() const; std::shared_ptr GetComponent() const; + // Inherited via IProtoBuffable + std::unique_ptr to_protobuf() const override; + void from_protobuf(const Odb::Lib::Protobuf::ProductModel::PinConnection& message) override; + typedef std::vector> Vector; typedef std::map> StringMap; diff --git a/OdbDesignLib/ProductModel/Via.cpp b/OdbDesignLib/ProductModel/Via.cpp index 22ab7ba5..a4f6b2b3 100644 --- a/OdbDesignLib/ProductModel/Via.cpp +++ b/OdbDesignLib/ProductModel/Via.cpp @@ -1,4 +1,6 @@ #include "Via.h" +#include "Via.h" +#include "Via.h" namespace Odb::Lib::ProductModel @@ -19,4 +21,18 @@ namespace Odb::Lib::ProductModel return m_side; } + std::unique_ptr Via::to_protobuf() const + { + auto pViaMsg = std::unique_ptr(); + pViaMsg->set_name(m_name); + pViaMsg->set_boardside(static_cast(m_side)); + return pViaMsg; + } + + void Via::from_protobuf(const Odb::Lib::Protobuf::ProductModel::Via& message) + { + m_name = message.name(); + m_side = static_cast(message.boardside()); + } + } // namespace Odb::Lib::ProductModel diff --git a/OdbDesignLib/ProductModel/Via.h b/OdbDesignLib/ProductModel/Via.h index af0c0aa2..31a73d5e 100644 --- a/OdbDesignLib/ProductModel/Via.h +++ b/OdbDesignLib/ProductModel/Via.h @@ -6,11 +6,13 @@ #include #include #include "../enums.h" +#include "../ProtoBuf/via.pb.h" +#include "../IProtoBuffable.h" namespace Odb::Lib::ProductModel { - class ODBDESIGN_EXPORT Via + class ODBDESIGN_EXPORT Via : IProtoBuffable { public: Via(); @@ -18,6 +20,10 @@ namespace Odb::Lib::ProductModel std::string GetName() const; BoardSide GetSide() const; + // Inherited via IProtoBuffable + std::unique_ptr to_protobuf() const override; + void from_protobuf(const Odb::Lib::Protobuf::ProductModel::Via& message) override; + typedef std::vector> Vector; typedef std::map> StringMap; From 5483ff5dae0eeb6406c27d3935048ef78c709f92 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sat, 27 Jan 2024 12:00:54 -0800 Subject: [PATCH 02/42] make *_protobuf methods accessible --- OdbDesignLib/FileModel/Design/FileArchive.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OdbDesignLib/FileModel/Design/FileArchive.h b/OdbDesignLib/FileModel/Design/FileArchive.h index b7c862fc..f221f2f2 100644 --- a/OdbDesignLib/FileModel/Design/FileArchive.h +++ b/OdbDesignLib/FileModel/Design/FileArchive.h @@ -44,6 +44,10 @@ namespace Odb::Lib::FileModel::Design bool ParseFileModel(); + // Inherited via IProtoBuffable + std::unique_ptr to_protobuf() const override; + void from_protobuf(const Odb::Lib::Protobuf::FileArchive& message) override; + typedef std::vector> Vector; typedef std::map> StringMap; @@ -73,10 +77,6 @@ namespace Odb::Lib::FileModel::Design static std::string findRootDir(const std::filesystem::path& extractedPath); static bool pathContainsTopLevelDesignDirs(const std::filesystem::path& path); - // Inherited via IProtoBuffable - std::unique_ptr to_protobuf() const override; - void from_protobuf(const Odb::Lib::Protobuf::FileArchive& message) override; - static inline constexpr const char* TOPLEVEL_DESIGN_DIR_NAMES[] = { "fonts", From ab5582699d53ff0afbd42f569b898e363fff7f51 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sat, 27 Jan 2024 12:01:10 -0800 Subject: [PATCH 03/42] use default for ctor instead of empty braces --- OdbDesignLib/IProtoBuffable.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/OdbDesignLib/IProtoBuffable.h b/OdbDesignLib/IProtoBuffable.h index 012d0362..ffa4730c 100644 --- a/OdbDesignLib/IProtoBuffable.h +++ b/OdbDesignLib/IProtoBuffable.h @@ -32,8 +32,7 @@ namespace Odb::Lib protected: // abstract class - IProtoBuffable() - {} + IProtoBuffable() = default; // TMessage MUST derive from Message (must use this until template type contraints support is added) static_assert(std::is_base_of::value, "template parameter type TPbMessage must derive from Protobuf Message class"); From 33b4b5b0a970efa72f31c22a30641467213ef05b Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sat, 27 Jan 2024 12:39:04 -0800 Subject: [PATCH 04/42] add empty test files --- OdbDesignTests/CMakeLists.txt | 2 +- OdbDesignTests/DesignTests.cpp | 25 +++++++++++++++++++ OdbDesignTests/ProtobufSerializationTests.cpp | 0 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 OdbDesignTests/DesignTests.cpp create mode 100644 OdbDesignTests/ProtobufSerializationTests.cpp diff --git a/OdbDesignTests/CMakeLists.txt b/OdbDesignTests/CMakeLists.txt index 67b62429..e911bf69 100644 --- a/OdbDesignTests/CMakeLists.txt +++ b/OdbDesignTests/CMakeLists.txt @@ -10,7 +10,7 @@ add_executable(OdbDesignTests "DesignCacheLoadTests.cpp" "Fixtures/DesignNameValueParamTest.h" "FileArchiveTests.cpp" -) + "DesignTests.cpp" "ProtobufSerializationTests.cpp") target_link_libraries(OdbDesignTests PRIVATE GTest::gtest_main) diff --git a/OdbDesignTests/DesignTests.cpp b/OdbDesignTests/DesignTests.cpp new file mode 100644 index 00000000..e39e56ef --- /dev/null +++ b/OdbDesignTests/DesignTests.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/ProtobufSerializationTests.cpp b/OdbDesignTests/ProtobufSerializationTests.cpp new file mode 100644 index 00000000..e69de29b From 6b8aae920f7aab739dd8b6737e7a3a3976770b3e Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sat, 27 Jan 2024 13:07:52 -0800 Subject: [PATCH 05/42] inherit from IProtobuffable publicly --- OdbDesignLib/ProductModel/Component.h | 2 +- OdbDesignLib/ProductModel/Design.h | 2 +- OdbDesignLib/ProductModel/Net.h | 2 +- OdbDesignLib/ProductModel/Package.h | 2 +- OdbDesignLib/ProductModel/PinConnection.h | 2 +- OdbDesignLib/ProductModel/Via.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/OdbDesignLib/ProductModel/Component.h b/OdbDesignLib/ProductModel/Component.h index 4d6b94ce..cd8fbb9d 100644 --- a/OdbDesignLib/ProductModel/Component.h +++ b/OdbDesignLib/ProductModel/Component.h @@ -15,7 +15,7 @@ namespace Odb::Lib::ProductModel { - class ODBDESIGN_EXPORT Component : IProtoBuffable + class ODBDESIGN_EXPORT Component : public IProtoBuffable { public: Component(std::string refDes, std::string partName, std::shared_ptr pPackage, unsigned int index, BoardSide side, std::shared_ptr pPart); diff --git a/OdbDesignLib/ProductModel/Design.h b/OdbDesignLib/ProductModel/Design.h index 88cbef93..2fbf5cb3 100644 --- a/OdbDesignLib/ProductModel/Design.h +++ b/OdbDesignLib/ProductModel/Design.h @@ -16,7 +16,7 @@ namespace Odb::Lib::ProductModel { - class ODBDESIGN_EXPORT Design : IProtoBuffable + class ODBDESIGN_EXPORT Design : public IProtoBuffable { public: Design(); diff --git a/OdbDesignLib/ProductModel/Net.h b/OdbDesignLib/ProductModel/Net.h index c47442fc..26d32798 100644 --- a/OdbDesignLib/ProductModel/Net.h +++ b/OdbDesignLib/ProductModel/Net.h @@ -14,7 +14,7 @@ namespace Odb::Lib::ProductModel { - class ODBDESIGN_EXPORT Net : IProtoBuffable + class ODBDESIGN_EXPORT Net : public IProtoBuffable { public: Net(std::string name, unsigned int index); diff --git a/OdbDesignLib/ProductModel/Package.h b/OdbDesignLib/ProductModel/Package.h index a03356f1..f3219c64 100644 --- a/OdbDesignLib/ProductModel/Package.h +++ b/OdbDesignLib/ProductModel/Package.h @@ -12,7 +12,7 @@ namespace Odb::Lib::ProductModel { - class ODBDESIGN_EXPORT Package : IProtoBuffable + class ODBDESIGN_EXPORT Package : public IProtoBuffable { public: Package(std::string name, unsigned int index); diff --git a/OdbDesignLib/ProductModel/PinConnection.h b/OdbDesignLib/ProductModel/PinConnection.h index 78a8f2e5..9ed94efe 100644 --- a/OdbDesignLib/ProductModel/PinConnection.h +++ b/OdbDesignLib/ProductModel/PinConnection.h @@ -13,7 +13,7 @@ namespace Odb::Lib::ProductModel { - class ODBDESIGN_EXPORT PinConnection : IProtoBuffable + class ODBDESIGN_EXPORT PinConnection : public IProtoBuffable { public: PinConnection(std::shared_ptr pComponent, std::shared_ptr pPin); diff --git a/OdbDesignLib/ProductModel/Via.h b/OdbDesignLib/ProductModel/Via.h index 31a73d5e..7da1bd95 100644 --- a/OdbDesignLib/ProductModel/Via.h +++ b/OdbDesignLib/ProductModel/Via.h @@ -12,7 +12,7 @@ namespace Odb::Lib::ProductModel { - class ODBDESIGN_EXPORT Via : IProtoBuffable + class ODBDESIGN_EXPORT Via : public IProtoBuffable { public: Via(); From 8842308474e28dab3ba827f555cafb57668343ca Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sat, 27 Jan 2024 13:08:24 -0800 Subject: [PATCH 06/42] change name of json object in response --- OdbDesignServer/Controllers/FileModelController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OdbDesignServer/Controllers/FileModelController.cpp b/OdbDesignServer/Controllers/FileModelController.cpp index 47ac9f4c..7d95b65c 100644 --- a/OdbDesignServer/Controllers/FileModelController.cpp +++ b/OdbDesignServer/Controllers/FileModelController.cpp @@ -1064,7 +1064,7 @@ namespace Odb::App::Server } crow::json::wvalue jsonResponse; - jsonResponse["designs"] = std::move(designNames); + jsonResponse["file archives"] = std::move(designNames); return crow::response(jsonResponse); } From ba455321609321354b94759571d1b3c9959e326b Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sat, 27 Jan 2024 19:00:29 -0800 Subject: [PATCH 07/42] allow blank/no description value in DSC line of BOM data/description record of components files --- OdbDesignLib/FileModel/Design/ComponentsFile.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OdbDesignLib/FileModel/Design/ComponentsFile.cpp b/OdbDesignLib/FileModel/Design/ComponentsFile.cpp index 9dea4179..e22a4114 100644 --- a/OdbDesignLib/FileModel/Design/ComponentsFile.cpp +++ b/OdbDesignLib/FileModel/Design/ComponentsFile.cpp @@ -647,7 +647,8 @@ namespace Odb::Lib::FileModel::Design if (!(lineStream >> description)) { - throw_parse_error(m_path, line, token, lineNumber); + // allow blank/no description value + //throw_parse_error(m_path, line, token, lineNumber); } pCurrentBomDescriptionRecord->descriptions.push_back(description); From 578c42dc6ba2cf493bb5547302b2346c0c08860f Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sun, 28 Jan 2024 09:08:52 -0800 Subject: [PATCH 08/42] comment out internal logging in Logger --- Utils/Logger.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Utils/Logger.cpp b/Utils/Logger.cpp index a22a6c41..80cad0c6 100644 --- a/Utils/Logger.cpp +++ b/Utils/Logger.cpp @@ -170,11 +170,11 @@ namespace Utils bool Logger::logMessage(const Message& logMessage) { - std::cout << "[Logger::logMessage] enter, formatting message" << std::endl; + //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; + //std::cout << "[Logger::logMessage] message formatted, writing to cout and cerr" << std::endl; if (logMessage.level >= m_level) { @@ -188,26 +188,26 @@ namespace Utils // if (m_outputTypes & OutputTypes::StdErr) std::cerr << message << std::flush; //} - std::cout << "[Logger::logMessage] wrote to cout and cerr, writing to file..." << std::endl; + //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; + //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; + //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] wrote to file and closed stream" << std::endl; } } - std::cout << "[Logger::logMessage] exit" << std::endl; + //std::cout << "[Logger::logMessage] exit" << std::endl; return true; } From 364a7bcd7547db2e781bb003a4d545d137229bf2 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sun, 28 Jan 2024 09:09:40 -0800 Subject: [PATCH 09/42] implement /designs endpoints with empty route handlers --- .../Controllers/DesignsController.cpp | 233 +++++++++++++++++- .../Controllers/DesignsController.h | 15 ++ 2 files changed, 247 insertions(+), 1 deletion(-) diff --git a/OdbDesignServer/Controllers/DesignsController.cpp b/OdbDesignServer/Controllers/DesignsController.cpp index 062dd934..2d88091c 100644 --- a/OdbDesignServer/Controllers/DesignsController.cpp +++ b/OdbDesignServer/Controllers/DesignsController.cpp @@ -1,13 +1,244 @@ #include "DesignsController.h" +#include +#include "UrlEncoding.h" + +using namespace Odb::Lib::App; +using namespace Utils; namespace Odb::App::Server { - DesignsController::DesignsController(Odb::Lib::App::IOdbServerApp& serverApp) + DesignsController::DesignsController(IOdbServerApp& serverApp) : RouteController(serverApp) { } void DesignsController::register_routes() { + CROW_ROUTE(m_serverApp.crow_app(), "/designs") + ([&](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 this->designs_list_route_handler(req); + }); + + CROW_ROUTE(m_serverApp.crow_app(), "/designs/") + ([&](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->design_route_handler(designName, req); + }); + + CROW_ROUTE(m_serverApp.crow_app(), "/designs//components") + ([&](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->designs_components_route_handler(designName, req); + }); + + CROW_ROUTE(m_serverApp.crow_app(), "/designs//components/") + ([&](const crow::request& req, std::string designName, std::string refDes) + { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + + return this->designs_component_route_handler(designName, refDes, req); + }); + + CROW_ROUTE(m_serverApp.crow_app(), "/designs//nets") + ([&](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->designs_nets_route_handler(designName, req); + }); + + CROW_ROUTE(m_serverApp.crow_app(), "/designs//nets/") + ([&](const crow::request& req, std::string designName, std::string netName) + { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + + return this->designs_net_route_handler(designName, netName, req); + }); + + CROW_ROUTE(m_serverApp.crow_app(), "/designs//packages") + ([&](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->designs_packages_route_handler(designName, req); + }); + + CROW_ROUTE(m_serverApp.crow_app(), "/designs//packages/") + ([&](const crow::request& req, std::string designName, std::string packageName) + { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + + return this->designs_package_route_handler(designName, packageName, req); + }); + + CROW_ROUTE(m_serverApp.crow_app(), "/designs//parts") + ([&](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->designs_parts_route_handler(designName, req); + }); + + CROW_ROUTE(m_serverApp.crow_app(), "/designs//parts/") + ([&](const crow::request& req, std::string designName, std::string partName) + { + // authenticate request before sending to handler + auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + if (authResp.code != crow::status::OK) + { + return authResp; + } + + return this->designs_part_route_handler(designName, partName, req); + }); + } + + crow::response DesignsController::designs_list_route_handler(const crow::request& req) + { + const auto& fileArchives = m_serverApp.designs().getUnloadedDesignNames(); + + crow::json::wvalue::list designNames; + for (const auto& designName : fileArchives) + { + designNames.push_back(designName); + } + + crow::json::wvalue jsonResponse; + jsonResponse["designs"] = std::move(designNames); + return crow::response(jsonResponse); + } + + crow::response DesignsController::design_route_handler(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 pDesign = m_serverApp.designs().GetDesign(designNameDecoded); + if (pDesign == nullptr) + { + std::stringstream ss; + ss << "design: \"" << designNameDecoded << "\" not found"; + return crow::response(crow::status::NOT_FOUND, ss.str()); + } + + return crow::response(JsonCrowReturnable(*pDesign)); + } + crow::response DesignsController::designs_components_route_handler(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 pDesign = m_serverApp.designs().GetDesign(designNameDecoded); + if (pDesign == nullptr) + { + std::stringstream ss; + ss << "design: \"" << designNameDecoded << "\" not found"; + return crow::response(crow::status::NOT_FOUND, ss.str()); + } + + std::vector rvComponents; + + const auto& components = pDesign->GetComponents(); + for (const auto& component : components) + { + rvComponents.push_back(crow::json::load(component->to_json())); + } + + crow::json::wvalue wv; + wv["components"] = std::move(rvComponents); + return crow::response(wv); + } + + crow::response DesignsController::designs_component_route_handler(std::string designName, std::string refDes, const crow::request& req) + { + return crow::response(); + } + + crow::response DesignsController::designs_nets_route_handler(std::string designName, const crow::request& req) + { + return crow::response(); + } + + crow::response DesignsController::designs_net_route_handler(std::string designName, std::string netName, const crow::request& req) + { + return crow::response(); + } + + crow::response DesignsController::designs_parts_route_handler(std::string designName, const crow::request& req) + { + return crow::response(); + } + + crow::response DesignsController::designs_part_route_handler(std::string designName, std::string partName, const crow::request& req) + { + return crow::response(); + } + + crow::response DesignsController::designs_packages_route_handler(std::string designName, const crow::request& req) + { + return crow::response(); + } + + crow::response DesignsController::designs_package_route_handler(std::string designName, std::string packageName, const crow::request& req) + { + return crow::response(); } } \ No newline at end of file diff --git a/OdbDesignServer/Controllers/DesignsController.h b/OdbDesignServer/Controllers/DesignsController.h index 9ef7c7a4..fb150897 100644 --- a/OdbDesignServer/Controllers/DesignsController.h +++ b/OdbDesignServer/Controllers/DesignsController.h @@ -15,5 +15,20 @@ namespace Odb::App::Server private: + crow::response designs_list_route_handler(const crow::request& req); + crow::response design_route_handler(std::string designName, const crow::request& req); + + crow::response designs_components_route_handler(std::string designName, const crow::request& req); + crow::response designs_component_route_handler(std::string designName, std::string refDes, const crow::request& req); + + crow::response designs_nets_route_handler(std::string designName, const crow::request& req); + crow::response designs_net_route_handler(std::string designName, std::string netName, const crow::request& req); + + crow::response designs_parts_route_handler(std::string designName, const crow::request& req); + crow::response designs_part_route_handler(std::string designName, std::string partName, const crow::request& req); + + crow::response designs_packages_route_handler(std::string designName, const crow::request& req); + crow::response designs_package_route_handler(std::string designName, std::string packageName, const crow::request& req); + }; } From 3a1e22f2ff364814b8b57350aadc48b4e958d60e Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sun, 28 Jan 2024 09:10:11 -0800 Subject: [PATCH 10/42] move member up to affect order of initialization --- Utils/Logger.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Utils/Logger.h b/Utils/Logger.h index a220a6bc..c561a4dc 100644 --- a/Utils/Logger.h +++ b/Utils/Logger.h @@ -103,10 +103,10 @@ namespace Utils int m_outputTypes; std::ofstream m_logFileStream; - WorkQueueLoopThread m_logMessageLoop; - //bool m_enableInternalLogging = false; + WorkQueueLoopThread m_logMessageLoop; + //bool processWorkItem(struct LogMessage& logMessage) override; bool logMessage(const struct Message& logMessage); From 0175af5401a2ed6d4cc0e310ddf2598a6ccd9b48 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sun, 28 Jan 2024 09:43:39 -0800 Subject: [PATCH 11/42] add IsLocal() environment macro and fix reading from correct environment variable name --- Utils/macros.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Utils/macros.h b/Utils/macros.h index 928f541a..fd1b580d 100644 --- a/Utils/macros.h +++ b/Utils/macros.h @@ -33,13 +33,18 @@ namespace Utils static inline bool IsEnvironment(const std::string& environmentName) { - auto envValue = std::getenv("ENVIRONMENT_VARIABLE"); + auto envValue = std::getenv(ENVIRONMENT_VARIABLE); if (envValue == nullptr) return false; return Utils::str_to_lower_copy(envValue) == Utils::str_to_lower_copy(environmentName); } + static inline bool IsLocal() + { + return IsEnvironment("Local"); + } + static inline bool IsDevelopment() { return IsEnvironment("Development"); From 5cdb70c63105d99ef06149409f561cec15b7ec56 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sun, 28 Jan 2024 09:58:05 -0800 Subject: [PATCH 12/42] bypass authentication if running DEBUG build AND in "Local" environment --- OdbDesignLib/App/BasicRequestAuthentication.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/OdbDesignLib/App/BasicRequestAuthentication.cpp b/OdbDesignLib/App/BasicRequestAuthentication.cpp index 6e719cf5..a5cd632c 100644 --- a/OdbDesignLib/App/BasicRequestAuthentication.cpp +++ b/OdbDesignLib/App/BasicRequestAuthentication.cpp @@ -1,10 +1,20 @@ #include "BasicRequestAuthentication.h" #include +#include "macros.h" + +using namespace Utils; namespace Odb::Lib::App { crow::response BasicRequestAuthentication::AuthenticateRequest(const crow::request& req) { + // if running debug build AND in Local environment, bypass authentication + if (IsDebug() && IsLocal()) + { + // 200 Authorized! + return crow::response(200, "Authorized"); + } + const auto& authHeader = req.get_header_value("Authorization"); if (authHeader.empty()) return crow::response(401, "Unauthorized"); @@ -29,10 +39,10 @@ namespace Odb::Lib::App { // 500 - Internal Server Error auto validUsername = std::getenv(USERNAME_ENV_NAME); - if (validUsername == nullptr) return crow::response(500, "Server failed retrieving credentials"); + if (validUsername == nullptr) return crow::response(500, "Failed retrieving credentials"); auto validPassword = std::getenv(PASSWORD_ENV_NAME); - if (validPassword == nullptr) return crow::response(500, "Server failed retrieving credentials"); + if (validPassword == nullptr) return crow::response(500, "Failed retrieving credentials"); // 403 - Forbidden if (username != validUsername || From 34561618107a33471d286cdc4927a7a04004aa8e Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sun, 28 Jan 2024 11:17:14 -0800 Subject: [PATCH 13/42] link to gmock target in tests target to use gmock matchers --- OdbDesignTests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OdbDesignTests/CMakeLists.txt b/OdbDesignTests/CMakeLists.txt index e911bf69..b68dc9e7 100644 --- a/OdbDesignTests/CMakeLists.txt +++ b/OdbDesignTests/CMakeLists.txt @@ -12,7 +12,7 @@ add_executable(OdbDesignTests "FileArchiveTests.cpp" "DesignTests.cpp" "ProtobufSerializationTests.cpp") -target_link_libraries(OdbDesignTests PRIVATE GTest::gtest_main) +target_link_libraries(OdbDesignTests PRIVATE GTest::gtest_main GTest::gmock_main) # link to OdbDesign library target_link_libraries(OdbDesignTests PRIVATE OdbDesign) From 790d5b049edee9582a084587109b2d4ea9dc60b5 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sun, 28 Jan 2024 11:18:49 -0800 Subject: [PATCH 14/42] link to protobuf::libprotobuf target PUBLICly in OdbDesign target to allow link clients to find implementations of protobuf identifiers --- OdbDesignLib/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OdbDesignLib/CMakeLists.txt b/OdbDesignLib/CMakeLists.txt index b2e626e8..b5b2789f 100644 --- a/OdbDesignLib/CMakeLists.txt +++ b/OdbDesignLib/CMakeLists.txt @@ -80,7 +80,7 @@ target_link_libraries(OdbDesign PRIVATE Crow::Crow) find_package(Protobuf CONFIG REQUIRED) #protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS protoc/edadatafile.proto) #target_link_libraries(OdbDesign PUBLIC protobuf::libprotoc protobuf::libprotobuf protobuf::libprotobuf-lite) -target_link_libraries(OdbDesign PRIVATE protobuf::libprotobuf) +target_link_libraries(OdbDesign PUBLIC protobuf::libprotobuf) # mark the generated Protofbuf C++ files as generated #set_source_files_properties(${PROTO_SRC} ${PROTO_HDRS} PROPERTIES GENERATED TRUE) # add the generated Protobuf C++ files to the target From a72b639e8d1857f3539d5270c5539ec7499c992e Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sun, 28 Jan 2024 11:19:30 -0800 Subject: [PATCH 15/42] add method for getting specific component by refDes from Design --- OdbDesignLib/ProductModel/Design.cpp | 13 +++++++++++-- OdbDesignLib/ProductModel/Design.h | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/OdbDesignLib/ProductModel/Design.cpp b/OdbDesignLib/ProductModel/Design.cpp index c5a2f0b3..389100db 100644 --- a/OdbDesignLib/ProductModel/Design.cpp +++ b/OdbDesignLib/ProductModel/Design.cpp @@ -1,5 +1,3 @@ -#include "Design.h" -#include "Design.h" #include #include "Design.h" #include "Package.h" @@ -64,6 +62,17 @@ namespace Odb::Lib::ProductModel return m_componentsByName; } + std::shared_ptr Design::GetComponent(const std::string& refDes) const + { + auto findIt = m_componentsByName.find(refDes); + if (findIt != m_componentsByName.end()) + { + return findIt->second; + } + + return nullptr; + } + const Part::Vector& Design::GetParts() const { return m_parts; diff --git a/OdbDesignLib/ProductModel/Design.h b/OdbDesignLib/ProductModel/Design.h index 2fbf5cb3..68bd3717 100644 --- a/OdbDesignLib/ProductModel/Design.h +++ b/OdbDesignLib/ProductModel/Design.h @@ -33,6 +33,7 @@ namespace Odb::Lib::ProductModel const Component::Vector& GetComponents() const; const Component::StringMap& GetComponentsByName() const; + std::shared_ptr GetComponent(const std::string& refDes) const; const Part::Vector& GetParts() const; const Part::StringMap& GetPartsByName() const; From 840b8b5d5e9ecc3f5a3f9c822fe7a429674308bb Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sun, 28 Jan 2024 11:35:29 -0800 Subject: [PATCH 16/42] modify script to add ODBDESIGN_EXPORT link export macro to all identifiers when compiling protoc files --- scripts/compile-protobuf.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/compile-protobuf.ps1 b/scripts/compile-protobuf.ps1 index 7f05bc55..c8732144 100644 --- a/scripts/compile-protobuf.ps1 +++ b/scripts/compile-protobuf.ps1 @@ -1,3 +1,4 @@ $PROTOC = 'C:\Source\github\nam20485\OdbDesign\out\build\x64-debug\vcpkg_installed\x64-windows\tools\protobuf\protoc' +$DLL_EXPORT = 'ODBDESIGN_EXPORT' -. $PROTOC --cpp_out=../Protobuf --error_format=msvs *.proto +. $PROTOC --cpp_out=dllexport_decl=${DLL_EXPORT}:../Protobuf --error_format=msvs *.proto From 4be4f0566ef5a11045b38bed6ea965566abad680 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sun, 28 Jan 2024 11:36:01 -0800 Subject: [PATCH 17/42] recompile all protobuf classes to include link export macro ODBDESIGN_EXPORT --- OdbDesignLib/ProtoBuf/attrlistfile.pb.h | 16 +-- OdbDesignLib/ProtoBuf/common.pb.h | 32 +++--- OdbDesignLib/ProtoBuf/component.pb.h | 12 +-- OdbDesignLib/ProtoBuf/componentsfile.pb.h | 46 ++++---- OdbDesignLib/ProtoBuf/design.pb.h | 28 ++--- OdbDesignLib/ProtoBuf/edadatafile.pb.h | 106 +++++++++---------- OdbDesignLib/ProtoBuf/enums.pb.h | 22 ++-- OdbDesignLib/ProtoBuf/featuresfile.pb.h | 30 +++--- OdbDesignLib/ProtoBuf/filearchive.pb.h | 20 ++-- OdbDesignLib/ProtoBuf/layerdirectory.pb.h | 12 +-- OdbDesignLib/ProtoBuf/matrixfile.pb.h | 40 +++---- OdbDesignLib/ProtoBuf/miscinfofile.pb.h | 12 +-- OdbDesignLib/ProtoBuf/net.pb.h | 12 +-- OdbDesignLib/ProtoBuf/netlistfile.pb.h | 36 +++---- OdbDesignLib/ProtoBuf/package.pb.h | 16 +-- OdbDesignLib/ProtoBuf/part.pb.h | 12 +-- OdbDesignLib/ProtoBuf/pin.pb.h | 12 +-- OdbDesignLib/ProtoBuf/pinconnection.pb.h | 12 +-- OdbDesignLib/ProtoBuf/standardfontsfile.pb.h | 24 ++--- OdbDesignLib/ProtoBuf/stepdirectory.pb.h | 20 ++-- OdbDesignLib/ProtoBuf/stephdrfile.pb.h | 22 ++-- OdbDesignLib/ProtoBuf/symbolname.pb.h | 12 +-- OdbDesignLib/ProtoBuf/symbolsdirectory.pb.h | 12 +-- OdbDesignLib/ProtoBuf/via.pb.h | 12 +-- 24 files changed, 289 insertions(+), 289 deletions(-) diff --git a/OdbDesignLib/ProtoBuf/attrlistfile.pb.h b/OdbDesignLib/ProtoBuf/attrlistfile.pb.h index bd696d8d..942c9c23 100644 --- a/OdbDesignLib/ProtoBuf/attrlistfile.pb.h +++ b/OdbDesignLib/ProtoBuf/attrlistfile.pb.h @@ -35,7 +35,7 @@ #include // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_attrlistfile_2eproto +#define PROTOBUF_INTERNAL_EXPORT_attrlistfile_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -43,25 +43,25 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_attrlistfile_2eproto { +struct ODBDESIGN_EXPORT TableStruct_attrlistfile_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_attrlistfile_2eproto; +ODBDESIGN_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_attrlistfile_2eproto; namespace Odb { namespace Lib { namespace Protobuf { class AttrListFile; struct AttrListFileDefaultTypeInternal; -extern AttrListFileDefaultTypeInternal _AttrListFile_default_instance_; +ODBDESIGN_EXPORT extern AttrListFileDefaultTypeInternal _AttrListFile_default_instance_; class AttrListFile_AttributesByNameEntry_DoNotUse; struct AttrListFile_AttributesByNameEntry_DoNotUseDefaultTypeInternal; -extern AttrListFile_AttributesByNameEntry_DoNotUseDefaultTypeInternal _AttrListFile_AttributesByNameEntry_DoNotUse_default_instance_; +ODBDESIGN_EXPORT extern AttrListFile_AttributesByNameEntry_DoNotUseDefaultTypeInternal _AttrListFile_AttributesByNameEntry_DoNotUse_default_instance_; } // namespace Protobuf } // namespace Lib } // namespace Odb PROTOBUF_NAMESPACE_OPEN -template<> ::Odb::Lib::Protobuf::AttrListFile* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::AttrListFile>(Arena*); -template<> ::Odb::Lib::Protobuf::AttrListFile_AttributesByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::AttrListFile_AttributesByNameEntry_DoNotUse>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::AttrListFile* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::AttrListFile>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::AttrListFile_AttributesByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::AttrListFile_AttributesByNameEntry_DoNotUse>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { @@ -97,7 +97,7 @@ class AttrListFile_AttributesByNameEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ // ------------------------------------------------------------------- -class AttrListFile final : +class ODBDESIGN_EXPORT AttrListFile final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.AttrListFile) */ { public: inline AttrListFile() : AttrListFile(nullptr) {} diff --git a/OdbDesignLib/ProtoBuf/common.pb.h b/OdbDesignLib/ProtoBuf/common.pb.h index 02b0ca65..3c21bac3 100644 --- a/OdbDesignLib/ProtoBuf/common.pb.h +++ b/OdbDesignLib/ProtoBuf/common.pb.h @@ -33,7 +33,7 @@ #include // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_common_2eproto +#define PROTOBUF_INTERNAL_EXPORT_common_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -41,29 +41,29 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_common_2eproto { +struct ODBDESIGN_EXPORT TableStruct_common_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_common_2eproto; +ODBDESIGN_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_common_2eproto; namespace Odb { namespace Lib { namespace Protobuf { class ContourPolygon; struct ContourPolygonDefaultTypeInternal; -extern ContourPolygonDefaultTypeInternal _ContourPolygon_default_instance_; +ODBDESIGN_EXPORT extern ContourPolygonDefaultTypeInternal _ContourPolygon_default_instance_; class ContourPolygon_PolygonPart; struct ContourPolygon_PolygonPartDefaultTypeInternal; -extern ContourPolygon_PolygonPartDefaultTypeInternal _ContourPolygon_PolygonPart_default_instance_; +ODBDESIGN_EXPORT extern ContourPolygon_PolygonPartDefaultTypeInternal _ContourPolygon_PolygonPart_default_instance_; class PropertyRecord; struct PropertyRecordDefaultTypeInternal; -extern PropertyRecordDefaultTypeInternal _PropertyRecord_default_instance_; +ODBDESIGN_EXPORT extern PropertyRecordDefaultTypeInternal _PropertyRecord_default_instance_; } // namespace Protobuf } // namespace Lib } // namespace Odb PROTOBUF_NAMESPACE_OPEN -template<> ::Odb::Lib::Protobuf::ContourPolygon* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ContourPolygon>(Arena*); -template<> ::Odb::Lib::Protobuf::ContourPolygon_PolygonPart* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ContourPolygon_PolygonPart>(Arena*); -template<> ::Odb::Lib::Protobuf::PropertyRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::PropertyRecord>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::ContourPolygon* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ContourPolygon>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::ContourPolygon_PolygonPart* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ContourPolygon_PolygonPart>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::PropertyRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::PropertyRecord>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { @@ -75,12 +75,12 @@ enum ContourPolygon_PolygonPart_Type : int { ContourPolygon_PolygonPart_Type_ContourPolygon_PolygonPart_Type_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), ContourPolygon_PolygonPart_Type_ContourPolygon_PolygonPart_Type_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; -bool ContourPolygon_PolygonPart_Type_IsValid(int value); +ODBDESIGN_EXPORT bool ContourPolygon_PolygonPart_Type_IsValid(int value); constexpr ContourPolygon_PolygonPart_Type ContourPolygon_PolygonPart_Type_Type_MIN = ContourPolygon_PolygonPart_Type_Segment; constexpr ContourPolygon_PolygonPart_Type ContourPolygon_PolygonPart_Type_Type_MAX = ContourPolygon_PolygonPart_Type_Arc; constexpr int ContourPolygon_PolygonPart_Type_Type_ARRAYSIZE = ContourPolygon_PolygonPart_Type_Type_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ContourPolygon_PolygonPart_Type_descriptor(); +ODBDESIGN_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ContourPolygon_PolygonPart_Type_descriptor(); template inline const std::string& ContourPolygon_PolygonPart_Type_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -100,12 +100,12 @@ enum ContourPolygon_Type : int { ContourPolygon_Type_ContourPolygon_Type_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), ContourPolygon_Type_ContourPolygon_Type_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; -bool ContourPolygon_Type_IsValid(int value); +ODBDESIGN_EXPORT bool ContourPolygon_Type_IsValid(int value); constexpr ContourPolygon_Type ContourPolygon_Type_Type_MIN = ContourPolygon_Type_Island; constexpr ContourPolygon_Type ContourPolygon_Type_Type_MAX = ContourPolygon_Type_Hole; constexpr int ContourPolygon_Type_Type_ARRAYSIZE = ContourPolygon_Type_Type_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ContourPolygon_Type_descriptor(); +ODBDESIGN_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ContourPolygon_Type_descriptor(); template inline const std::string& ContourPolygon_Type_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -121,7 +121,7 @@ inline bool ContourPolygon_Type_Parse( } // =================================================================== -class PropertyRecord final : +class ODBDESIGN_EXPORT PropertyRecord final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.PropertyRecord) */ { public: inline PropertyRecord() : PropertyRecord(nullptr) {} @@ -323,7 +323,7 @@ class PropertyRecord final : }; // ------------------------------------------------------------------- -class ContourPolygon_PolygonPart final : +class ODBDESIGN_EXPORT ContourPolygon_PolygonPart final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.ContourPolygon.PolygonPart) */ { public: inline ContourPolygon_PolygonPart() : ContourPolygon_PolygonPart(nullptr) {} @@ -581,7 +581,7 @@ class ContourPolygon_PolygonPart final : }; // ------------------------------------------------------------------- -class ContourPolygon final : +class ODBDESIGN_EXPORT ContourPolygon final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.ContourPolygon) */ { public: inline ContourPolygon() : ContourPolygon(nullptr) {} diff --git a/OdbDesignLib/ProtoBuf/component.pb.h b/OdbDesignLib/ProtoBuf/component.pb.h index 46d2a6bd..6f2265fb 100644 --- a/OdbDesignLib/ProtoBuf/component.pb.h +++ b/OdbDesignLib/ProtoBuf/component.pb.h @@ -35,7 +35,7 @@ #include "package.pb.h" // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_component_2eproto +#define PROTOBUF_INTERNAL_EXPORT_component_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -43,23 +43,23 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_component_2eproto { +struct ODBDESIGN_EXPORT TableStruct_component_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_component_2eproto; +ODBDESIGN_EXPORT 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_; +ODBDESIGN_EXPORT 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*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::ProductModel::Component* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Component>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { @@ -68,7 +68,7 @@ namespace ProductModel { // =================================================================== -class Component final : +class ODBDESIGN_EXPORT Component final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.ProductModel.Component) */ { public: inline Component() : Component(nullptr) {} diff --git a/OdbDesignLib/ProtoBuf/componentsfile.pb.h b/OdbDesignLib/ProtoBuf/componentsfile.pb.h index 57711ea9..4e799b65 100644 --- a/OdbDesignLib/ProtoBuf/componentsfile.pb.h +++ b/OdbDesignLib/ProtoBuf/componentsfile.pb.h @@ -37,7 +37,7 @@ #include "enums.pb.h" // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_componentsfile_2eproto +#define PROTOBUF_INTERNAL_EXPORT_componentsfile_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -45,49 +45,49 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_componentsfile_2eproto { +struct ODBDESIGN_EXPORT TableStruct_componentsfile_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_componentsfile_2eproto; +ODBDESIGN_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_componentsfile_2eproto; namespace Odb { namespace Lib { namespace Protobuf { class ComponentsFile; struct ComponentsFileDefaultTypeInternal; -extern ComponentsFileDefaultTypeInternal _ComponentsFile_default_instance_; +ODBDESIGN_EXPORT extern ComponentsFileDefaultTypeInternal _ComponentsFile_default_instance_; class ComponentsFile_BomDescriptionRecord; struct ComponentsFile_BomDescriptionRecordDefaultTypeInternal; -extern ComponentsFile_BomDescriptionRecordDefaultTypeInternal _ComponentsFile_BomDescriptionRecord_default_instance_; +ODBDESIGN_EXPORT extern ComponentsFile_BomDescriptionRecordDefaultTypeInternal _ComponentsFile_BomDescriptionRecord_default_instance_; class ComponentsFile_BomDescriptionRecordsByCpnEntry_DoNotUse; struct ComponentsFile_BomDescriptionRecordsByCpnEntry_DoNotUseDefaultTypeInternal; -extern ComponentsFile_BomDescriptionRecordsByCpnEntry_DoNotUseDefaultTypeInternal _ComponentsFile_BomDescriptionRecordsByCpnEntry_DoNotUse_default_instance_; +ODBDESIGN_EXPORT extern ComponentsFile_BomDescriptionRecordsByCpnEntry_DoNotUseDefaultTypeInternal _ComponentsFile_BomDescriptionRecordsByCpnEntry_DoNotUse_default_instance_; class ComponentsFile_ComponentRecord; struct ComponentsFile_ComponentRecordDefaultTypeInternal; -extern ComponentsFile_ComponentRecordDefaultTypeInternal _ComponentsFile_ComponentRecord_default_instance_; +ODBDESIGN_EXPORT extern ComponentsFile_ComponentRecordDefaultTypeInternal _ComponentsFile_ComponentRecord_default_instance_; class ComponentsFile_ComponentRecord_AttributeLookupTableEntry_DoNotUse; struct ComponentsFile_ComponentRecord_AttributeLookupTableEntry_DoNotUseDefaultTypeInternal; -extern ComponentsFile_ComponentRecord_AttributeLookupTableEntry_DoNotUseDefaultTypeInternal _ComponentsFile_ComponentRecord_AttributeLookupTableEntry_DoNotUse_default_instance_; +ODBDESIGN_EXPORT extern ComponentsFile_ComponentRecord_AttributeLookupTableEntry_DoNotUseDefaultTypeInternal _ComponentsFile_ComponentRecord_AttributeLookupTableEntry_DoNotUse_default_instance_; class ComponentsFile_ComponentRecord_ToeprintRecord; struct ComponentsFile_ComponentRecord_ToeprintRecordDefaultTypeInternal; -extern ComponentsFile_ComponentRecord_ToeprintRecordDefaultTypeInternal _ComponentsFile_ComponentRecord_ToeprintRecord_default_instance_; +ODBDESIGN_EXPORT extern ComponentsFile_ComponentRecord_ToeprintRecordDefaultTypeInternal _ComponentsFile_ComponentRecord_ToeprintRecord_default_instance_; class ComponentsFile_ComponentRecordsByNameEntry_DoNotUse; struct ComponentsFile_ComponentRecordsByNameEntry_DoNotUseDefaultTypeInternal; -extern ComponentsFile_ComponentRecordsByNameEntry_DoNotUseDefaultTypeInternal _ComponentsFile_ComponentRecordsByNameEntry_DoNotUse_default_instance_; +ODBDESIGN_EXPORT extern ComponentsFile_ComponentRecordsByNameEntry_DoNotUseDefaultTypeInternal _ComponentsFile_ComponentRecordsByNameEntry_DoNotUse_default_instance_; class ComponentsFile_PropertyRecordsByNameEntry_DoNotUse; struct ComponentsFile_PropertyRecordsByNameEntry_DoNotUseDefaultTypeInternal; -extern ComponentsFile_PropertyRecordsByNameEntry_DoNotUseDefaultTypeInternal _ComponentsFile_PropertyRecordsByNameEntry_DoNotUse_default_instance_; +ODBDESIGN_EXPORT extern ComponentsFile_PropertyRecordsByNameEntry_DoNotUseDefaultTypeInternal _ComponentsFile_PropertyRecordsByNameEntry_DoNotUse_default_instance_; } // namespace Protobuf } // namespace Lib } // namespace Odb PROTOBUF_NAMESPACE_OPEN -template<> ::Odb::Lib::Protobuf::ComponentsFile* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ComponentsFile>(Arena*); -template<> ::Odb::Lib::Protobuf::ComponentsFile_BomDescriptionRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ComponentsFile_BomDescriptionRecord>(Arena*); -template<> ::Odb::Lib::Protobuf::ComponentsFile_BomDescriptionRecordsByCpnEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ComponentsFile_BomDescriptionRecordsByCpnEntry_DoNotUse>(Arena*); -template<> ::Odb::Lib::Protobuf::ComponentsFile_ComponentRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ComponentsFile_ComponentRecord>(Arena*); -template<> ::Odb::Lib::Protobuf::ComponentsFile_ComponentRecord_AttributeLookupTableEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ComponentsFile_ComponentRecord_AttributeLookupTableEntry_DoNotUse>(Arena*); -template<> ::Odb::Lib::Protobuf::ComponentsFile_ComponentRecord_ToeprintRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ComponentsFile_ComponentRecord_ToeprintRecord>(Arena*); -template<> ::Odb::Lib::Protobuf::ComponentsFile_ComponentRecordsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ComponentsFile_ComponentRecordsByNameEntry_DoNotUse>(Arena*); -template<> ::Odb::Lib::Protobuf::ComponentsFile_PropertyRecordsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ComponentsFile_PropertyRecordsByNameEntry_DoNotUse>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::ComponentsFile* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ComponentsFile>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::ComponentsFile_BomDescriptionRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ComponentsFile_BomDescriptionRecord>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::ComponentsFile_BomDescriptionRecordsByCpnEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ComponentsFile_BomDescriptionRecordsByCpnEntry_DoNotUse>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::ComponentsFile_ComponentRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ComponentsFile_ComponentRecord>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::ComponentsFile_ComponentRecord_AttributeLookupTableEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ComponentsFile_ComponentRecord_AttributeLookupTableEntry_DoNotUse>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::ComponentsFile_ComponentRecord_ToeprintRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ComponentsFile_ComponentRecord_ToeprintRecord>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::ComponentsFile_ComponentRecordsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ComponentsFile_ComponentRecordsByNameEntry_DoNotUse>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::ComponentsFile_PropertyRecordsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ComponentsFile_PropertyRecordsByNameEntry_DoNotUse>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { @@ -95,7 +95,7 @@ namespace Protobuf { // =================================================================== -class ComponentsFile_ComponentRecord_ToeprintRecord final : +class ODBDESIGN_EXPORT ComponentsFile_ComponentRecord_ToeprintRecord final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.ComponentsFile.ComponentRecord.ToeprintRecord) */ { public: inline ComponentsFile_ComponentRecord_ToeprintRecord() : ComponentsFile_ComponentRecord_ToeprintRecord(nullptr) {} @@ -386,7 +386,7 @@ class ComponentsFile_ComponentRecord_AttributeLookupTableEntry_DoNotUse : public // ------------------------------------------------------------------- -class ComponentsFile_ComponentRecord final : +class ODBDESIGN_EXPORT ComponentsFile_ComponentRecord final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.ComponentsFile.ComponentRecord) */ { public: inline ComponentsFile_ComponentRecord() : ComponentsFile_ComponentRecord(nullptr) {} @@ -756,7 +756,7 @@ class ComponentsFile_ComponentRecord final : }; // ------------------------------------------------------------------- -class ComponentsFile_BomDescriptionRecord final : +class ODBDESIGN_EXPORT ComponentsFile_BomDescriptionRecord final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.ComponentsFile.BomDescriptionRecord) */ { public: inline ComponentsFile_BomDescriptionRecord() : ComponentsFile_BomDescriptionRecord(nullptr) {} @@ -1138,7 +1138,7 @@ class ComponentsFile_BomDescriptionRecordsByCpnEntry_DoNotUse : public ::PROTOBU // ------------------------------------------------------------------- -class ComponentsFile final : +class ODBDESIGN_EXPORT ComponentsFile final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.ComponentsFile) */ { public: inline ComponentsFile() : ComponentsFile(nullptr) {} diff --git a/OdbDesignLib/ProtoBuf/design.pb.h b/OdbDesignLib/ProtoBuf/design.pb.h index 880e65fb..5897df72 100644 --- a/OdbDesignLib/ProtoBuf/design.pb.h +++ b/OdbDesignLib/ProtoBuf/design.pb.h @@ -40,7 +40,7 @@ #include "part.pb.h" // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_design_2eproto +#define PROTOBUF_INTERNAL_EXPORT_design_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -48,39 +48,39 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_design_2eproto { +struct ODBDESIGN_EXPORT TableStruct_design_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_design_2eproto; +ODBDESIGN_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_design_2eproto; namespace Odb { namespace Lib { namespace Protobuf { namespace ProductModel { class Design; struct DesignDefaultTypeInternal; -extern DesignDefaultTypeInternal _Design_default_instance_; +ODBDESIGN_EXPORT extern DesignDefaultTypeInternal _Design_default_instance_; class Design_ComponentsByNameEntry_DoNotUse; struct Design_ComponentsByNameEntry_DoNotUseDefaultTypeInternal; -extern Design_ComponentsByNameEntry_DoNotUseDefaultTypeInternal _Design_ComponentsByNameEntry_DoNotUse_default_instance_; +ODBDESIGN_EXPORT 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_; +ODBDESIGN_EXPORT 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_; +ODBDESIGN_EXPORT 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_; +ODBDESIGN_EXPORT extern Design_PartsByNameEntry_DoNotUseDefaultTypeInternal _Design_PartsByNameEntry_DoNotUse_default_instance_; } // namespace ProductModel } // namespace Protobuf } // namespace Lib } // namespace Odb PROTOBUF_NAMESPACE_OPEN -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*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::ProductModel::Design* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Design>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::ProductModel::Design_ComponentsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Design_ComponentsByNameEntry_DoNotUse>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::ProductModel::Design_NetsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Design_NetsByNameEntry_DoNotUse>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::ProductModel::Design_PackagesByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Design_PackagesByNameEntry_DoNotUse>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::ProductModel::Design_PartsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Design_PartsByNameEntry_DoNotUse>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { @@ -193,7 +193,7 @@ class Design_PartsByNameEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::interna // ------------------------------------------------------------------- -class Design final : +class ODBDESIGN_EXPORT Design final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.ProductModel.Design) */ { public: inline Design() : Design(nullptr) {} diff --git a/OdbDesignLib/ProtoBuf/edadatafile.pb.h b/OdbDesignLib/ProtoBuf/edadatafile.pb.h index 72b8f4f2..7d3f57fa 100644 --- a/OdbDesignLib/ProtoBuf/edadatafile.pb.h +++ b/OdbDesignLib/ProtoBuf/edadatafile.pb.h @@ -38,7 +38,7 @@ #include "enums.pb.h" // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_edadatafile_2eproto +#define PROTOBUF_INTERNAL_EXPORT_edadatafile_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -46,69 +46,69 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_edadatafile_2eproto { +struct ODBDESIGN_EXPORT TableStruct_edadatafile_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_edadatafile_2eproto; +ODBDESIGN_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_edadatafile_2eproto; namespace Odb { namespace Lib { namespace Protobuf { class EdaDataFile; struct EdaDataFileDefaultTypeInternal; -extern EdaDataFileDefaultTypeInternal _EdaDataFile_default_instance_; +ODBDESIGN_EXPORT extern EdaDataFileDefaultTypeInternal _EdaDataFile_default_instance_; class EdaDataFile_FeatureGroupRecord; struct EdaDataFile_FeatureGroupRecordDefaultTypeInternal; -extern EdaDataFile_FeatureGroupRecordDefaultTypeInternal _EdaDataFile_FeatureGroupRecord_default_instance_; +ODBDESIGN_EXPORT extern EdaDataFile_FeatureGroupRecordDefaultTypeInternal _EdaDataFile_FeatureGroupRecord_default_instance_; class EdaDataFile_FeatureIdRecord; struct EdaDataFile_FeatureIdRecordDefaultTypeInternal; -extern EdaDataFile_FeatureIdRecordDefaultTypeInternal _EdaDataFile_FeatureIdRecord_default_instance_; +ODBDESIGN_EXPORT extern EdaDataFile_FeatureIdRecordDefaultTypeInternal _EdaDataFile_FeatureIdRecord_default_instance_; class EdaDataFile_NetRecord; struct EdaDataFile_NetRecordDefaultTypeInternal; -extern EdaDataFile_NetRecordDefaultTypeInternal _EdaDataFile_NetRecord_default_instance_; +ODBDESIGN_EXPORT extern EdaDataFile_NetRecordDefaultTypeInternal _EdaDataFile_NetRecord_default_instance_; class EdaDataFile_NetRecord_AttributeLookupTableEntry_DoNotUse; struct EdaDataFile_NetRecord_AttributeLookupTableEntry_DoNotUseDefaultTypeInternal; -extern EdaDataFile_NetRecord_AttributeLookupTableEntry_DoNotUseDefaultTypeInternal _EdaDataFile_NetRecord_AttributeLookupTableEntry_DoNotUse_default_instance_; +ODBDESIGN_EXPORT extern EdaDataFile_NetRecord_AttributeLookupTableEntry_DoNotUseDefaultTypeInternal _EdaDataFile_NetRecord_AttributeLookupTableEntry_DoNotUse_default_instance_; class EdaDataFile_NetRecord_SubnetRecord; struct EdaDataFile_NetRecord_SubnetRecordDefaultTypeInternal; -extern EdaDataFile_NetRecord_SubnetRecordDefaultTypeInternal _EdaDataFile_NetRecord_SubnetRecord_default_instance_; +ODBDESIGN_EXPORT extern EdaDataFile_NetRecord_SubnetRecordDefaultTypeInternal _EdaDataFile_NetRecord_SubnetRecord_default_instance_; class EdaDataFile_NetRecordsByNameEntry_DoNotUse; struct EdaDataFile_NetRecordsByNameEntry_DoNotUseDefaultTypeInternal; -extern EdaDataFile_NetRecordsByNameEntry_DoNotUseDefaultTypeInternal _EdaDataFile_NetRecordsByNameEntry_DoNotUse_default_instance_; +ODBDESIGN_EXPORT extern EdaDataFile_NetRecordsByNameEntry_DoNotUseDefaultTypeInternal _EdaDataFile_NetRecordsByNameEntry_DoNotUse_default_instance_; class EdaDataFile_PackageRecord; struct EdaDataFile_PackageRecordDefaultTypeInternal; -extern EdaDataFile_PackageRecordDefaultTypeInternal _EdaDataFile_PackageRecord_default_instance_; +ODBDESIGN_EXPORT extern EdaDataFile_PackageRecordDefaultTypeInternal _EdaDataFile_PackageRecord_default_instance_; class EdaDataFile_PackageRecord_AttributeLookupTableEntry_DoNotUse; struct EdaDataFile_PackageRecord_AttributeLookupTableEntry_DoNotUseDefaultTypeInternal; -extern EdaDataFile_PackageRecord_AttributeLookupTableEntry_DoNotUseDefaultTypeInternal _EdaDataFile_PackageRecord_AttributeLookupTableEntry_DoNotUse_default_instance_; +ODBDESIGN_EXPORT extern EdaDataFile_PackageRecord_AttributeLookupTableEntry_DoNotUseDefaultTypeInternal _EdaDataFile_PackageRecord_AttributeLookupTableEntry_DoNotUse_default_instance_; class EdaDataFile_PackageRecord_OutlineRecord; struct EdaDataFile_PackageRecord_OutlineRecordDefaultTypeInternal; -extern EdaDataFile_PackageRecord_OutlineRecordDefaultTypeInternal _EdaDataFile_PackageRecord_OutlineRecord_default_instance_; +ODBDESIGN_EXPORT extern EdaDataFile_PackageRecord_OutlineRecordDefaultTypeInternal _EdaDataFile_PackageRecord_OutlineRecord_default_instance_; class EdaDataFile_PackageRecord_PinRecord; struct EdaDataFile_PackageRecord_PinRecordDefaultTypeInternal; -extern EdaDataFile_PackageRecord_PinRecordDefaultTypeInternal _EdaDataFile_PackageRecord_PinRecord_default_instance_; +ODBDESIGN_EXPORT extern EdaDataFile_PackageRecord_PinRecordDefaultTypeInternal _EdaDataFile_PackageRecord_PinRecord_default_instance_; class EdaDataFile_PackageRecord_PinRecordsByNameEntry_DoNotUse; struct EdaDataFile_PackageRecord_PinRecordsByNameEntry_DoNotUseDefaultTypeInternal; -extern EdaDataFile_PackageRecord_PinRecordsByNameEntry_DoNotUseDefaultTypeInternal _EdaDataFile_PackageRecord_PinRecordsByNameEntry_DoNotUse_default_instance_; +ODBDESIGN_EXPORT extern EdaDataFile_PackageRecord_PinRecordsByNameEntry_DoNotUseDefaultTypeInternal _EdaDataFile_PackageRecord_PinRecordsByNameEntry_DoNotUse_default_instance_; class EdaDataFile_PackageRecordsByNameEntry_DoNotUse; struct EdaDataFile_PackageRecordsByNameEntry_DoNotUseDefaultTypeInternal; -extern EdaDataFile_PackageRecordsByNameEntry_DoNotUseDefaultTypeInternal _EdaDataFile_PackageRecordsByNameEntry_DoNotUse_default_instance_; +ODBDESIGN_EXPORT extern EdaDataFile_PackageRecordsByNameEntry_DoNotUseDefaultTypeInternal _EdaDataFile_PackageRecordsByNameEntry_DoNotUse_default_instance_; } // namespace Protobuf } // namespace Lib } // namespace Odb PROTOBUF_NAMESPACE_OPEN -template<> ::Odb::Lib::Protobuf::EdaDataFile* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile>(Arena*); -template<> ::Odb::Lib::Protobuf::EdaDataFile_FeatureGroupRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_FeatureGroupRecord>(Arena*); -template<> ::Odb::Lib::Protobuf::EdaDataFile_FeatureIdRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_FeatureIdRecord>(Arena*); -template<> ::Odb::Lib::Protobuf::EdaDataFile_NetRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_NetRecord>(Arena*); -template<> ::Odb::Lib::Protobuf::EdaDataFile_NetRecord_AttributeLookupTableEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_NetRecord_AttributeLookupTableEntry_DoNotUse>(Arena*); -template<> ::Odb::Lib::Protobuf::EdaDataFile_NetRecord_SubnetRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_NetRecord_SubnetRecord>(Arena*); -template<> ::Odb::Lib::Protobuf::EdaDataFile_NetRecordsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_NetRecordsByNameEntry_DoNotUse>(Arena*); -template<> ::Odb::Lib::Protobuf::EdaDataFile_PackageRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_PackageRecord>(Arena*); -template<> ::Odb::Lib::Protobuf::EdaDataFile_PackageRecord_AttributeLookupTableEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_PackageRecord_AttributeLookupTableEntry_DoNotUse>(Arena*); -template<> ::Odb::Lib::Protobuf::EdaDataFile_PackageRecord_OutlineRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_PackageRecord_OutlineRecord>(Arena*); -template<> ::Odb::Lib::Protobuf::EdaDataFile_PackageRecord_PinRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_PackageRecord_PinRecord>(Arena*); -template<> ::Odb::Lib::Protobuf::EdaDataFile_PackageRecord_PinRecordsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_PackageRecord_PinRecordsByNameEntry_DoNotUse>(Arena*); -template<> ::Odb::Lib::Protobuf::EdaDataFile_PackageRecordsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_PackageRecordsByNameEntry_DoNotUse>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::EdaDataFile* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::EdaDataFile_FeatureGroupRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_FeatureGroupRecord>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::EdaDataFile_FeatureIdRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_FeatureIdRecord>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::EdaDataFile_NetRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_NetRecord>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::EdaDataFile_NetRecord_AttributeLookupTableEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_NetRecord_AttributeLookupTableEntry_DoNotUse>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::EdaDataFile_NetRecord_SubnetRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_NetRecord_SubnetRecord>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::EdaDataFile_NetRecordsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_NetRecordsByNameEntry_DoNotUse>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::EdaDataFile_PackageRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_PackageRecord>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::EdaDataFile_PackageRecord_AttributeLookupTableEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_PackageRecord_AttributeLookupTableEntry_DoNotUse>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::EdaDataFile_PackageRecord_OutlineRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_PackageRecord_OutlineRecord>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::EdaDataFile_PackageRecord_PinRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_PackageRecord_PinRecord>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::EdaDataFile_PackageRecord_PinRecordsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_PackageRecord_PinRecordsByNameEntry_DoNotUse>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::EdaDataFile_PackageRecordsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::EdaDataFile_PackageRecordsByNameEntry_DoNotUse>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { @@ -121,12 +121,12 @@ enum EdaDataFile_FeatureIdRecord_Type : int { EdaDataFile_FeatureIdRecord_Type_EdaDataFile_FeatureIdRecord_Type_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), EdaDataFile_FeatureIdRecord_Type_EdaDataFile_FeatureIdRecord_Type_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; -bool EdaDataFile_FeatureIdRecord_Type_IsValid(int value); +ODBDESIGN_EXPORT bool EdaDataFile_FeatureIdRecord_Type_IsValid(int value); constexpr EdaDataFile_FeatureIdRecord_Type EdaDataFile_FeatureIdRecord_Type_Type_MIN = EdaDataFile_FeatureIdRecord_Type_COPPER; constexpr EdaDataFile_FeatureIdRecord_Type EdaDataFile_FeatureIdRecord_Type_Type_MAX = EdaDataFile_FeatureIdRecord_Type_HOLE; constexpr int EdaDataFile_FeatureIdRecord_Type_Type_ARRAYSIZE = EdaDataFile_FeatureIdRecord_Type_Type_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* EdaDataFile_FeatureIdRecord_Type_descriptor(); +ODBDESIGN_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* EdaDataFile_FeatureIdRecord_Type_descriptor(); template inline const std::string& EdaDataFile_FeatureIdRecord_Type_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -148,12 +148,12 @@ enum EdaDataFile_NetRecord_SubnetRecord_Type : int { EdaDataFile_NetRecord_SubnetRecord_Type_EdaDataFile_NetRecord_SubnetRecord_Type_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), EdaDataFile_NetRecord_SubnetRecord_Type_EdaDataFile_NetRecord_SubnetRecord_Type_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; -bool EdaDataFile_NetRecord_SubnetRecord_Type_IsValid(int value); +ODBDESIGN_EXPORT bool EdaDataFile_NetRecord_SubnetRecord_Type_IsValid(int value); constexpr EdaDataFile_NetRecord_SubnetRecord_Type EdaDataFile_NetRecord_SubnetRecord_Type_Type_MIN = EdaDataFile_NetRecord_SubnetRecord_Type_VIA; constexpr EdaDataFile_NetRecord_SubnetRecord_Type EdaDataFile_NetRecord_SubnetRecord_Type_Type_MAX = EdaDataFile_NetRecord_SubnetRecord_Type_TOEPRINT; constexpr int EdaDataFile_NetRecord_SubnetRecord_Type_Type_ARRAYSIZE = EdaDataFile_NetRecord_SubnetRecord_Type_Type_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* EdaDataFile_NetRecord_SubnetRecord_Type_descriptor(); +ODBDESIGN_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* EdaDataFile_NetRecord_SubnetRecord_Type_descriptor(); template inline const std::string& EdaDataFile_NetRecord_SubnetRecord_Type_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -173,12 +173,12 @@ enum EdaDataFile_NetRecord_SubnetRecord_FillType : int { EdaDataFile_NetRecord_SubnetRecord_FillType_EdaDataFile_NetRecord_SubnetRecord_FillType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), EdaDataFile_NetRecord_SubnetRecord_FillType_EdaDataFile_NetRecord_SubnetRecord_FillType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; -bool EdaDataFile_NetRecord_SubnetRecord_FillType_IsValid(int value); +ODBDESIGN_EXPORT bool EdaDataFile_NetRecord_SubnetRecord_FillType_IsValid(int value); constexpr EdaDataFile_NetRecord_SubnetRecord_FillType EdaDataFile_NetRecord_SubnetRecord_FillType_FillType_MIN = EdaDataFile_NetRecord_SubnetRecord_FillType_SOLID; constexpr EdaDataFile_NetRecord_SubnetRecord_FillType EdaDataFile_NetRecord_SubnetRecord_FillType_FillType_MAX = EdaDataFile_NetRecord_SubnetRecord_FillType_OUTLINE; constexpr int EdaDataFile_NetRecord_SubnetRecord_FillType_FillType_ARRAYSIZE = EdaDataFile_NetRecord_SubnetRecord_FillType_FillType_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* EdaDataFile_NetRecord_SubnetRecord_FillType_descriptor(); +ODBDESIGN_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* EdaDataFile_NetRecord_SubnetRecord_FillType_descriptor(); template inline const std::string& EdaDataFile_NetRecord_SubnetRecord_FillType_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -200,12 +200,12 @@ enum EdaDataFile_NetRecord_SubnetRecord_CutoutType : int { EdaDataFile_NetRecord_SubnetRecord_CutoutType_EdaDataFile_NetRecord_SubnetRecord_CutoutType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), EdaDataFile_NetRecord_SubnetRecord_CutoutType_EdaDataFile_NetRecord_SubnetRecord_CutoutType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; -bool EdaDataFile_NetRecord_SubnetRecord_CutoutType_IsValid(int value); +ODBDESIGN_EXPORT bool EdaDataFile_NetRecord_SubnetRecord_CutoutType_IsValid(int value); constexpr EdaDataFile_NetRecord_SubnetRecord_CutoutType EdaDataFile_NetRecord_SubnetRecord_CutoutType_CutoutType_MIN = EdaDataFile_NetRecord_SubnetRecord_CutoutType_CIRCLE; constexpr EdaDataFile_NetRecord_SubnetRecord_CutoutType EdaDataFile_NetRecord_SubnetRecord_CutoutType_CutoutType_MAX = EdaDataFile_NetRecord_SubnetRecord_CutoutType_EXACT; constexpr int EdaDataFile_NetRecord_SubnetRecord_CutoutType_CutoutType_ARRAYSIZE = EdaDataFile_NetRecord_SubnetRecord_CutoutType_CutoutType_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* EdaDataFile_NetRecord_SubnetRecord_CutoutType_descriptor(); +ODBDESIGN_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* EdaDataFile_NetRecord_SubnetRecord_CutoutType_descriptor(); template inline const std::string& EdaDataFile_NetRecord_SubnetRecord_CutoutType_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -227,12 +227,12 @@ enum EdaDataFile_PackageRecord_OutlineRecord_Type : int { EdaDataFile_PackageRecord_OutlineRecord_Type_EdaDataFile_PackageRecord_OutlineRecord_Type_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), EdaDataFile_PackageRecord_OutlineRecord_Type_EdaDataFile_PackageRecord_OutlineRecord_Type_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; -bool EdaDataFile_PackageRecord_OutlineRecord_Type_IsValid(int value); +ODBDESIGN_EXPORT bool EdaDataFile_PackageRecord_OutlineRecord_Type_IsValid(int value); constexpr EdaDataFile_PackageRecord_OutlineRecord_Type EdaDataFile_PackageRecord_OutlineRecord_Type_Type_MIN = EdaDataFile_PackageRecord_OutlineRecord_Type_Rectangle; constexpr EdaDataFile_PackageRecord_OutlineRecord_Type EdaDataFile_PackageRecord_OutlineRecord_Type_Type_MAX = EdaDataFile_PackageRecord_OutlineRecord_Type_Contour; constexpr int EdaDataFile_PackageRecord_OutlineRecord_Type_Type_ARRAYSIZE = EdaDataFile_PackageRecord_OutlineRecord_Type_Type_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* EdaDataFile_PackageRecord_OutlineRecord_Type_descriptor(); +ODBDESIGN_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* EdaDataFile_PackageRecord_OutlineRecord_Type_descriptor(); template inline const std::string& EdaDataFile_PackageRecord_OutlineRecord_Type_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -253,12 +253,12 @@ enum EdaDataFile_PackageRecord_PinRecord_Type : int { EdaDataFile_PackageRecord_PinRecord_Type_EdaDataFile_PackageRecord_PinRecord_Type_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), EdaDataFile_PackageRecord_PinRecord_Type_EdaDataFile_PackageRecord_PinRecord_Type_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; -bool EdaDataFile_PackageRecord_PinRecord_Type_IsValid(int value); +ODBDESIGN_EXPORT bool EdaDataFile_PackageRecord_PinRecord_Type_IsValid(int value); constexpr EdaDataFile_PackageRecord_PinRecord_Type EdaDataFile_PackageRecord_PinRecord_Type_Type_MIN = EdaDataFile_PackageRecord_PinRecord_Type_ThroughHole; constexpr EdaDataFile_PackageRecord_PinRecord_Type EdaDataFile_PackageRecord_PinRecord_Type_Type_MAX = EdaDataFile_PackageRecord_PinRecord_Type_Surface; constexpr int EdaDataFile_PackageRecord_PinRecord_Type_Type_ARRAYSIZE = EdaDataFile_PackageRecord_PinRecord_Type_Type_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* EdaDataFile_PackageRecord_PinRecord_Type_descriptor(); +ODBDESIGN_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* EdaDataFile_PackageRecord_PinRecord_Type_descriptor(); template inline const std::string& EdaDataFile_PackageRecord_PinRecord_Type_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -279,12 +279,12 @@ enum EdaDataFile_PackageRecord_PinRecord_ElectricalType : int { EdaDataFile_PackageRecord_PinRecord_ElectricalType_EdaDataFile_PackageRecord_PinRecord_ElectricalType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), EdaDataFile_PackageRecord_PinRecord_ElectricalType_EdaDataFile_PackageRecord_PinRecord_ElectricalType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; -bool EdaDataFile_PackageRecord_PinRecord_ElectricalType_IsValid(int value); +ODBDESIGN_EXPORT bool EdaDataFile_PackageRecord_PinRecord_ElectricalType_IsValid(int value); constexpr EdaDataFile_PackageRecord_PinRecord_ElectricalType EdaDataFile_PackageRecord_PinRecord_ElectricalType_ElectricalType_MIN = EdaDataFile_PackageRecord_PinRecord_ElectricalType_Electrical; constexpr EdaDataFile_PackageRecord_PinRecord_ElectricalType EdaDataFile_PackageRecord_PinRecord_ElectricalType_ElectricalType_MAX = EdaDataFile_PackageRecord_PinRecord_ElectricalType_Undefined; constexpr int EdaDataFile_PackageRecord_PinRecord_ElectricalType_ElectricalType_ARRAYSIZE = EdaDataFile_PackageRecord_PinRecord_ElectricalType_ElectricalType_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* EdaDataFile_PackageRecord_PinRecord_ElectricalType_descriptor(); +ODBDESIGN_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* EdaDataFile_PackageRecord_PinRecord_ElectricalType_descriptor(); template inline const std::string& EdaDataFile_PackageRecord_PinRecord_ElectricalType_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -310,12 +310,12 @@ enum EdaDataFile_PackageRecord_PinRecord_MountType : int { EdaDataFile_PackageRecord_PinRecord_MountType_EdaDataFile_PackageRecord_PinRecord_MountType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), EdaDataFile_PackageRecord_PinRecord_MountType_EdaDataFile_PackageRecord_PinRecord_MountType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; -bool EdaDataFile_PackageRecord_PinRecord_MountType_IsValid(int value); +ODBDESIGN_EXPORT bool EdaDataFile_PackageRecord_PinRecord_MountType_IsValid(int value); constexpr EdaDataFile_PackageRecord_PinRecord_MountType EdaDataFile_PackageRecord_PinRecord_MountType_MountType_MIN = EdaDataFile_PackageRecord_PinRecord_MountType_Smt; constexpr EdaDataFile_PackageRecord_PinRecord_MountType EdaDataFile_PackageRecord_PinRecord_MountType_MountType_MAX = EdaDataFile_PackageRecord_PinRecord_MountType_MT_Undefined; constexpr int EdaDataFile_PackageRecord_PinRecord_MountType_MountType_ARRAYSIZE = EdaDataFile_PackageRecord_PinRecord_MountType_MountType_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* EdaDataFile_PackageRecord_PinRecord_MountType_descriptor(); +ODBDESIGN_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* EdaDataFile_PackageRecord_PinRecord_MountType_descriptor(); template inline const std::string& EdaDataFile_PackageRecord_PinRecord_MountType_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -331,7 +331,7 @@ inline bool EdaDataFile_PackageRecord_PinRecord_MountType_Parse( } // =================================================================== -class EdaDataFile_FeatureIdRecord final : +class ODBDESIGN_EXPORT EdaDataFile_FeatureIdRecord final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.EdaDataFile.FeatureIdRecord) */ { public: inline EdaDataFile_FeatureIdRecord() : EdaDataFile_FeatureIdRecord(nullptr) {} @@ -546,7 +546,7 @@ class EdaDataFile_FeatureIdRecord final : }; // ------------------------------------------------------------------- -class EdaDataFile_NetRecord_SubnetRecord final : +class ODBDESIGN_EXPORT EdaDataFile_NetRecord_SubnetRecord final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.EdaDataFile.NetRecord.SubnetRecord) */ { public: inline EdaDataFile_NetRecord_SubnetRecord() : EdaDataFile_NetRecord_SubnetRecord(nullptr) {} @@ -950,7 +950,7 @@ class EdaDataFile_NetRecord_AttributeLookupTableEntry_DoNotUse : public ::PROTOB // ------------------------------------------------------------------- -class EdaDataFile_NetRecord final : +class ODBDESIGN_EXPORT EdaDataFile_NetRecord final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.EdaDataFile.NetRecord) */ { public: inline EdaDataFile_NetRecord() : EdaDataFile_NetRecord(nullptr) {} @@ -1264,7 +1264,7 @@ class EdaDataFile_PackageRecord_AttributeLookupTableEntry_DoNotUse : public ::PR // ------------------------------------------------------------------- -class EdaDataFile_PackageRecord_OutlineRecord final : +class ODBDESIGN_EXPORT EdaDataFile_PackageRecord_OutlineRecord final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.EdaDataFile.PackageRecord.OutlineRecord) */ { public: inline EdaDataFile_PackageRecord_OutlineRecord() : EdaDataFile_PackageRecord_OutlineRecord(nullptr) {} @@ -1591,7 +1591,7 @@ class EdaDataFile_PackageRecord_OutlineRecord final : }; // ------------------------------------------------------------------- -class EdaDataFile_PackageRecord_PinRecord final : +class ODBDESIGN_EXPORT EdaDataFile_PackageRecord_PinRecord final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.EdaDataFile.PackageRecord.PinRecord) */ { public: inline EdaDataFile_PackageRecord_PinRecord() : EdaDataFile_PackageRecord_PinRecord(nullptr) {} @@ -1975,7 +1975,7 @@ class EdaDataFile_PackageRecord_PinRecord final : }; // ------------------------------------------------------------------- -class EdaDataFile_PackageRecord final : +class ODBDESIGN_EXPORT EdaDataFile_PackageRecord final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.EdaDataFile.PackageRecord) */ { public: inline EdaDataFile_PackageRecord() : EdaDataFile_PackageRecord(nullptr) {} @@ -2339,7 +2339,7 @@ class EdaDataFile_PackageRecord final : }; // ------------------------------------------------------------------- -class EdaDataFile_FeatureGroupRecord final : +class ODBDESIGN_EXPORT EdaDataFile_FeatureGroupRecord final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.EdaDataFile.FeatureGroupRecord) */ { public: inline EdaDataFile_FeatureGroupRecord() : EdaDataFile_FeatureGroupRecord(nullptr) {} @@ -2589,7 +2589,7 @@ class EdaDataFile_PackageRecordsByNameEntry_DoNotUse : public ::PROTOBUF_NAMESPA // ------------------------------------------------------------------- -class EdaDataFile final : +class ODBDESIGN_EXPORT EdaDataFile final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.EdaDataFile) */ { public: inline EdaDataFile() : EdaDataFile(nullptr) {} diff --git a/OdbDesignLib/ProtoBuf/enums.pb.h b/OdbDesignLib/ProtoBuf/enums.pb.h index 3c7ce6c4..7e4f73a8 100644 --- a/OdbDesignLib/ProtoBuf/enums.pb.h +++ b/OdbDesignLib/ProtoBuf/enums.pb.h @@ -31,7 +31,7 @@ #include // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_enums_2eproto +#define PROTOBUF_INTERNAL_EXPORT_enums_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -39,10 +39,10 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_enums_2eproto { +struct ODBDESIGN_EXPORT TableStruct_enums_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_enums_2eproto; +ODBDESIGN_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_enums_2eproto; PROTOBUF_NAMESPACE_OPEN PROTOBUF_NAMESPACE_CLOSE namespace Odb { @@ -56,12 +56,12 @@ enum BoardSide : int { BoardSide_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), BoardSide_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; -bool BoardSide_IsValid(int value); +ODBDESIGN_EXPORT bool BoardSide_IsValid(int value); constexpr BoardSide BoardSide_MIN = BsNone; constexpr BoardSide BoardSide_MAX = Bottom; constexpr int BoardSide_ARRAYSIZE = BoardSide_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* BoardSide_descriptor(); +ODBDESIGN_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* BoardSide_descriptor(); template inline const std::string& BoardSide_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -81,12 +81,12 @@ enum LineShape : int { LineShape_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), LineShape_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; -bool LineShape_IsValid(int value); +ODBDESIGN_EXPORT bool LineShape_IsValid(int value); constexpr LineShape LineShape_MIN = Square; constexpr LineShape LineShape_MAX = Round; constexpr int LineShape_ARRAYSIZE = LineShape_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* LineShape_descriptor(); +ODBDESIGN_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* LineShape_descriptor(); template inline const std::string& LineShape_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -106,12 +106,12 @@ enum Polarity : int { Polarity_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), Polarity_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; -bool Polarity_IsValid(int value); +ODBDESIGN_EXPORT bool Polarity_IsValid(int value); constexpr Polarity Polarity_MIN = Positive; constexpr Polarity Polarity_MAX = Negative; constexpr int Polarity_ARRAYSIZE = Polarity_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Polarity_descriptor(); +ODBDESIGN_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Polarity_descriptor(); template inline const std::string& Polarity_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -132,12 +132,12 @@ enum UnitType : int { UnitType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), UnitType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; -bool UnitType_IsValid(int value); +ODBDESIGN_EXPORT bool UnitType_IsValid(int value); constexpr UnitType UnitType_MIN = None; constexpr UnitType UnitType_MAX = Imperial; constexpr int UnitType_ARRAYSIZE = UnitType_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* UnitType_descriptor(); +ODBDESIGN_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* UnitType_descriptor(); template inline const std::string& UnitType_Name(T enum_t_value) { static_assert(::std::is_same::value || diff --git a/OdbDesignLib/ProtoBuf/featuresfile.pb.h b/OdbDesignLib/ProtoBuf/featuresfile.pb.h index 5306847e..1451b7db 100644 --- a/OdbDesignLib/ProtoBuf/featuresfile.pb.h +++ b/OdbDesignLib/ProtoBuf/featuresfile.pb.h @@ -39,7 +39,7 @@ #include "symbolname.pb.h" // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_featuresfile_2eproto +#define PROTOBUF_INTERNAL_EXPORT_featuresfile_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -47,33 +47,33 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_featuresfile_2eproto { +struct ODBDESIGN_EXPORT TableStruct_featuresfile_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_featuresfile_2eproto; +ODBDESIGN_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_featuresfile_2eproto; namespace Odb { namespace Lib { namespace Protobuf { class FeaturesFile; struct FeaturesFileDefaultTypeInternal; -extern FeaturesFileDefaultTypeInternal _FeaturesFile_default_instance_; +ODBDESIGN_EXPORT extern FeaturesFileDefaultTypeInternal _FeaturesFile_default_instance_; class FeaturesFile_FeatureRecord; struct FeaturesFile_FeatureRecordDefaultTypeInternal; -extern FeaturesFile_FeatureRecordDefaultTypeInternal _FeaturesFile_FeatureRecord_default_instance_; +ODBDESIGN_EXPORT extern FeaturesFile_FeatureRecordDefaultTypeInternal _FeaturesFile_FeatureRecord_default_instance_; class FeaturesFile_FeatureRecord_AttributeLookupTableEntry_DoNotUse; struct FeaturesFile_FeatureRecord_AttributeLookupTableEntry_DoNotUseDefaultTypeInternal; -extern FeaturesFile_FeatureRecord_AttributeLookupTableEntry_DoNotUseDefaultTypeInternal _FeaturesFile_FeatureRecord_AttributeLookupTableEntry_DoNotUse_default_instance_; +ODBDESIGN_EXPORT extern FeaturesFile_FeatureRecord_AttributeLookupTableEntry_DoNotUseDefaultTypeInternal _FeaturesFile_FeatureRecord_AttributeLookupTableEntry_DoNotUse_default_instance_; class FeaturesFile_SymbolNamesByNameEntry_DoNotUse; struct FeaturesFile_SymbolNamesByNameEntry_DoNotUseDefaultTypeInternal; -extern FeaturesFile_SymbolNamesByNameEntry_DoNotUseDefaultTypeInternal _FeaturesFile_SymbolNamesByNameEntry_DoNotUse_default_instance_; +ODBDESIGN_EXPORT extern FeaturesFile_SymbolNamesByNameEntry_DoNotUseDefaultTypeInternal _FeaturesFile_SymbolNamesByNameEntry_DoNotUse_default_instance_; } // namespace Protobuf } // namespace Lib } // namespace Odb PROTOBUF_NAMESPACE_OPEN -template<> ::Odb::Lib::Protobuf::FeaturesFile* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::FeaturesFile>(Arena*); -template<> ::Odb::Lib::Protobuf::FeaturesFile_FeatureRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::FeaturesFile_FeatureRecord>(Arena*); -template<> ::Odb::Lib::Protobuf::FeaturesFile_FeatureRecord_AttributeLookupTableEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::FeaturesFile_FeatureRecord_AttributeLookupTableEntry_DoNotUse>(Arena*); -template<> ::Odb::Lib::Protobuf::FeaturesFile_SymbolNamesByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::FeaturesFile_SymbolNamesByNameEntry_DoNotUse>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::FeaturesFile* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::FeaturesFile>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::FeaturesFile_FeatureRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::FeaturesFile_FeatureRecord>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::FeaturesFile_FeatureRecord_AttributeLookupTableEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::FeaturesFile_FeatureRecord_AttributeLookupTableEntry_DoNotUse>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::FeaturesFile_SymbolNamesByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::FeaturesFile_SymbolNamesByNameEntry_DoNotUse>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { @@ -89,12 +89,12 @@ enum FeaturesFile_FeatureRecord_Type : int { FeaturesFile_FeatureRecord_Type_FeaturesFile_FeatureRecord_Type_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), FeaturesFile_FeatureRecord_Type_FeaturesFile_FeatureRecord_Type_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; -bool FeaturesFile_FeatureRecord_Type_IsValid(int value); +ODBDESIGN_EXPORT bool FeaturesFile_FeatureRecord_Type_IsValid(int value); constexpr FeaturesFile_FeatureRecord_Type FeaturesFile_FeatureRecord_Type_Type_MIN = FeaturesFile_FeatureRecord_Type_Arc; constexpr FeaturesFile_FeatureRecord_Type FeaturesFile_FeatureRecord_Type_Type_MAX = FeaturesFile_FeatureRecord_Type_Line; constexpr int FeaturesFile_FeatureRecord_Type_Type_ARRAYSIZE = FeaturesFile_FeatureRecord_Type_Type_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FeaturesFile_FeatureRecord_Type_descriptor(); +ODBDESIGN_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FeaturesFile_FeatureRecord_Type_descriptor(); template inline const std::string& FeaturesFile_FeatureRecord_Type_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -138,7 +138,7 @@ class FeaturesFile_FeatureRecord_AttributeLookupTableEntry_DoNotUse : public ::P // ------------------------------------------------------------------- -class FeaturesFile_FeatureRecord final : +class ODBDESIGN_EXPORT FeaturesFile_FeatureRecord final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.FeaturesFile.FeatureRecord) */ { public: inline FeaturesFile_FeatureRecord() : FeaturesFile_FeatureRecord(nullptr) {} @@ -806,7 +806,7 @@ class FeaturesFile_SymbolNamesByNameEntry_DoNotUse : public ::PROTOBUF_NAMESPACE // ------------------------------------------------------------------- -class FeaturesFile final : +class ODBDESIGN_EXPORT FeaturesFile final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.FeaturesFile) */ { public: inline FeaturesFile() : FeaturesFile(nullptr) {} diff --git a/OdbDesignLib/ProtoBuf/filearchive.pb.h b/OdbDesignLib/ProtoBuf/filearchive.pb.h index b7c96efd..91b2bc1d 100644 --- a/OdbDesignLib/ProtoBuf/filearchive.pb.h +++ b/OdbDesignLib/ProtoBuf/filearchive.pb.h @@ -41,7 +41,7 @@ #include "attrlistfile.pb.h" // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_filearchive_2eproto +#define PROTOBUF_INTERNAL_EXPORT_filearchive_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -49,29 +49,29 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_filearchive_2eproto { +struct ODBDESIGN_EXPORT TableStruct_filearchive_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_filearchive_2eproto; +ODBDESIGN_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_filearchive_2eproto; namespace Odb { namespace Lib { namespace Protobuf { class FileArchive; struct FileArchiveDefaultTypeInternal; -extern FileArchiveDefaultTypeInternal _FileArchive_default_instance_; +ODBDESIGN_EXPORT extern FileArchiveDefaultTypeInternal _FileArchive_default_instance_; class FileArchive_StepsByNameEntry_DoNotUse; struct FileArchive_StepsByNameEntry_DoNotUseDefaultTypeInternal; -extern FileArchive_StepsByNameEntry_DoNotUseDefaultTypeInternal _FileArchive_StepsByNameEntry_DoNotUse_default_instance_; +ODBDESIGN_EXPORT extern FileArchive_StepsByNameEntry_DoNotUseDefaultTypeInternal _FileArchive_StepsByNameEntry_DoNotUse_default_instance_; class FileArchive_SymbolsDirectoriesByNameEntry_DoNotUse; struct FileArchive_SymbolsDirectoriesByNameEntry_DoNotUseDefaultTypeInternal; -extern FileArchive_SymbolsDirectoriesByNameEntry_DoNotUseDefaultTypeInternal _FileArchive_SymbolsDirectoriesByNameEntry_DoNotUse_default_instance_; +ODBDESIGN_EXPORT extern FileArchive_SymbolsDirectoriesByNameEntry_DoNotUseDefaultTypeInternal _FileArchive_SymbolsDirectoriesByNameEntry_DoNotUse_default_instance_; } // namespace Protobuf } // namespace Lib } // namespace Odb PROTOBUF_NAMESPACE_OPEN -template<> ::Odb::Lib::Protobuf::FileArchive* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::FileArchive>(Arena*); -template<> ::Odb::Lib::Protobuf::FileArchive_StepsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::FileArchive_StepsByNameEntry_DoNotUse>(Arena*); -template<> ::Odb::Lib::Protobuf::FileArchive_SymbolsDirectoriesByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::FileArchive_SymbolsDirectoriesByNameEntry_DoNotUse>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::FileArchive* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::FileArchive>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::FileArchive_StepsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::FileArchive_StepsByNameEntry_DoNotUse>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::FileArchive_SymbolsDirectoriesByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::FileArchive_SymbolsDirectoriesByNameEntry_DoNotUse>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { @@ -131,7 +131,7 @@ class FileArchive_SymbolsDirectoriesByNameEntry_DoNotUse : public ::PROTOBUF_NAM // ------------------------------------------------------------------- -class FileArchive final : +class ODBDESIGN_EXPORT FileArchive final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.FileArchive) */ { public: inline FileArchive() : FileArchive(nullptr) {} diff --git a/OdbDesignLib/ProtoBuf/layerdirectory.pb.h b/OdbDesignLib/ProtoBuf/layerdirectory.pb.h index 787eb847..e42bf802 100644 --- a/OdbDesignLib/ProtoBuf/layerdirectory.pb.h +++ b/OdbDesignLib/ProtoBuf/layerdirectory.pb.h @@ -35,7 +35,7 @@ #include "featuresfile.pb.h" // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_layerdirectory_2eproto +#define PROTOBUF_INTERNAL_EXPORT_layerdirectory_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -43,21 +43,21 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_layerdirectory_2eproto { +struct ODBDESIGN_EXPORT TableStruct_layerdirectory_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_layerdirectory_2eproto; +ODBDESIGN_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_layerdirectory_2eproto; namespace Odb { namespace Lib { namespace Protobuf { class LayerDirectory; struct LayerDirectoryDefaultTypeInternal; -extern LayerDirectoryDefaultTypeInternal _LayerDirectory_default_instance_; +ODBDESIGN_EXPORT extern LayerDirectoryDefaultTypeInternal _LayerDirectory_default_instance_; } // namespace Protobuf } // namespace Lib } // namespace Odb PROTOBUF_NAMESPACE_OPEN -template<> ::Odb::Lib::Protobuf::LayerDirectory* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::LayerDirectory>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::LayerDirectory* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::LayerDirectory>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { @@ -65,7 +65,7 @@ namespace Protobuf { // =================================================================== -class LayerDirectory final : +class ODBDESIGN_EXPORT LayerDirectory final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.LayerDirectory) */ { public: inline LayerDirectory() : LayerDirectory(nullptr) {} diff --git a/OdbDesignLib/ProtoBuf/matrixfile.pb.h b/OdbDesignLib/ProtoBuf/matrixfile.pb.h index a13b00f1..d6d87a76 100644 --- a/OdbDesignLib/ProtoBuf/matrixfile.pb.h +++ b/OdbDesignLib/ProtoBuf/matrixfile.pb.h @@ -34,7 +34,7 @@ #include "enums.pb.h" // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_matrixfile_2eproto +#define PROTOBUF_INTERNAL_EXPORT_matrixfile_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -42,29 +42,29 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_matrixfile_2eproto { +struct ODBDESIGN_EXPORT TableStruct_matrixfile_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_matrixfile_2eproto; +ODBDESIGN_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_matrixfile_2eproto; namespace Odb { namespace Lib { namespace Protobuf { class MatrixFile; struct MatrixFileDefaultTypeInternal; -extern MatrixFileDefaultTypeInternal _MatrixFile_default_instance_; +ODBDESIGN_EXPORT extern MatrixFileDefaultTypeInternal _MatrixFile_default_instance_; class MatrixFile_LayerRecord; struct MatrixFile_LayerRecordDefaultTypeInternal; -extern MatrixFile_LayerRecordDefaultTypeInternal _MatrixFile_LayerRecord_default_instance_; +ODBDESIGN_EXPORT extern MatrixFile_LayerRecordDefaultTypeInternal _MatrixFile_LayerRecord_default_instance_; class MatrixFile_StepRecord; struct MatrixFile_StepRecordDefaultTypeInternal; -extern MatrixFile_StepRecordDefaultTypeInternal _MatrixFile_StepRecord_default_instance_; +ODBDESIGN_EXPORT extern MatrixFile_StepRecordDefaultTypeInternal _MatrixFile_StepRecord_default_instance_; } // namespace Protobuf } // namespace Lib } // namespace Odb PROTOBUF_NAMESPACE_OPEN -template<> ::Odb::Lib::Protobuf::MatrixFile* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::MatrixFile>(Arena*); -template<> ::Odb::Lib::Protobuf::MatrixFile_LayerRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::MatrixFile_LayerRecord>(Arena*); -template<> ::Odb::Lib::Protobuf::MatrixFile_StepRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::MatrixFile_StepRecord>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::MatrixFile* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::MatrixFile>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::MatrixFile_LayerRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::MatrixFile_LayerRecord>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::MatrixFile_StepRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::MatrixFile_StepRecord>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { @@ -87,12 +87,12 @@ enum MatrixFile_LayerRecord_Type : int { MatrixFile_LayerRecord_Type_MatrixFile_LayerRecord_Type_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), MatrixFile_LayerRecord_Type_MatrixFile_LayerRecord_Type_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; -bool MatrixFile_LayerRecord_Type_IsValid(int value); +ODBDESIGN_EXPORT bool MatrixFile_LayerRecord_Type_IsValid(int value); constexpr MatrixFile_LayerRecord_Type MatrixFile_LayerRecord_Type_Type_MIN = MatrixFile_LayerRecord_Type_Signal; constexpr MatrixFile_LayerRecord_Type MatrixFile_LayerRecord_Type_Type_MAX = MatrixFile_LayerRecord_Type_ConductivePaste; constexpr int MatrixFile_LayerRecord_Type_Type_ARRAYSIZE = MatrixFile_LayerRecord_Type_Type_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* MatrixFile_LayerRecord_Type_descriptor(); +ODBDESIGN_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* MatrixFile_LayerRecord_Type_descriptor(); template inline const std::string& MatrixFile_LayerRecord_Type_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -112,12 +112,12 @@ enum MatrixFile_LayerRecord_Context : int { MatrixFile_LayerRecord_Context_MatrixFile_LayerRecord_Context_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), MatrixFile_LayerRecord_Context_MatrixFile_LayerRecord_Context_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; -bool MatrixFile_LayerRecord_Context_IsValid(int value); +ODBDESIGN_EXPORT bool MatrixFile_LayerRecord_Context_IsValid(int value); constexpr MatrixFile_LayerRecord_Context MatrixFile_LayerRecord_Context_Context_MIN = MatrixFile_LayerRecord_Context_Board; constexpr MatrixFile_LayerRecord_Context MatrixFile_LayerRecord_Context_Context_MAX = MatrixFile_LayerRecord_Context_Misc; constexpr int MatrixFile_LayerRecord_Context_Context_ARRAYSIZE = MatrixFile_LayerRecord_Context_Context_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* MatrixFile_LayerRecord_Context_descriptor(); +ODBDESIGN_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* MatrixFile_LayerRecord_Context_descriptor(); template inline const std::string& MatrixFile_LayerRecord_Context_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -138,12 +138,12 @@ enum MatrixFile_LayerRecord_DielectricType : int { MatrixFile_LayerRecord_DielectricType_MatrixFile_LayerRecord_DielectricType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), MatrixFile_LayerRecord_DielectricType_MatrixFile_LayerRecord_DielectricType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; -bool MatrixFile_LayerRecord_DielectricType_IsValid(int value); +ODBDESIGN_EXPORT bool MatrixFile_LayerRecord_DielectricType_IsValid(int value); constexpr MatrixFile_LayerRecord_DielectricType MatrixFile_LayerRecord_DielectricType_DielectricType_MIN = MatrixFile_LayerRecord_DielectricType_None; constexpr MatrixFile_LayerRecord_DielectricType MatrixFile_LayerRecord_DielectricType_DielectricType_MAX = MatrixFile_LayerRecord_DielectricType_Core; constexpr int MatrixFile_LayerRecord_DielectricType_DielectricType_ARRAYSIZE = MatrixFile_LayerRecord_DielectricType_DielectricType_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* MatrixFile_LayerRecord_DielectricType_descriptor(); +ODBDESIGN_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* MatrixFile_LayerRecord_DielectricType_descriptor(); template inline const std::string& MatrixFile_LayerRecord_DielectricType_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -163,12 +163,12 @@ enum MatrixFile_LayerRecord_Form : int { MatrixFile_LayerRecord_Form_MatrixFile_LayerRecord_Form_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), MatrixFile_LayerRecord_Form_MatrixFile_LayerRecord_Form_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; -bool MatrixFile_LayerRecord_Form_IsValid(int value); +ODBDESIGN_EXPORT bool MatrixFile_LayerRecord_Form_IsValid(int value); constexpr MatrixFile_LayerRecord_Form MatrixFile_LayerRecord_Form_Form_MIN = MatrixFile_LayerRecord_Form_Rigid; constexpr MatrixFile_LayerRecord_Form MatrixFile_LayerRecord_Form_Form_MAX = MatrixFile_LayerRecord_Form_Flex; constexpr int MatrixFile_LayerRecord_Form_Form_ARRAYSIZE = MatrixFile_LayerRecord_Form_Form_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* MatrixFile_LayerRecord_Form_descriptor(); +ODBDESIGN_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* MatrixFile_LayerRecord_Form_descriptor(); template inline const std::string& MatrixFile_LayerRecord_Form_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -184,7 +184,7 @@ inline bool MatrixFile_LayerRecord_Form_Parse( } // =================================================================== -class MatrixFile_StepRecord final : +class ODBDESIGN_EXPORT MatrixFile_StepRecord final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.MatrixFile.StepRecord) */ { public: inline MatrixFile_StepRecord() : MatrixFile_StepRecord(nullptr) {} @@ -359,7 +359,7 @@ class MatrixFile_StepRecord final : }; // ------------------------------------------------------------------- -class MatrixFile_LayerRecord final : +class ODBDESIGN_EXPORT MatrixFile_LayerRecord final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.MatrixFile.LayerRecord) */ { public: inline MatrixFile_LayerRecord() : MatrixFile_LayerRecord(nullptr) {} @@ -846,7 +846,7 @@ class MatrixFile_LayerRecord final : }; // ------------------------------------------------------------------- -class MatrixFile final : +class ODBDESIGN_EXPORT MatrixFile final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.MatrixFile) */ { public: inline MatrixFile() : MatrixFile(nullptr) {} diff --git a/OdbDesignLib/ProtoBuf/miscinfofile.pb.h b/OdbDesignLib/ProtoBuf/miscinfofile.pb.h index 6b27404c..9ea58109 100644 --- a/OdbDesignLib/ProtoBuf/miscinfofile.pb.h +++ b/OdbDesignLib/ProtoBuf/miscinfofile.pb.h @@ -33,7 +33,7 @@ #include // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_miscinfofile_2eproto +#define PROTOBUF_INTERNAL_EXPORT_miscinfofile_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -41,21 +41,21 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_miscinfofile_2eproto { +struct ODBDESIGN_EXPORT TableStruct_miscinfofile_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_miscinfofile_2eproto; +ODBDESIGN_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_miscinfofile_2eproto; namespace Odb { namespace Lib { namespace Protobuf { class MiscInfoFile; struct MiscInfoFileDefaultTypeInternal; -extern MiscInfoFileDefaultTypeInternal _MiscInfoFile_default_instance_; +ODBDESIGN_EXPORT extern MiscInfoFileDefaultTypeInternal _MiscInfoFile_default_instance_; } // namespace Protobuf } // namespace Lib } // namespace Odb PROTOBUF_NAMESPACE_OPEN -template<> ::Odb::Lib::Protobuf::MiscInfoFile* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::MiscInfoFile>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::MiscInfoFile* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::MiscInfoFile>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { @@ -63,7 +63,7 @@ namespace Protobuf { // =================================================================== -class MiscInfoFile final : +class ODBDESIGN_EXPORT MiscInfoFile final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.MiscInfoFile) */ { public: inline MiscInfoFile() : MiscInfoFile(nullptr) {} diff --git a/OdbDesignLib/ProtoBuf/net.pb.h b/OdbDesignLib/ProtoBuf/net.pb.h index 8ba9aa45..bdae66f9 100644 --- a/OdbDesignLib/ProtoBuf/net.pb.h +++ b/OdbDesignLib/ProtoBuf/net.pb.h @@ -33,7 +33,7 @@ #include "pinconnection.pb.h" // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_net_2eproto +#define PROTOBUF_INTERNAL_EXPORT_net_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -41,23 +41,23 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_net_2eproto { +struct ODBDESIGN_EXPORT TableStruct_net_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_net_2eproto; +ODBDESIGN_EXPORT 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_; +ODBDESIGN_EXPORT 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*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::ProductModel::Net* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Net>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { @@ -66,7 +66,7 @@ namespace ProductModel { // =================================================================== -class Net final : +class ODBDESIGN_EXPORT Net final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.ProductModel.Net) */ { public: inline Net() : Net(nullptr) {} diff --git a/OdbDesignLib/ProtoBuf/netlistfile.pb.h b/OdbDesignLib/ProtoBuf/netlistfile.pb.h index 6ae6af9e..a227babe 100644 --- a/OdbDesignLib/ProtoBuf/netlistfile.pb.h +++ b/OdbDesignLib/ProtoBuf/netlistfile.pb.h @@ -36,7 +36,7 @@ #include // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_netlistfile_2eproto +#define PROTOBUF_INTERNAL_EXPORT_netlistfile_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -44,33 +44,33 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_netlistfile_2eproto { +struct ODBDESIGN_EXPORT TableStruct_netlistfile_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_netlistfile_2eproto; +ODBDESIGN_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_netlistfile_2eproto; namespace Odb { namespace Lib { namespace Protobuf { class NetlistFile; struct NetlistFileDefaultTypeInternal; -extern NetlistFileDefaultTypeInternal _NetlistFile_default_instance_; +ODBDESIGN_EXPORT extern NetlistFileDefaultTypeInternal _NetlistFile_default_instance_; class NetlistFile_NetPointRecord; struct NetlistFile_NetPointRecordDefaultTypeInternal; -extern NetlistFile_NetPointRecordDefaultTypeInternal _NetlistFile_NetPointRecord_default_instance_; +ODBDESIGN_EXPORT extern NetlistFile_NetPointRecordDefaultTypeInternal _NetlistFile_NetPointRecord_default_instance_; class NetlistFile_NetRecord; struct NetlistFile_NetRecordDefaultTypeInternal; -extern NetlistFile_NetRecordDefaultTypeInternal _NetlistFile_NetRecord_default_instance_; +ODBDESIGN_EXPORT extern NetlistFile_NetRecordDefaultTypeInternal _NetlistFile_NetRecord_default_instance_; class NetlistFile_NetRecordsByNameEntry_DoNotUse; struct NetlistFile_NetRecordsByNameEntry_DoNotUseDefaultTypeInternal; -extern NetlistFile_NetRecordsByNameEntry_DoNotUseDefaultTypeInternal _NetlistFile_NetRecordsByNameEntry_DoNotUse_default_instance_; +ODBDESIGN_EXPORT extern NetlistFile_NetRecordsByNameEntry_DoNotUseDefaultTypeInternal _NetlistFile_NetRecordsByNameEntry_DoNotUse_default_instance_; } // namespace Protobuf } // namespace Lib } // namespace Odb PROTOBUF_NAMESPACE_OPEN -template<> ::Odb::Lib::Protobuf::NetlistFile* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::NetlistFile>(Arena*); -template<> ::Odb::Lib::Protobuf::NetlistFile_NetPointRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::NetlistFile_NetPointRecord>(Arena*); -template<> ::Odb::Lib::Protobuf::NetlistFile_NetRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::NetlistFile_NetRecord>(Arena*); -template<> ::Odb::Lib::Protobuf::NetlistFile_NetRecordsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::NetlistFile_NetRecordsByNameEntry_DoNotUse>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::NetlistFile* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::NetlistFile>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::NetlistFile_NetPointRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::NetlistFile_NetPointRecord>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::NetlistFile_NetRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::NetlistFile_NetRecord>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::NetlistFile_NetRecordsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::NetlistFile_NetRecordsByNameEntry_DoNotUse>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { @@ -84,12 +84,12 @@ enum NetlistFile_NetPointRecord_AccessSide : int { NetlistFile_NetPointRecord_AccessSide_NetlistFile_NetPointRecord_AccessSide_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), NetlistFile_NetPointRecord_AccessSide_NetlistFile_NetPointRecord_AccessSide_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; -bool NetlistFile_NetPointRecord_AccessSide_IsValid(int value); +ODBDESIGN_EXPORT bool NetlistFile_NetPointRecord_AccessSide_IsValid(int value); constexpr NetlistFile_NetPointRecord_AccessSide NetlistFile_NetPointRecord_AccessSide_AccessSide_MIN = NetlistFile_NetPointRecord_AccessSide_Top; constexpr NetlistFile_NetPointRecord_AccessSide NetlistFile_NetPointRecord_AccessSide_AccessSide_MAX = NetlistFile_NetPointRecord_AccessSide_Inner; constexpr int NetlistFile_NetPointRecord_AccessSide_AccessSide_ARRAYSIZE = NetlistFile_NetPointRecord_AccessSide_AccessSide_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* NetlistFile_NetPointRecord_AccessSide_descriptor(); +ODBDESIGN_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* NetlistFile_NetPointRecord_AccessSide_descriptor(); template inline const std::string& NetlistFile_NetPointRecord_AccessSide_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -110,12 +110,12 @@ enum NetlistFile_Staggered : int { NetlistFile_Staggered_NetlistFile_Staggered_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), NetlistFile_Staggered_NetlistFile_Staggered_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; -bool NetlistFile_Staggered_IsValid(int value); +ODBDESIGN_EXPORT bool NetlistFile_Staggered_IsValid(int value); constexpr NetlistFile_Staggered NetlistFile_Staggered_Staggered_MIN = NetlistFile_Staggered_Yes; constexpr NetlistFile_Staggered NetlistFile_Staggered_Staggered_MAX = NetlistFile_Staggered_Unknown; constexpr int NetlistFile_Staggered_Staggered_ARRAYSIZE = NetlistFile_Staggered_Staggered_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* NetlistFile_Staggered_descriptor(); +ODBDESIGN_EXPORT const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* NetlistFile_Staggered_descriptor(); template inline const std::string& NetlistFile_Staggered_Name(T enum_t_value) { static_assert(::std::is_same::value || @@ -131,7 +131,7 @@ inline bool NetlistFile_Staggered_Parse( } // =================================================================== -class NetlistFile_NetRecord final : +class ODBDESIGN_EXPORT NetlistFile_NetRecord final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.NetlistFile.NetRecord) */ { public: inline NetlistFile_NetRecord() : NetlistFile_NetRecord(nullptr) {} @@ -304,7 +304,7 @@ class NetlistFile_NetRecord final : }; // ------------------------------------------------------------------- -class NetlistFile_NetPointRecord final : +class ODBDESIGN_EXPORT NetlistFile_NetPointRecord final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.NetlistFile.NetPointRecord) */ { public: inline NetlistFile_NetPointRecord() : NetlistFile_NetPointRecord(nullptr) {} @@ -772,7 +772,7 @@ class NetlistFile_NetRecordsByNameEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_I // ------------------------------------------------------------------- -class NetlistFile final : +class ODBDESIGN_EXPORT NetlistFile final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.NetlistFile) */ { public: inline NetlistFile() : NetlistFile(nullptr) {} diff --git a/OdbDesignLib/ProtoBuf/package.pb.h b/OdbDesignLib/ProtoBuf/package.pb.h index 4a1402f5..494e9915 100644 --- a/OdbDesignLib/ProtoBuf/package.pb.h +++ b/OdbDesignLib/ProtoBuf/package.pb.h @@ -36,7 +36,7 @@ #include "pin.pb.h" // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_package_2eproto +#define PROTOBUF_INTERNAL_EXPORT_package_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -44,27 +44,27 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_package_2eproto { +struct ODBDESIGN_EXPORT TableStruct_package_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_package_2eproto; +ODBDESIGN_EXPORT 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_; +ODBDESIGN_EXPORT extern PackageDefaultTypeInternal _Package_default_instance_; class Package_PinsByNameEntry_DoNotUse; struct Package_PinsByNameEntry_DoNotUseDefaultTypeInternal; -extern Package_PinsByNameEntry_DoNotUseDefaultTypeInternal _Package_PinsByNameEntry_DoNotUse_default_instance_; +ODBDESIGN_EXPORT 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*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::ProductModel::Package* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Package>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::ProductModel::Package_PinsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Package_PinsByNameEntry_DoNotUse>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { @@ -99,7 +99,7 @@ class Package_PinsByNameEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::interna // ------------------------------------------------------------------- -class Package final : +class ODBDESIGN_EXPORT Package final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.ProductModel.Package) */ { public: inline Package() : Package(nullptr) {} diff --git a/OdbDesignLib/ProtoBuf/part.pb.h b/OdbDesignLib/ProtoBuf/part.pb.h index 0b188753..633d57a6 100644 --- a/OdbDesignLib/ProtoBuf/part.pb.h +++ b/OdbDesignLib/ProtoBuf/part.pb.h @@ -32,7 +32,7 @@ #include // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_part_2eproto +#define PROTOBUF_INTERNAL_EXPORT_part_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -40,23 +40,23 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_part_2eproto { +struct ODBDESIGN_EXPORT TableStruct_part_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_part_2eproto; +ODBDESIGN_EXPORT 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_; +ODBDESIGN_EXPORT 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*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::ProductModel::Part* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Part>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { @@ -65,7 +65,7 @@ namespace ProductModel { // =================================================================== -class Part final : +class ODBDESIGN_EXPORT Part final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.ProductModel.Part) */ { public: inline Part() : Part(nullptr) {} diff --git a/OdbDesignLib/ProtoBuf/pin.pb.h b/OdbDesignLib/ProtoBuf/pin.pb.h index 39888942..6378d5c7 100644 --- a/OdbDesignLib/ProtoBuf/pin.pb.h +++ b/OdbDesignLib/ProtoBuf/pin.pb.h @@ -32,7 +32,7 @@ #include // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_pin_2eproto +#define PROTOBUF_INTERNAL_EXPORT_pin_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -40,23 +40,23 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_pin_2eproto { +struct ODBDESIGN_EXPORT TableStruct_pin_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_pin_2eproto; +ODBDESIGN_EXPORT 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_; +ODBDESIGN_EXPORT 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*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::ProductModel::Pin* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Pin>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { @@ -65,7 +65,7 @@ namespace ProductModel { // =================================================================== -class Pin final : +class ODBDESIGN_EXPORT Pin final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.ProductModel.Pin) */ { public: inline Pin() : Pin(nullptr) {} diff --git a/OdbDesignLib/ProtoBuf/pinconnection.pb.h b/OdbDesignLib/ProtoBuf/pinconnection.pb.h index 19df9e11..c169e473 100644 --- a/OdbDesignLib/ProtoBuf/pinconnection.pb.h +++ b/OdbDesignLib/ProtoBuf/pinconnection.pb.h @@ -34,7 +34,7 @@ #include "pin.pb.h" // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_pinconnection_2eproto +#define PROTOBUF_INTERNAL_EXPORT_pinconnection_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -42,23 +42,23 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_pinconnection_2eproto { +struct ODBDESIGN_EXPORT TableStruct_pinconnection_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_pinconnection_2eproto; +ODBDESIGN_EXPORT 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_; +ODBDESIGN_EXPORT 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*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::ProductModel::PinConnection* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::PinConnection>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { @@ -67,7 +67,7 @@ namespace ProductModel { // =================================================================== -class PinConnection final : +class ODBDESIGN_EXPORT PinConnection final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.ProductModel.PinConnection) */ { public: inline PinConnection() : PinConnection(nullptr) {} diff --git a/OdbDesignLib/ProtoBuf/standardfontsfile.pb.h b/OdbDesignLib/ProtoBuf/standardfontsfile.pb.h index 3a4f3baa..630bf865 100644 --- a/OdbDesignLib/ProtoBuf/standardfontsfile.pb.h +++ b/OdbDesignLib/ProtoBuf/standardfontsfile.pb.h @@ -33,7 +33,7 @@ #include "enums.pb.h" // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_standardfontsfile_2eproto +#define PROTOBUF_INTERNAL_EXPORT_standardfontsfile_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -41,29 +41,29 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_standardfontsfile_2eproto { +struct ODBDESIGN_EXPORT TableStruct_standardfontsfile_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_standardfontsfile_2eproto; +ODBDESIGN_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_standardfontsfile_2eproto; namespace Odb { namespace Lib { namespace Protobuf { class StandardFontsFile; struct StandardFontsFileDefaultTypeInternal; -extern StandardFontsFileDefaultTypeInternal _StandardFontsFile_default_instance_; +ODBDESIGN_EXPORT extern StandardFontsFileDefaultTypeInternal _StandardFontsFile_default_instance_; class StandardFontsFile_CharacterBlock; struct StandardFontsFile_CharacterBlockDefaultTypeInternal; -extern StandardFontsFile_CharacterBlockDefaultTypeInternal _StandardFontsFile_CharacterBlock_default_instance_; +ODBDESIGN_EXPORT extern StandardFontsFile_CharacterBlockDefaultTypeInternal _StandardFontsFile_CharacterBlock_default_instance_; class StandardFontsFile_CharacterBlock_LineRecord; struct StandardFontsFile_CharacterBlock_LineRecordDefaultTypeInternal; -extern StandardFontsFile_CharacterBlock_LineRecordDefaultTypeInternal _StandardFontsFile_CharacterBlock_LineRecord_default_instance_; +ODBDESIGN_EXPORT extern StandardFontsFile_CharacterBlock_LineRecordDefaultTypeInternal _StandardFontsFile_CharacterBlock_LineRecord_default_instance_; } // namespace Protobuf } // namespace Lib } // namespace Odb PROTOBUF_NAMESPACE_OPEN -template<> ::Odb::Lib::Protobuf::StandardFontsFile* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::StandardFontsFile>(Arena*); -template<> ::Odb::Lib::Protobuf::StandardFontsFile_CharacterBlock* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::StandardFontsFile_CharacterBlock>(Arena*); -template<> ::Odb::Lib::Protobuf::StandardFontsFile_CharacterBlock_LineRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::StandardFontsFile_CharacterBlock_LineRecord>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::StandardFontsFile* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::StandardFontsFile>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::StandardFontsFile_CharacterBlock* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::StandardFontsFile_CharacterBlock>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::StandardFontsFile_CharacterBlock_LineRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::StandardFontsFile_CharacterBlock_LineRecord>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { @@ -71,7 +71,7 @@ namespace Protobuf { // =================================================================== -class StandardFontsFile_CharacterBlock_LineRecord final : +class ODBDESIGN_EXPORT StandardFontsFile_CharacterBlock_LineRecord final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.StandardFontsFile.CharacterBlock.LineRecord) */ { public: inline StandardFontsFile_CharacterBlock_LineRecord() : StandardFontsFile_CharacterBlock_LineRecord(nullptr) {} @@ -314,7 +314,7 @@ class StandardFontsFile_CharacterBlock_LineRecord final : }; // ------------------------------------------------------------------- -class StandardFontsFile_CharacterBlock final : +class ODBDESIGN_EXPORT StandardFontsFile_CharacterBlock final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.StandardFontsFile.CharacterBlock) */ { public: inline StandardFontsFile_CharacterBlock() : StandardFontsFile_CharacterBlock(nullptr) {} @@ -494,7 +494,7 @@ class StandardFontsFile_CharacterBlock final : }; // ------------------------------------------------------------------- -class StandardFontsFile final : +class ODBDESIGN_EXPORT StandardFontsFile final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.StandardFontsFile) */ { public: inline StandardFontsFile() : StandardFontsFile(nullptr) {} diff --git a/OdbDesignLib/ProtoBuf/stepdirectory.pb.h b/OdbDesignLib/ProtoBuf/stepdirectory.pb.h index e2c29868..d3dadfe4 100644 --- a/OdbDesignLib/ProtoBuf/stepdirectory.pb.h +++ b/OdbDesignLib/ProtoBuf/stepdirectory.pb.h @@ -41,7 +41,7 @@ #include "stephdrfile.pb.h" // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_stepdirectory_2eproto +#define PROTOBUF_INTERNAL_EXPORT_stepdirectory_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -49,29 +49,29 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_stepdirectory_2eproto { +struct ODBDESIGN_EXPORT TableStruct_stepdirectory_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_stepdirectory_2eproto; +ODBDESIGN_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_stepdirectory_2eproto; namespace Odb { namespace Lib { namespace Protobuf { class StepDirectory; struct StepDirectoryDefaultTypeInternal; -extern StepDirectoryDefaultTypeInternal _StepDirectory_default_instance_; +ODBDESIGN_EXPORT extern StepDirectoryDefaultTypeInternal _StepDirectory_default_instance_; class StepDirectory_LayersByNameEntry_DoNotUse; struct StepDirectory_LayersByNameEntry_DoNotUseDefaultTypeInternal; -extern StepDirectory_LayersByNameEntry_DoNotUseDefaultTypeInternal _StepDirectory_LayersByNameEntry_DoNotUse_default_instance_; +ODBDESIGN_EXPORT extern StepDirectory_LayersByNameEntry_DoNotUseDefaultTypeInternal _StepDirectory_LayersByNameEntry_DoNotUse_default_instance_; class StepDirectory_NetlistsByNameEntry_DoNotUse; struct StepDirectory_NetlistsByNameEntry_DoNotUseDefaultTypeInternal; -extern StepDirectory_NetlistsByNameEntry_DoNotUseDefaultTypeInternal _StepDirectory_NetlistsByNameEntry_DoNotUse_default_instance_; +ODBDESIGN_EXPORT extern StepDirectory_NetlistsByNameEntry_DoNotUseDefaultTypeInternal _StepDirectory_NetlistsByNameEntry_DoNotUse_default_instance_; } // namespace Protobuf } // namespace Lib } // namespace Odb PROTOBUF_NAMESPACE_OPEN -template<> ::Odb::Lib::Protobuf::StepDirectory* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::StepDirectory>(Arena*); -template<> ::Odb::Lib::Protobuf::StepDirectory_LayersByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::StepDirectory_LayersByNameEntry_DoNotUse>(Arena*); -template<> ::Odb::Lib::Protobuf::StepDirectory_NetlistsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::StepDirectory_NetlistsByNameEntry_DoNotUse>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::StepDirectory* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::StepDirectory>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::StepDirectory_LayersByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::StepDirectory_LayersByNameEntry_DoNotUse>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::StepDirectory_NetlistsByNameEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::StepDirectory_NetlistsByNameEntry_DoNotUse>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { @@ -131,7 +131,7 @@ class StepDirectory_NetlistsByNameEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_I // ------------------------------------------------------------------- -class StepDirectory final : +class ODBDESIGN_EXPORT StepDirectory final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.StepDirectory) */ { public: inline StepDirectory() : StepDirectory(nullptr) {} diff --git a/OdbDesignLib/ProtoBuf/stephdrfile.pb.h b/OdbDesignLib/ProtoBuf/stephdrfile.pb.h index 5c219e43..55175346 100644 --- a/OdbDesignLib/ProtoBuf/stephdrfile.pb.h +++ b/OdbDesignLib/ProtoBuf/stephdrfile.pb.h @@ -35,7 +35,7 @@ #include // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_stephdrfile_2eproto +#define PROTOBUF_INTERNAL_EXPORT_stephdrfile_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -43,29 +43,29 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_stephdrfile_2eproto { +struct ODBDESIGN_EXPORT TableStruct_stephdrfile_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_stephdrfile_2eproto; +ODBDESIGN_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_stephdrfile_2eproto; namespace Odb { namespace Lib { namespace Protobuf { class StepHdrFile; struct StepHdrFileDefaultTypeInternal; -extern StepHdrFileDefaultTypeInternal _StepHdrFile_default_instance_; +ODBDESIGN_EXPORT extern StepHdrFileDefaultTypeInternal _StepHdrFile_default_instance_; class StepHdrFile_OnlineValuesEntry_DoNotUse; struct StepHdrFile_OnlineValuesEntry_DoNotUseDefaultTypeInternal; -extern StepHdrFile_OnlineValuesEntry_DoNotUseDefaultTypeInternal _StepHdrFile_OnlineValuesEntry_DoNotUse_default_instance_; +ODBDESIGN_EXPORT extern StepHdrFile_OnlineValuesEntry_DoNotUseDefaultTypeInternal _StepHdrFile_OnlineValuesEntry_DoNotUse_default_instance_; class StepHdrFile_StepRepeatRecord; struct StepHdrFile_StepRepeatRecordDefaultTypeInternal; -extern StepHdrFile_StepRepeatRecordDefaultTypeInternal _StepHdrFile_StepRepeatRecord_default_instance_; +ODBDESIGN_EXPORT extern StepHdrFile_StepRepeatRecordDefaultTypeInternal _StepHdrFile_StepRepeatRecord_default_instance_; } // namespace Protobuf } // namespace Lib } // namespace Odb PROTOBUF_NAMESPACE_OPEN -template<> ::Odb::Lib::Protobuf::StepHdrFile* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::StepHdrFile>(Arena*); -template<> ::Odb::Lib::Protobuf::StepHdrFile_OnlineValuesEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::StepHdrFile_OnlineValuesEntry_DoNotUse>(Arena*); -template<> ::Odb::Lib::Protobuf::StepHdrFile_StepRepeatRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::StepHdrFile_StepRepeatRecord>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::StepHdrFile* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::StepHdrFile>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::StepHdrFile_OnlineValuesEntry_DoNotUse* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::StepHdrFile_OnlineValuesEntry_DoNotUse>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::StepHdrFile_StepRepeatRecord* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::StepHdrFile_StepRepeatRecord>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { @@ -73,7 +73,7 @@ namespace Protobuf { // =================================================================== -class StepHdrFile_StepRepeatRecord final : +class ODBDESIGN_EXPORT StepHdrFile_StepRepeatRecord final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.StepHdrFile.StepRepeatRecord) */ { public: inline StepHdrFile_StepRepeatRecord() : StepHdrFile_StepRepeatRecord(nullptr) {} @@ -394,7 +394,7 @@ class StepHdrFile_OnlineValuesEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::i // ------------------------------------------------------------------- -class StepHdrFile final : +class ODBDESIGN_EXPORT StepHdrFile final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.StepHdrFile) */ { public: inline StepHdrFile() : StepHdrFile(nullptr) {} diff --git a/OdbDesignLib/ProtoBuf/symbolname.pb.h b/OdbDesignLib/ProtoBuf/symbolname.pb.h index 2b3b6b3d..ce15f64d 100644 --- a/OdbDesignLib/ProtoBuf/symbolname.pb.h +++ b/OdbDesignLib/ProtoBuf/symbolname.pb.h @@ -33,7 +33,7 @@ #include "enums.pb.h" // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_symbolname_2eproto +#define PROTOBUF_INTERNAL_EXPORT_symbolname_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -41,21 +41,21 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_symbolname_2eproto { +struct ODBDESIGN_EXPORT TableStruct_symbolname_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_symbolname_2eproto; +ODBDESIGN_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_symbolname_2eproto; namespace Odb { namespace Lib { namespace Protobuf { class SymbolName; struct SymbolNameDefaultTypeInternal; -extern SymbolNameDefaultTypeInternal _SymbolName_default_instance_; +ODBDESIGN_EXPORT extern SymbolNameDefaultTypeInternal _SymbolName_default_instance_; } // namespace Protobuf } // namespace Lib } // namespace Odb PROTOBUF_NAMESPACE_OPEN -template<> ::Odb::Lib::Protobuf::SymbolName* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::SymbolName>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::SymbolName* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::SymbolName>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { @@ -63,7 +63,7 @@ namespace Protobuf { // =================================================================== -class SymbolName final : +class ODBDESIGN_EXPORT SymbolName final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.SymbolName) */ { public: inline SymbolName() : SymbolName(nullptr) {} diff --git a/OdbDesignLib/ProtoBuf/symbolsdirectory.pb.h b/OdbDesignLib/ProtoBuf/symbolsdirectory.pb.h index 13291564..54331d8f 100644 --- a/OdbDesignLib/ProtoBuf/symbolsdirectory.pb.h +++ b/OdbDesignLib/ProtoBuf/symbolsdirectory.pb.h @@ -34,7 +34,7 @@ #include "featuresfile.pb.h" // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_symbolsdirectory_2eproto +#define PROTOBUF_INTERNAL_EXPORT_symbolsdirectory_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -42,21 +42,21 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_symbolsdirectory_2eproto { +struct ODBDESIGN_EXPORT TableStruct_symbolsdirectory_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_symbolsdirectory_2eproto; +ODBDESIGN_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_symbolsdirectory_2eproto; namespace Odb { namespace Lib { namespace Protobuf { class SymbolsDirectory; struct SymbolsDirectoryDefaultTypeInternal; -extern SymbolsDirectoryDefaultTypeInternal _SymbolsDirectory_default_instance_; +ODBDESIGN_EXPORT extern SymbolsDirectoryDefaultTypeInternal _SymbolsDirectory_default_instance_; } // namespace Protobuf } // namespace Lib } // namespace Odb PROTOBUF_NAMESPACE_OPEN -template<> ::Odb::Lib::Protobuf::SymbolsDirectory* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::SymbolsDirectory>(Arena*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::SymbolsDirectory* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::SymbolsDirectory>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { @@ -64,7 +64,7 @@ namespace Protobuf { // =================================================================== -class SymbolsDirectory final : +class ODBDESIGN_EXPORT SymbolsDirectory final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.SymbolsDirectory) */ { public: inline SymbolsDirectory() : SymbolsDirectory(nullptr) {} diff --git a/OdbDesignLib/ProtoBuf/via.pb.h b/OdbDesignLib/ProtoBuf/via.pb.h index 02baad12..39d0fc85 100644 --- a/OdbDesignLib/ProtoBuf/via.pb.h +++ b/OdbDesignLib/ProtoBuf/via.pb.h @@ -33,7 +33,7 @@ #include "enums.pb.h" // @@protoc_insertion_point(includes) #include -#define PROTOBUF_INTERNAL_EXPORT_via_2eproto +#define PROTOBUF_INTERNAL_EXPORT_via_2eproto ODBDESIGN_EXPORT PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; @@ -41,23 +41,23 @@ class AnyMetadata; PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. -struct TableStruct_via_2eproto { +struct ODBDESIGN_EXPORT TableStruct_via_2eproto { static const uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_via_2eproto; +ODBDESIGN_EXPORT 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_; +ODBDESIGN_EXPORT 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*); +template<> ODBDESIGN_EXPORT ::Odb::Lib::Protobuf::ProductModel::Via* Arena::CreateMaybeMessage<::Odb::Lib::Protobuf::ProductModel::Via>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace Odb { namespace Lib { @@ -66,7 +66,7 @@ namespace ProductModel { // =================================================================== -class Via final : +class ODBDESIGN_EXPORT Via final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Odb.Lib.Protobuf.ProductModel.Via) */ { public: inline Via() : Via(nullptr) {} From 7ce79cd375313d879364fe0755d53d1579121e43 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sun, 28 Jan 2024 13:00:51 -0800 Subject: [PATCH 18/42] add MakeEmpty() to create an empty Component w/o having to provide a no-arg ctor() --- OdbDesignLib/ProductModel/Component.cpp | 5 +++++ OdbDesignLib/ProductModel/Component.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/OdbDesignLib/ProductModel/Component.cpp b/OdbDesignLib/ProductModel/Component.cpp index e91e654d..5b627b8b 100644 --- a/OdbDesignLib/ProductModel/Component.cpp +++ b/OdbDesignLib/ProductModel/Component.cpp @@ -72,4 +72,9 @@ namespace Odb::Lib::ProductModel m_pPart->from_protobuf(message.part()); } + Component* Component::MakeEmpty() + { + return new Component(); + } + } // namespace Odb::Lib::ProductModel \ No newline at end of file diff --git a/OdbDesignLib/ProductModel/Component.h b/OdbDesignLib/ProductModel/Component.h index cd8fbb9d..2152bf60 100644 --- a/OdbDesignLib/ProductModel/Component.h +++ b/OdbDesignLib/ProductModel/Component.h @@ -32,10 +32,14 @@ namespace Odb::Lib::ProductModel std::unique_ptr to_protobuf() const override; void from_protobuf(const Odb::Lib::Protobuf::ProductModel::Component& message) override; + static Component* MakeEmpty(); + typedef std::vector> Vector; typedef std::map> StringMap; private: + Component() = default; + std::string m_refDes; std::string m_partName; std::shared_ptr m_pPackage; From 2839516f5a86ec393991b32673189619c6be2092 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sun, 28 Jan 2024 13:01:33 -0800 Subject: [PATCH 19/42] use std::make_unique instead of std::unique_ptr ctor so that we dont get a null ptr back --- OdbDesignLib/ProductModel/Component.cpp | 5 +---- OdbDesignLib/ProductModel/Design.cpp | 2 +- OdbDesignLib/ProductModel/Net.cpp | 2 +- OdbDesignLib/ProductModel/Package.cpp | 2 +- OdbDesignLib/ProductModel/Part.cpp | 2 +- OdbDesignLib/ProductModel/PinConnection.cpp | 2 +- OdbDesignLib/ProductModel/Via.cpp | 2 +- 7 files changed, 7 insertions(+), 10 deletions(-) diff --git a/OdbDesignLib/ProductModel/Component.cpp b/OdbDesignLib/ProductModel/Component.cpp index 5b627b8b..a06f6764 100644 --- a/OdbDesignLib/ProductModel/Component.cpp +++ b/OdbDesignLib/ProductModel/Component.cpp @@ -1,7 +1,4 @@ #include "Component.h" -#include "Component.h" -#include "Component.h" -#include "Component.h" namespace Odb::Lib::ProductModel @@ -52,7 +49,7 @@ namespace Odb::Lib::ProductModel std::unique_ptr Component::to_protobuf() const { - auto pComponentMsg = std::unique_ptr(); + auto pComponentMsg = std::make_unique(); pComponentMsg->set_refdes(m_refDes); pComponentMsg->set_partname(m_partName); pComponentMsg->set_index(m_index); diff --git a/OdbDesignLib/ProductModel/Design.cpp b/OdbDesignLib/ProductModel/Design.cpp index 389100db..3f00c448 100644 --- a/OdbDesignLib/ProductModel/Design.cpp +++ b/OdbDesignLib/ProductModel/Design.cpp @@ -137,7 +137,7 @@ namespace Odb::Lib::ProductModel std::unique_ptr Design::to_protobuf() const { - auto pDesignMsg = std::unique_ptr(); + auto pDesignMsg = std::make_unique(); pDesignMsg->set_name(m_name); pDesignMsg->set_productmodel(m_productModel); diff --git a/OdbDesignLib/ProductModel/Net.cpp b/OdbDesignLib/ProductModel/Net.cpp index 86d5d417..871cc4a0 100644 --- a/OdbDesignLib/ProductModel/Net.cpp +++ b/OdbDesignLib/ProductModel/Net.cpp @@ -39,7 +39,7 @@ namespace Odb::Lib::ProductModel std::unique_ptr Odb::Lib::ProductModel::Net::to_protobuf() const { - auto pNetMsg = std::unique_ptr(); + auto pNetMsg = std::make_unique(); pNetMsg->set_name(m_name); pNetMsg->set_index(m_index); for (auto& pPinConnection : m_pinConnections) diff --git a/OdbDesignLib/ProductModel/Package.cpp b/OdbDesignLib/ProductModel/Package.cpp index ebb83daf..f84dc5e9 100644 --- a/OdbDesignLib/ProductModel/Package.cpp +++ b/OdbDesignLib/ProductModel/Package.cpp @@ -30,7 +30,7 @@ namespace Odb::Lib::ProductModel std::unique_ptr Package::to_protobuf() const { - auto pPackageMsg = std::unique_ptr(); + auto pPackageMsg = std::make_unique(); pPackageMsg->set_name(m_name); pPackageMsg->set_index(m_index); for (const auto& pPin : m_pins) diff --git a/OdbDesignLib/ProductModel/Part.cpp b/OdbDesignLib/ProductModel/Part.cpp index 1165e797..6e8583c8 100644 --- a/OdbDesignLib/ProductModel/Part.cpp +++ b/OdbDesignLib/ProductModel/Part.cpp @@ -16,7 +16,7 @@ namespace Odb::Lib::ProductModel std::unique_ptr Odb::Lib::ProductModel::Part::to_protobuf() const { - auto pPartMsg = std::unique_ptr(); + auto pPartMsg = std::make_unique(); pPartMsg->set_name(m_name); return pPartMsg; } diff --git a/OdbDesignLib/ProductModel/PinConnection.cpp b/OdbDesignLib/ProductModel/PinConnection.cpp index eb54de2d..44114c7a 100644 --- a/OdbDesignLib/ProductModel/PinConnection.cpp +++ b/OdbDesignLib/ProductModel/PinConnection.cpp @@ -40,7 +40,7 @@ namespace Odb::Lib::ProductModel std::unique_ptr PinConnection::to_protobuf() const { - auto pPinConnectionMsg = std::unique_ptr(); + auto pPinConnectionMsg = std::make_unique(); pPinConnectionMsg->set_name(m_name); pPinConnectionMsg->set_allocated_component(m_pComponent->to_protobuf().release()); pPinConnectionMsg->set_allocated_pin(m_pPin->to_protobuf().release()); diff --git a/OdbDesignLib/ProductModel/Via.cpp b/OdbDesignLib/ProductModel/Via.cpp index a4f6b2b3..a97dd99b 100644 --- a/OdbDesignLib/ProductModel/Via.cpp +++ b/OdbDesignLib/ProductModel/Via.cpp @@ -23,7 +23,7 @@ namespace Odb::Lib::ProductModel std::unique_ptr Via::to_protobuf() const { - auto pViaMsg = std::unique_ptr(); + auto pViaMsg = std::make_unique(); pViaMsg->set_name(m_name); pViaMsg->set_boardside(static_cast(m_side)); return pViaMsg; From df19d9fefbd9465d650b418b53a8439eb6234f3b Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sun, 28 Jan 2024 13:02:39 -0800 Subject: [PATCH 20/42] remove duplicated includes --- OdbDesignLib/ProductModel/Net.cpp | 2 -- OdbDesignLib/ProductModel/Package.cpp | 4 ---- OdbDesignLib/ProductModel/Part.cpp | 2 -- OdbDesignLib/ProductModel/Pin.cpp | 4 ---- OdbDesignLib/ProductModel/PinConnection.cpp | 4 ---- OdbDesignLib/ProductModel/Via.cpp | 2 -- 6 files changed, 18 deletions(-) diff --git a/OdbDesignLib/ProductModel/Net.cpp b/OdbDesignLib/ProductModel/Net.cpp index 871cc4a0..030e1fb9 100644 --- a/OdbDesignLib/ProductModel/Net.cpp +++ b/OdbDesignLib/ProductModel/Net.cpp @@ -1,6 +1,4 @@ #include "Net.h" -#include "Net.h" -#include "Net.h" namespace Odb::Lib::ProductModel diff --git a/OdbDesignLib/ProductModel/Package.cpp b/OdbDesignLib/ProductModel/Package.cpp index f84dc5e9..303fc284 100644 --- a/OdbDesignLib/ProductModel/Package.cpp +++ b/OdbDesignLib/ProductModel/Package.cpp @@ -1,8 +1,4 @@ #include "Package.h" -#include "Package.h" -#include "Package.h" -#include "Package.h" -#include "Package.h" namespace Odb::Lib::ProductModel { diff --git a/OdbDesignLib/ProductModel/Part.cpp b/OdbDesignLib/ProductModel/Part.cpp index 6e8583c8..3391abf3 100644 --- a/OdbDesignLib/ProductModel/Part.cpp +++ b/OdbDesignLib/ProductModel/Part.cpp @@ -1,6 +1,4 @@ #include "Part.h" -#include "Part.h" -#include "Part.h" namespace Odb::Lib::ProductModel { diff --git a/OdbDesignLib/ProductModel/Pin.cpp b/OdbDesignLib/ProductModel/Pin.cpp index 0cfad4fe..cce23069 100644 --- a/OdbDesignLib/ProductModel/Pin.cpp +++ b/OdbDesignLib/ProductModel/Pin.cpp @@ -1,8 +1,4 @@ #include "Pin.h" -#include "Pin.h" -#include "Pin.h" -#include "Pin.h" - namespace Odb::Lib::ProductModel { diff --git a/OdbDesignLib/ProductModel/PinConnection.cpp b/OdbDesignLib/ProductModel/PinConnection.cpp index 44114c7a..f00c7ea1 100644 --- a/OdbDesignLib/ProductModel/PinConnection.cpp +++ b/OdbDesignLib/ProductModel/PinConnection.cpp @@ -1,8 +1,4 @@ #include "PinConnection.h" -#include "PinConnection.h" -#include "PinConnection.h" -#include "PinConnection.h" -#include "PinConnection.h" namespace Odb::Lib::ProductModel diff --git a/OdbDesignLib/ProductModel/Via.cpp b/OdbDesignLib/ProductModel/Via.cpp index a97dd99b..67e2da8e 100644 --- a/OdbDesignLib/ProductModel/Via.cpp +++ b/OdbDesignLib/ProductModel/Via.cpp @@ -1,6 +1,4 @@ #include "Via.h" -#include "Via.h" -#include "Via.h" namespace Odb::Lib::ProductModel From a2402ec1b04feccbd2deae0a9bc14792c38d71e8 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sun, 28 Jan 2024 13:58:04 -0800 Subject: [PATCH 21/42] fix protobuf serialization in product model classes --- OdbDesignLib/ProductModel/Component.cpp | 6 ++++-- OdbDesignLib/ProductModel/Design.cpp | 2 +- OdbDesignLib/ProductModel/Net.cpp | 3 +-- OdbDesignLib/ProductModel/Package.cpp | 3 +-- OdbDesignLib/ProductModel/PinConnection.cpp | 6 ++++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/OdbDesignLib/ProductModel/Component.cpp b/OdbDesignLib/ProductModel/Component.cpp index a06f6764..ef861045 100644 --- a/OdbDesignLib/ProductModel/Component.cpp +++ b/OdbDesignLib/ProductModel/Component.cpp @@ -54,8 +54,8 @@ namespace Odb::Lib::ProductModel pComponentMsg->set_partname(m_partName); pComponentMsg->set_index(m_index); pComponentMsg->set_side(static_cast(m_side)); - pComponentMsg->set_allocated_package(m_pPackage->to_protobuf().release()); - pComponentMsg->set_allocated_part(m_pPart->to_protobuf().release()); + pComponentMsg->mutable_package()->CopyFrom(*m_pPackage->to_protobuf()); + pComponentMsg->mutable_part()->CopyFrom(*m_pPart->to_protobuf()); return pComponentMsg; } @@ -65,7 +65,9 @@ namespace Odb::Lib::ProductModel m_partName = message.partname(); m_index = message.index(); m_side = static_cast(message.side()); + m_pPackage = std::make_shared("", -1); m_pPackage->from_protobuf(message.package()); + m_pPart = std::make_shared(""); m_pPart->from_protobuf(message.part()); } diff --git a/OdbDesignLib/ProductModel/Design.cpp b/OdbDesignLib/ProductModel/Design.cpp index 3f00c448..ff32ca8c 100644 --- a/OdbDesignLib/ProductModel/Design.cpp +++ b/OdbDesignLib/ProductModel/Design.cpp @@ -141,7 +141,7 @@ namespace Odb::Lib::ProductModel pDesignMsg->set_name(m_name); pDesignMsg->set_productmodel(m_productModel); - pDesignMsg->set_allocated_filemodel(m_pFileModel->to_protobuf().release()); + pDesignMsg->mutable_filemodel()->CopyFrom(*m_pFileModel->to_protobuf()); for (const auto& pNet : m_nets) { diff --git a/OdbDesignLib/ProductModel/Net.cpp b/OdbDesignLib/ProductModel/Net.cpp index 030e1fb9..8da1faa0 100644 --- a/OdbDesignLib/ProductModel/Net.cpp +++ b/OdbDesignLib/ProductModel/Net.cpp @@ -42,8 +42,7 @@ namespace Odb::Lib::ProductModel pNetMsg->set_index(m_index); for (auto& pPinConnection : m_pinConnections) { - auto pPinConnectionMsg = pPinConnection->to_protobuf(); - pNetMsg->add_pinconnections()->CopyFrom(*pPinConnectionMsg); + pNetMsg->add_pinconnections()->CopyFrom(*pPinConnection->to_protobuf()); } return pNetMsg; } diff --git a/OdbDesignLib/ProductModel/Package.cpp b/OdbDesignLib/ProductModel/Package.cpp index 303fc284..4ca02c57 100644 --- a/OdbDesignLib/ProductModel/Package.cpp +++ b/OdbDesignLib/ProductModel/Package.cpp @@ -31,8 +31,7 @@ namespace Odb::Lib::ProductModel pPackageMsg->set_index(m_index); for (const auto& pPin : m_pins) { - auto pPinMsg = pPin->to_protobuf(); - pPackageMsg->add_pins()->CopyFrom(*pPinMsg); + pPackageMsg->add_pins()->CopyFrom(*pPin->to_protobuf()); } for (const auto& kvPin : m_pinsByName) { diff --git a/OdbDesignLib/ProductModel/PinConnection.cpp b/OdbDesignLib/ProductModel/PinConnection.cpp index f00c7ea1..e9e0e419 100644 --- a/OdbDesignLib/ProductModel/PinConnection.cpp +++ b/OdbDesignLib/ProductModel/PinConnection.cpp @@ -38,15 +38,17 @@ namespace Odb::Lib::ProductModel { auto pPinConnectionMsg = std::make_unique(); pPinConnectionMsg->set_name(m_name); - pPinConnectionMsg->set_allocated_component(m_pComponent->to_protobuf().release()); - pPinConnectionMsg->set_allocated_pin(m_pPin->to_protobuf().release()); + pPinConnectionMsg->mutable_component()->CopyFrom(*m_pComponent->to_protobuf()); + pPinConnectionMsg->mutable_pin()->CopyFrom(*m_pPin->to_protobuf()); return pPinConnectionMsg; } void PinConnection::from_protobuf(const Odb::Lib::Protobuf::ProductModel::PinConnection& message) { m_name = message.name(); + m_pComponent = std::shared_ptr(Component::MakeEmpty()); m_pComponent->from_protobuf(message.component()); + m_pPin = std::make_shared("", -1); m_pPin->from_protobuf(message.pin()); } From ae097639849342706e9a746610bafe7c70496197 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sun, 28 Jan 2024 13:58:35 -0800 Subject: [PATCH 22/42] add missing fields to FileArchive PB message --- OdbDesignLib/FileModel/Design/FileArchive.cpp | 4 + OdbDesignLib/ProtoBuf/filearchive.pb.cc | 190 +++++++++++--- OdbDesignLib/ProtoBuf/filearchive.pb.h | 240 +++++++++++++++--- OdbDesignLib/protoc/filearchive.proto | 2 + 4 files changed, 369 insertions(+), 67 deletions(-) diff --git a/OdbDesignLib/FileModel/Design/FileArchive.cpp b/OdbDesignLib/FileModel/Design/FileArchive.cpp index 35bc7a2d..4bafa633 100644 --- a/OdbDesignLib/FileModel/Design/FileArchive.cpp +++ b/OdbDesignLib/FileModel/Design/FileArchive.cpp @@ -166,6 +166,8 @@ namespace Odb::Lib::FileModel::Design std::unique_ptr FileArchive::to_protobuf() const { std::unique_ptr pFileArchiveMessage(new Odb::Lib::Protobuf::FileArchive); + pFileArchiveMessage->set_productname(m_productName); + pFileArchiveMessage->set_filename(m_filename); pFileArchiveMessage->mutable_matrixfile()->CopyFrom(*m_matrixFile.to_protobuf()); pFileArchiveMessage->mutable_miscinfofile()->CopyFrom(*m_miscInfoFile.to_protobuf()); pFileArchiveMessage->mutable_standardfontsfile()->CopyFrom(*m_standardFontsFile.to_protobuf()); @@ -186,6 +188,8 @@ namespace Odb::Lib::FileModel::Design void FileArchive::from_protobuf(const Odb::Lib::Protobuf::FileArchive& message) { + m_productName = message.productname(); + m_filename = message.filename(); m_matrixFile.from_protobuf(message.matrixfile()); m_miscInfoFile.from_protobuf(message.miscinfofile()); m_standardFontsFile.from_protobuf(message.standardfontsfile()); diff --git a/OdbDesignLib/ProtoBuf/filearchive.pb.cc b/OdbDesignLib/ProtoBuf/filearchive.pb.cc index b5729e39..92c0add6 100644 --- a/OdbDesignLib/ProtoBuf/filearchive.pb.cc +++ b/OdbDesignLib/ProtoBuf/filearchive.pb.cc @@ -51,6 +51,8 @@ PROTOBUF_CONSTEXPR FileArchive::FileArchive( , /*decltype(_impl_._cached_size_)*/{} , /*decltype(_impl_.stepsbyname_)*/{::_pbi::ConstantInitialized()} , /*decltype(_impl_.symbolsdirectoriesbyname_)*/{::_pbi::ConstantInitialized()} + , /*decltype(_impl_.productname_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.filename_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} , /*decltype(_impl_.miscinfofile_)*/nullptr , /*decltype(_impl_.matrixfile_)*/nullptr , /*decltype(_impl_.standardfontsfile_)*/nullptr @@ -104,17 +106,21 @@ const uint32_t TableStruct_filearchive_2eproto::offsets[] PROTOBUF_SECTION_VARIA PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::FileArchive, _impl_.standardfontsfile_), PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::FileArchive, _impl_.symbolsdirectoriesbyname_), PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::FileArchive, _impl_.miscattrlistfile_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::FileArchive, _impl_.productname_), + PROTOBUF_FIELD_OFFSET(::Odb::Lib::Protobuf::FileArchive, _impl_.filename_), ~0u, - 0, - 1, 2, - ~0u, 3, + 4, + ~0u, + 5, + 0, + 1, }; static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { { 0, 8, -1, sizeof(::Odb::Lib::Protobuf::FileArchive_StepsByNameEntry_DoNotUse)}, { 10, 18, -1, sizeof(::Odb::Lib::Protobuf::FileArchive_SymbolsDirectoriesByNameEntry_DoNotUse)}, - { 20, 32, -1, sizeof(::Odb::Lib::Protobuf::FileArchive)}, + { 20, 34, -1, sizeof(::Odb::Lib::Protobuf::FileArchive)}, }; static const ::_pb::Message* const file_default_instances[] = { @@ -128,7 +134,7 @@ const char descriptor_table_protodef_filearchive_2eproto[] PROTOBUF_SECTION_VARI "tepdirectory.proto\032\022miscinfofile.proto\032\020" "matrixfile.proto\032\027standardfontsfile.prot" "o\032\026symbolsdirectory.proto\032\022attrlistfile." - "proto\"\254\005\n\013FileArchive\022C\n\013stepsByName\030\001 \003" + "proto\"\372\005\n\013FileArchive\022C\n\013stepsByName\030\001 \003" "(\0132..Odb.Lib.Protobuf.FileArchive.StepsB" "yNameEntry\0229\n\014miscInfoFile\030\002 \001(\0132\036.Odb.L" "ib.Protobuf.MiscInfoFileH\000\210\001\001\0225\n\nmatrixF" @@ -138,14 +144,16 @@ const char descriptor_table_protodef_filearchive_2eproto[] PROTOBUF_SECTION_VARI "bolsDirectoriesByName\030\005 \003(\0132;.Odb.Lib.Pr" "otobuf.FileArchive.SymbolsDirectoriesByN" "ameEntry\022=\n\020miscAttrListFile\030\006 \001(\0132\036.Odb" - ".Lib.Protobuf.AttrListFileH\003\210\001\001\032S\n\020Steps" - "ByNameEntry\022\013\n\003key\030\001 \001(\t\022.\n\005value\030\002 \001(\0132" - "\037.Odb.Lib.Protobuf.StepDirectory:\0028\001\032c\n\035" - "SymbolsDirectoriesByNameEntry\022\013\n\003key\030\001 \001" - "(\t\0221\n\005value\030\002 \001(\0132\".Odb.Lib.Protobuf.Sym" - "bolsDirectory:\0028\001B\017\n\r_miscInfoFileB\r\n\013_m" - "atrixFileB\024\n\022_standardFontsFileB\023\n\021_misc" - "AttrListFileb\006proto3" + ".Lib.Protobuf.AttrListFileH\003\210\001\001\022\030\n\013produ" + "ctName\030\007 \001(\tH\004\210\001\001\022\025\n\010fileName\030\010 \001(\tH\005\210\001\001" + "\032S\n\020StepsByNameEntry\022\013\n\003key\030\001 \001(\t\022.\n\005val" + "ue\030\002 \001(\0132\037.Odb.Lib.Protobuf.StepDirector" + "y:\0028\001\032c\n\035SymbolsDirectoriesByNameEntry\022\013" + "\n\003key\030\001 \001(\t\0221\n\005value\030\002 \001(\0132\".Odb.Lib.Pro" + "tobuf.SymbolsDirectory:\0028\001B\017\n\r_miscInfoF" + "ileB\r\n\013_matrixFileB\024\n\022_standardFontsFile" + "B\023\n\021_miscAttrListFileB\016\n\014_productNameB\013\n" + "\t_fileNameb\006proto3" ; static const ::_pbi::DescriptorTable* const descriptor_table_filearchive_2eproto_deps[6] = { &::descriptor_table_attrlistfile_2eproto, @@ -157,7 +165,7 @@ static const ::_pbi::DescriptorTable* const descriptor_table_filearchive_2eproto }; static ::_pbi::once_flag descriptor_table_filearchive_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_filearchive_2eproto = { - false, false, 860, descriptor_table_protodef_filearchive_2eproto, + false, false, 938, descriptor_table_protodef_filearchive_2eproto, "filearchive.proto", &descriptor_table_filearchive_2eproto_once, descriptor_table_filearchive_2eproto_deps, 6, 3, schemas, file_default_instances, TableStruct_filearchive_2eproto::offsets, @@ -209,19 +217,25 @@ class FileArchive::_Internal { using HasBits = decltype(std::declval()._impl_._has_bits_); static const ::Odb::Lib::Protobuf::MiscInfoFile& miscinfofile(const FileArchive* msg); static void set_has_miscinfofile(HasBits* has_bits) { - (*has_bits)[0] |= 1u; + (*has_bits)[0] |= 4u; } static const ::Odb::Lib::Protobuf::MatrixFile& matrixfile(const FileArchive* msg); static void set_has_matrixfile(HasBits* has_bits) { - (*has_bits)[0] |= 2u; + (*has_bits)[0] |= 8u; } static const ::Odb::Lib::Protobuf::StandardFontsFile& standardfontsfile(const FileArchive* msg); static void set_has_standardfontsfile(HasBits* has_bits) { - (*has_bits)[0] |= 4u; + (*has_bits)[0] |= 16u; } static const ::Odb::Lib::Protobuf::AttrListFile& miscattrlistfile(const FileArchive* msg); static void set_has_miscattrlistfile(HasBits* has_bits) { - (*has_bits)[0] |= 8u; + (*has_bits)[0] |= 32u; + } + static void set_has_productname(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_filename(HasBits* has_bits) { + (*has_bits)[0] |= 2u; } }; @@ -246,22 +260,22 @@ void FileArchive::clear_stepsbyname() { } void FileArchive::clear_miscinfofile() { if (_impl_.miscinfofile_ != nullptr) _impl_.miscinfofile_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000004u; } void FileArchive::clear_matrixfile() { if (_impl_.matrixfile_ != nullptr) _impl_.matrixfile_->Clear(); - _impl_._has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000008u; } void FileArchive::clear_standardfontsfile() { if (_impl_.standardfontsfile_ != nullptr) _impl_.standardfontsfile_->Clear(); - _impl_._has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000010u; } void FileArchive::clear_symbolsdirectoriesbyname() { _impl_.symbolsdirectoriesbyname_.Clear(); } void FileArchive::clear_miscattrlistfile() { if (_impl_.miscattrlistfile_ != nullptr) _impl_.miscattrlistfile_->Clear(); - _impl_._has_bits_[0] &= ~0x00000008u; + _impl_._has_bits_[0] &= ~0x00000020u; } FileArchive::FileArchive(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) @@ -280,6 +294,8 @@ FileArchive::FileArchive(const FileArchive& from) , /*decltype(_impl_._cached_size_)*/{} , /*decltype(_impl_.stepsbyname_)*/{} , /*decltype(_impl_.symbolsdirectoriesbyname_)*/{} + , decltype(_impl_.productname_){} + , decltype(_impl_.filename_){} , decltype(_impl_.miscinfofile_){nullptr} , decltype(_impl_.matrixfile_){nullptr} , decltype(_impl_.standardfontsfile_){nullptr} @@ -288,6 +304,22 @@ FileArchive::FileArchive(const FileArchive& from) _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); _this->_impl_.stepsbyname_.MergeFrom(from._impl_.stepsbyname_); _this->_impl_.symbolsdirectoriesbyname_.MergeFrom(from._impl_.symbolsdirectoriesbyname_); + _impl_.productname_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.productname_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_productname()) { + _this->_impl_.productname_.Set(from._internal_productname(), + _this->GetArenaForAllocation()); + } + _impl_.filename_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.filename_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (from._internal_has_filename()) { + _this->_impl_.filename_.Set(from._internal_filename(), + _this->GetArenaForAllocation()); + } if (from._internal_has_miscinfofile()) { _this->_impl_.miscinfofile_ = new ::Odb::Lib::Protobuf::MiscInfoFile(*from._impl_.miscinfofile_); } @@ -312,11 +344,21 @@ inline void FileArchive::SharedCtor( , /*decltype(_impl_._cached_size_)*/{} , /*decltype(_impl_.stepsbyname_)*/{::_pbi::ArenaInitialized(), arena} , /*decltype(_impl_.symbolsdirectoriesbyname_)*/{::_pbi::ArenaInitialized(), arena} + , decltype(_impl_.productname_){} + , decltype(_impl_.filename_){} , decltype(_impl_.miscinfofile_){nullptr} , decltype(_impl_.matrixfile_){nullptr} , decltype(_impl_.standardfontsfile_){nullptr} , decltype(_impl_.miscattrlistfile_){nullptr} }; + _impl_.productname_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.productname_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.filename_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.filename_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING } FileArchive::~FileArchive() { @@ -335,6 +377,8 @@ inline void FileArchive::SharedDtor() { _impl_.stepsbyname_.~MapField(); _impl_.symbolsdirectoriesbyname_.Destruct(); _impl_.symbolsdirectoriesbyname_.~MapField(); + _impl_.productname_.Destroy(); + _impl_.filename_.Destroy(); if (this != internal_default_instance()) delete _impl_.miscinfofile_; if (this != internal_default_instance()) delete _impl_.matrixfile_; if (this != internal_default_instance()) delete _impl_.standardfontsfile_; @@ -359,20 +403,26 @@ void FileArchive::Clear() { _impl_.stepsbyname_.Clear(); _impl_.symbolsdirectoriesbyname_.Clear(); cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { + if (cached_has_bits & 0x0000003fu) { if (cached_has_bits & 0x00000001u) { + _impl_.productname_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000002u) { + _impl_.filename_.ClearNonDefaultToEmpty(); + } + if (cached_has_bits & 0x00000004u) { GOOGLE_DCHECK(_impl_.miscinfofile_ != nullptr); _impl_.miscinfofile_->Clear(); } - if (cached_has_bits & 0x00000002u) { + if (cached_has_bits & 0x00000008u) { GOOGLE_DCHECK(_impl_.matrixfile_ != nullptr); _impl_.matrixfile_->Clear(); } - if (cached_has_bits & 0x00000004u) { + if (cached_has_bits & 0x00000010u) { GOOGLE_DCHECK(_impl_.standardfontsfile_ != nullptr); _impl_.standardfontsfile_->Clear(); } - if (cached_has_bits & 0x00000008u) { + if (cached_has_bits & 0x00000020u) { GOOGLE_DCHECK(_impl_.miscattrlistfile_ != nullptr); _impl_.miscattrlistfile_->Clear(); } @@ -446,6 +496,26 @@ const char* FileArchive::_InternalParse(const char* ptr, ::_pbi::ParseContext* c } else goto handle_unusual; continue; + // optional string productName = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { + auto str = _internal_mutable_productname(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "Odb.Lib.Protobuf.FileArchive.productName")); + } else + goto handle_unusual; + continue; + // optional string fileName = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { + auto str = _internal_mutable_filename(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "Odb.Lib.Protobuf.FileArchive.fileName")); + } else + goto handle_unusual; + continue; default: goto handle_unusual; } // switch @@ -556,6 +626,26 @@ uint8_t* FileArchive::_InternalSerialize( _Internal::miscattrlistfile(this).GetCachedSize(), target, stream); } + // optional string productName = 7; + if (_internal_has_productname()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_productname().data(), static_cast(this->_internal_productname().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "Odb.Lib.Protobuf.FileArchive.productName"); + target = stream->WriteStringMaybeAliased( + 7, this->_internal_productname(), target); + } + + // optional string fileName = 8; + if (_internal_has_filename()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_filename().data(), static_cast(this->_internal_filename().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "Odb.Lib.Protobuf.FileArchive.fileName"); + target = stream->WriteStringMaybeAliased( + 8, this->_internal_filename(), 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); @@ -591,30 +681,44 @@ size_t FileArchive::ByteSizeLong() const { } cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { - // optional .Odb.Lib.Protobuf.MiscInfoFile miscInfoFile = 2; + if (cached_has_bits & 0x0000003fu) { + // optional string productName = 7; if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_productname()); + } + + // optional string fileName = 8; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_filename()); + } + + // optional .Odb.Lib.Protobuf.MiscInfoFile miscInfoFile = 2; + if (cached_has_bits & 0x00000004u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( *_impl_.miscinfofile_); } // optional .Odb.Lib.Protobuf.MatrixFile matrixFile = 3; - if (cached_has_bits & 0x00000002u) { + if (cached_has_bits & 0x00000008u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( *_impl_.matrixfile_); } // optional .Odb.Lib.Protobuf.StandardFontsFile standardFontsFile = 4; - if (cached_has_bits & 0x00000004u) { + if (cached_has_bits & 0x00000010u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( *_impl_.standardfontsfile_); } // optional .Odb.Lib.Protobuf.AttrListFile miscAttrListFile = 6; - if (cached_has_bits & 0x00000008u) { + if (cached_has_bits & 0x00000020u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( *_impl_.miscattrlistfile_); @@ -642,20 +746,26 @@ void FileArchive::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PR _this->_impl_.stepsbyname_.MergeFrom(from._impl_.stepsbyname_); _this->_impl_.symbolsdirectoriesbyname_.MergeFrom(from._impl_.symbolsdirectoriesbyname_); cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x0000000fu) { + if (cached_has_bits & 0x0000003fu) { if (cached_has_bits & 0x00000001u) { + _this->_internal_set_productname(from._internal_productname()); + } + if (cached_has_bits & 0x00000002u) { + _this->_internal_set_filename(from._internal_filename()); + } + if (cached_has_bits & 0x00000004u) { _this->_internal_mutable_miscinfofile()->::Odb::Lib::Protobuf::MiscInfoFile::MergeFrom( from._internal_miscinfofile()); } - if (cached_has_bits & 0x00000002u) { + if (cached_has_bits & 0x00000008u) { _this->_internal_mutable_matrixfile()->::Odb::Lib::Protobuf::MatrixFile::MergeFrom( from._internal_matrixfile()); } - if (cached_has_bits & 0x00000004u) { + if (cached_has_bits & 0x00000010u) { _this->_internal_mutable_standardfontsfile()->::Odb::Lib::Protobuf::StandardFontsFile::MergeFrom( from._internal_standardfontsfile()); } - if (cached_has_bits & 0x00000008u) { + if (cached_has_bits & 0x00000020u) { _this->_internal_mutable_miscattrlistfile()->::Odb::Lib::Protobuf::AttrListFile::MergeFrom( from._internal_miscattrlistfile()); } @@ -676,10 +786,20 @@ bool FileArchive::IsInitialized() const { void FileArchive::InternalSwap(FileArchive* 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_.stepsbyname_.InternalSwap(&other->_impl_.stepsbyname_); _impl_.symbolsdirectoriesbyname_.InternalSwap(&other->_impl_.symbolsdirectoriesbyname_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.productname_, lhs_arena, + &other->_impl_.productname_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.filename_, lhs_arena, + &other->_impl_.filename_, rhs_arena + ); ::PROTOBUF_NAMESPACE_ID::internal::memswap< PROTOBUF_FIELD_OFFSET(FileArchive, _impl_.miscattrlistfile_) + sizeof(FileArchive::_impl_.miscattrlistfile_) diff --git a/OdbDesignLib/ProtoBuf/filearchive.pb.h b/OdbDesignLib/ProtoBuf/filearchive.pb.h index 91b2bc1d..00ae10e1 100644 --- a/OdbDesignLib/ProtoBuf/filearchive.pb.h +++ b/OdbDesignLib/ProtoBuf/filearchive.pb.h @@ -257,6 +257,8 @@ class ODBDESIGN_EXPORT FileArchive final : enum : int { kStepsByNameFieldNumber = 1, kSymbolsDirectoriesByNameFieldNumber = 5, + kProductNameFieldNumber = 7, + kFileNameFieldNumber = 8, kMiscInfoFileFieldNumber = 2, kMatrixFileFieldNumber = 3, kStandardFontsFileFieldNumber = 4, @@ -296,6 +298,42 @@ class ODBDESIGN_EXPORT FileArchive final : ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::Odb::Lib::Protobuf::SymbolsDirectory >* mutable_symbolsdirectoriesbyname(); + // optional string productName = 7; + bool has_productname() const; + private: + bool _internal_has_productname() const; + public: + void clear_productname(); + const std::string& productname() const; + template + void set_productname(ArgT0&& arg0, ArgT... args); + std::string* mutable_productname(); + PROTOBUF_NODISCARD std::string* release_productname(); + void set_allocated_productname(std::string* productname); + private: + const std::string& _internal_productname() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_productname(const std::string& value); + std::string* _internal_mutable_productname(); + public: + + // optional string fileName = 8; + bool has_filename() const; + private: + bool _internal_has_filename() const; + public: + void clear_filename(); + const std::string& filename() const; + template + void set_filename(ArgT0&& arg0, ArgT... args); + std::string* mutable_filename(); + PROTOBUF_NODISCARD std::string* release_filename(); + void set_allocated_filename(std::string* filename); + private: + const std::string& _internal_filename() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_filename(const std::string& value); + std::string* _internal_mutable_filename(); + public: + // optional .Odb.Lib.Protobuf.MiscInfoFile miscInfoFile = 2; bool has_miscinfofile() const; private: @@ -388,6 +426,8 @@ class ODBDESIGN_EXPORT FileArchive final : std::string, ::Odb::Lib::Protobuf::SymbolsDirectory, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE> symbolsdirectoriesbyname_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr productname_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr filename_; ::Odb::Lib::Protobuf::MiscInfoFile* miscinfofile_; ::Odb::Lib::Protobuf::MatrixFile* matrixfile_; ::Odb::Lib::Protobuf::StandardFontsFile* standardfontsfile_; @@ -439,7 +479,7 @@ FileArchive::mutable_stepsbyname() { // optional .Odb.Lib.Protobuf.MiscInfoFile miscInfoFile = 2; inline bool FileArchive::_internal_has_miscinfofile() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; PROTOBUF_ASSUME(!value || _impl_.miscinfofile_ != nullptr); return value; } @@ -462,14 +502,14 @@ inline void FileArchive::unsafe_arena_set_allocated_miscinfofile( } _impl_.miscinfofile_ = miscinfofile; if (miscinfofile) { - _impl_._has_bits_[0] |= 0x00000001u; + _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.FileArchive.miscInfoFile) } inline ::Odb::Lib::Protobuf::MiscInfoFile* FileArchive::release_miscinfofile() { - _impl_._has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000004u; ::Odb::Lib::Protobuf::MiscInfoFile* temp = _impl_.miscinfofile_; _impl_.miscinfofile_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE @@ -485,13 +525,13 @@ inline ::Odb::Lib::Protobuf::MiscInfoFile* FileArchive::release_miscinfofile() { } inline ::Odb::Lib::Protobuf::MiscInfoFile* FileArchive::unsafe_arena_release_miscinfofile() { // @@protoc_insertion_point(field_release:Odb.Lib.Protobuf.FileArchive.miscInfoFile) - _impl_._has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000004u; ::Odb::Lib::Protobuf::MiscInfoFile* temp = _impl_.miscinfofile_; _impl_.miscinfofile_ = nullptr; return temp; } inline ::Odb::Lib::Protobuf::MiscInfoFile* FileArchive::_internal_mutable_miscinfofile() { - _impl_._has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000004u; if (_impl_.miscinfofile_ == nullptr) { auto* p = CreateMaybeMessage<::Odb::Lib::Protobuf::MiscInfoFile>(GetArenaForAllocation()); _impl_.miscinfofile_ = p; @@ -516,9 +556,9 @@ inline void FileArchive::set_allocated_miscinfofile(::Odb::Lib::Protobuf::MiscIn miscinfofile = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, miscinfofile, submessage_arena); } - _impl_._has_bits_[0] |= 0x00000001u; + _impl_._has_bits_[0] |= 0x00000004u; } else { - _impl_._has_bits_[0] &= ~0x00000001u; + _impl_._has_bits_[0] &= ~0x00000004u; } _impl_.miscinfofile_ = miscinfofile; // @@protoc_insertion_point(field_set_allocated:Odb.Lib.Protobuf.FileArchive.miscInfoFile) @@ -526,7 +566,7 @@ inline void FileArchive::set_allocated_miscinfofile(::Odb::Lib::Protobuf::MiscIn // optional .Odb.Lib.Protobuf.MatrixFile matrixFile = 3; inline bool FileArchive::_internal_has_matrixfile() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; PROTOBUF_ASSUME(!value || _impl_.matrixfile_ != nullptr); return value; } @@ -549,14 +589,14 @@ inline void FileArchive::unsafe_arena_set_allocated_matrixfile( } _impl_.matrixfile_ = matrixfile; if (matrixfile) { - _impl_._has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000008u; } else { - _impl_._has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000008u; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:Odb.Lib.Protobuf.FileArchive.matrixFile) } inline ::Odb::Lib::Protobuf::MatrixFile* FileArchive::release_matrixfile() { - _impl_._has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000008u; ::Odb::Lib::Protobuf::MatrixFile* temp = _impl_.matrixfile_; _impl_.matrixfile_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE @@ -572,13 +612,13 @@ inline ::Odb::Lib::Protobuf::MatrixFile* FileArchive::release_matrixfile() { } inline ::Odb::Lib::Protobuf::MatrixFile* FileArchive::unsafe_arena_release_matrixfile() { // @@protoc_insertion_point(field_release:Odb.Lib.Protobuf.FileArchive.matrixFile) - _impl_._has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000008u; ::Odb::Lib::Protobuf::MatrixFile* temp = _impl_.matrixfile_; _impl_.matrixfile_ = nullptr; return temp; } inline ::Odb::Lib::Protobuf::MatrixFile* FileArchive::_internal_mutable_matrixfile() { - _impl_._has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000008u; if (_impl_.matrixfile_ == nullptr) { auto* p = CreateMaybeMessage<::Odb::Lib::Protobuf::MatrixFile>(GetArenaForAllocation()); _impl_.matrixfile_ = p; @@ -603,9 +643,9 @@ inline void FileArchive::set_allocated_matrixfile(::Odb::Lib::Protobuf::MatrixFi matrixfile = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, matrixfile, submessage_arena); } - _impl_._has_bits_[0] |= 0x00000002u; + _impl_._has_bits_[0] |= 0x00000008u; } else { - _impl_._has_bits_[0] &= ~0x00000002u; + _impl_._has_bits_[0] &= ~0x00000008u; } _impl_.matrixfile_ = matrixfile; // @@protoc_insertion_point(field_set_allocated:Odb.Lib.Protobuf.FileArchive.matrixFile) @@ -613,7 +653,7 @@ inline void FileArchive::set_allocated_matrixfile(::Odb::Lib::Protobuf::MatrixFi // optional .Odb.Lib.Protobuf.StandardFontsFile standardFontsFile = 4; inline bool FileArchive::_internal_has_standardfontsfile() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; PROTOBUF_ASSUME(!value || _impl_.standardfontsfile_ != nullptr); return value; } @@ -636,14 +676,14 @@ inline void FileArchive::unsafe_arena_set_allocated_standardfontsfile( } _impl_.standardfontsfile_ = standardfontsfile; if (standardfontsfile) { - _impl_._has_bits_[0] |= 0x00000004u; + _impl_._has_bits_[0] |= 0x00000010u; } else { - _impl_._has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000010u; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:Odb.Lib.Protobuf.FileArchive.standardFontsFile) } inline ::Odb::Lib::Protobuf::StandardFontsFile* FileArchive::release_standardfontsfile() { - _impl_._has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000010u; ::Odb::Lib::Protobuf::StandardFontsFile* temp = _impl_.standardfontsfile_; _impl_.standardfontsfile_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE @@ -659,13 +699,13 @@ inline ::Odb::Lib::Protobuf::StandardFontsFile* FileArchive::release_standardfon } inline ::Odb::Lib::Protobuf::StandardFontsFile* FileArchive::unsafe_arena_release_standardfontsfile() { // @@protoc_insertion_point(field_release:Odb.Lib.Protobuf.FileArchive.standardFontsFile) - _impl_._has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000010u; ::Odb::Lib::Protobuf::StandardFontsFile* temp = _impl_.standardfontsfile_; _impl_.standardfontsfile_ = nullptr; return temp; } inline ::Odb::Lib::Protobuf::StandardFontsFile* FileArchive::_internal_mutable_standardfontsfile() { - _impl_._has_bits_[0] |= 0x00000004u; + _impl_._has_bits_[0] |= 0x00000010u; if (_impl_.standardfontsfile_ == nullptr) { auto* p = CreateMaybeMessage<::Odb::Lib::Protobuf::StandardFontsFile>(GetArenaForAllocation()); _impl_.standardfontsfile_ = p; @@ -690,9 +730,9 @@ inline void FileArchive::set_allocated_standardfontsfile(::Odb::Lib::Protobuf::S standardfontsfile = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, standardfontsfile, submessage_arena); } - _impl_._has_bits_[0] |= 0x00000004u; + _impl_._has_bits_[0] |= 0x00000010u; } else { - _impl_._has_bits_[0] &= ~0x00000004u; + _impl_._has_bits_[0] &= ~0x00000010u; } _impl_.standardfontsfile_ = standardfontsfile; // @@protoc_insertion_point(field_set_allocated:Odb.Lib.Protobuf.FileArchive.standardFontsFile) @@ -726,7 +766,7 @@ FileArchive::mutable_symbolsdirectoriesbyname() { // optional .Odb.Lib.Protobuf.AttrListFile miscAttrListFile = 6; inline bool FileArchive::_internal_has_miscattrlistfile() const { - bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; + bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; PROTOBUF_ASSUME(!value || _impl_.miscattrlistfile_ != nullptr); return value; } @@ -749,14 +789,14 @@ inline void FileArchive::unsafe_arena_set_allocated_miscattrlistfile( } _impl_.miscattrlistfile_ = miscattrlistfile; if (miscattrlistfile) { - _impl_._has_bits_[0] |= 0x00000008u; + _impl_._has_bits_[0] |= 0x00000020u; } else { - _impl_._has_bits_[0] &= ~0x00000008u; + _impl_._has_bits_[0] &= ~0x00000020u; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:Odb.Lib.Protobuf.FileArchive.miscAttrListFile) } inline ::Odb::Lib::Protobuf::AttrListFile* FileArchive::release_miscattrlistfile() { - _impl_._has_bits_[0] &= ~0x00000008u; + _impl_._has_bits_[0] &= ~0x00000020u; ::Odb::Lib::Protobuf::AttrListFile* temp = _impl_.miscattrlistfile_; _impl_.miscattrlistfile_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE @@ -772,13 +812,13 @@ inline ::Odb::Lib::Protobuf::AttrListFile* FileArchive::release_miscattrlistfile } inline ::Odb::Lib::Protobuf::AttrListFile* FileArchive::unsafe_arena_release_miscattrlistfile() { // @@protoc_insertion_point(field_release:Odb.Lib.Protobuf.FileArchive.miscAttrListFile) - _impl_._has_bits_[0] &= ~0x00000008u; + _impl_._has_bits_[0] &= ~0x00000020u; ::Odb::Lib::Protobuf::AttrListFile* temp = _impl_.miscattrlistfile_; _impl_.miscattrlistfile_ = nullptr; return temp; } inline ::Odb::Lib::Protobuf::AttrListFile* FileArchive::_internal_mutable_miscattrlistfile() { - _impl_._has_bits_[0] |= 0x00000008u; + _impl_._has_bits_[0] |= 0x00000020u; if (_impl_.miscattrlistfile_ == nullptr) { auto* p = CreateMaybeMessage<::Odb::Lib::Protobuf::AttrListFile>(GetArenaForAllocation()); _impl_.miscattrlistfile_ = p; @@ -803,14 +843,150 @@ inline void FileArchive::set_allocated_miscattrlistfile(::Odb::Lib::Protobuf::At miscattrlistfile = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, miscattrlistfile, submessage_arena); } - _impl_._has_bits_[0] |= 0x00000008u; + _impl_._has_bits_[0] |= 0x00000020u; } else { - _impl_._has_bits_[0] &= ~0x00000008u; + _impl_._has_bits_[0] &= ~0x00000020u; } _impl_.miscattrlistfile_ = miscattrlistfile; // @@protoc_insertion_point(field_set_allocated:Odb.Lib.Protobuf.FileArchive.miscAttrListFile) } +// optional string productName = 7; +inline bool FileArchive::_internal_has_productname() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline bool FileArchive::has_productname() const { + return _internal_has_productname(); +} +inline void FileArchive::clear_productname() { + _impl_.productname_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const std::string& FileArchive::productname() const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.FileArchive.productName) + return _internal_productname(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void FileArchive::set_productname(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.productname_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:Odb.Lib.Protobuf.FileArchive.productName) +} +inline std::string* FileArchive::mutable_productname() { + std::string* _s = _internal_mutable_productname(); + // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.FileArchive.productName) + return _s; +} +inline const std::string& FileArchive::_internal_productname() const { + return _impl_.productname_.Get(); +} +inline void FileArchive::_internal_set_productname(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000001u; + _impl_.productname_.Set(value, GetArenaForAllocation()); +} +inline std::string* FileArchive::_internal_mutable_productname() { + _impl_._has_bits_[0] |= 0x00000001u; + return _impl_.productname_.Mutable(GetArenaForAllocation()); +} +inline std::string* FileArchive::release_productname() { + // @@protoc_insertion_point(field_release:Odb.Lib.Protobuf.FileArchive.productName) + if (!_internal_has_productname()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000001u; + auto* p = _impl_.productname_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.productname_.IsDefault()) { + _impl_.productname_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void FileArchive::set_allocated_productname(std::string* productname) { + if (productname != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.productname_.SetAllocated(productname, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.productname_.IsDefault()) { + _impl_.productname_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:Odb.Lib.Protobuf.FileArchive.productName) +} + +// optional string fileName = 8; +inline bool FileArchive::_internal_has_filename() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool FileArchive::has_filename() const { + return _internal_has_filename(); +} +inline void FileArchive::clear_filename() { + _impl_.filename_.ClearToEmpty(); + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline const std::string& FileArchive::filename() const { + // @@protoc_insertion_point(field_get:Odb.Lib.Protobuf.FileArchive.fileName) + return _internal_filename(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void FileArchive::set_filename(ArgT0&& arg0, ArgT... args) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.filename_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:Odb.Lib.Protobuf.FileArchive.fileName) +} +inline std::string* FileArchive::mutable_filename() { + std::string* _s = _internal_mutable_filename(); + // @@protoc_insertion_point(field_mutable:Odb.Lib.Protobuf.FileArchive.fileName) + return _s; +} +inline const std::string& FileArchive::_internal_filename() const { + return _impl_.filename_.Get(); +} +inline void FileArchive::_internal_set_filename(const std::string& value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.filename_.Set(value, GetArenaForAllocation()); +} +inline std::string* FileArchive::_internal_mutable_filename() { + _impl_._has_bits_[0] |= 0x00000002u; + return _impl_.filename_.Mutable(GetArenaForAllocation()); +} +inline std::string* FileArchive::release_filename() { + // @@protoc_insertion_point(field_release:Odb.Lib.Protobuf.FileArchive.fileName) + if (!_internal_has_filename()) { + return nullptr; + } + _impl_._has_bits_[0] &= ~0x00000002u; + auto* p = _impl_.filename_.Release(); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.filename_.IsDefault()) { + _impl_.filename_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + return p; +} +inline void FileArchive::set_allocated_filename(std::string* filename) { + if (filename != nullptr) { + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + _impl_.filename_.SetAllocated(filename, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.filename_.IsDefault()) { + _impl_.filename_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:Odb.Lib.Protobuf.FileArchive.fileName) +} + #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ diff --git a/OdbDesignLib/protoc/filearchive.proto b/OdbDesignLib/protoc/filearchive.proto index 295e6c0d..1e79548f 100644 --- a/OdbDesignLib/protoc/filearchive.proto +++ b/OdbDesignLib/protoc/filearchive.proto @@ -24,5 +24,7 @@ message FileArchive { optional StandardFontsFile standardFontsFile = 4; map symbolsDirectoriesByName = 5; optional AttrListFile miscAttrListFile = 6; + optional string productName = 7; + optional string fileName = 8; } \ No newline at end of file From 695e2fac6d07e8d85b3268bc15d48e3831c2072e Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sun, 28 Jan 2024 14:19:10 -0800 Subject: [PATCH 23/42] add cases testing protobuf roundtrip serialization --- OdbDesignTests/ProtobufSerializationTests.cpp | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) diff --git a/OdbDesignTests/ProtobufSerializationTests.cpp b/OdbDesignTests/ProtobufSerializationTests.cpp index e69de29b..cfcec34c 100644 --- a/OdbDesignTests/ProtobufSerializationTests.cpp +++ b/OdbDesignTests/ProtobufSerializationTests.cpp @@ -0,0 +1,132 @@ +#include +#include +#include "Fixtures/FileArchiveLoadFixture.h" +#include "OdbDesign.h" +//#include "gtest/gtest-matchers.h" + + +//using namespace Odb::Lib::App; +using namespace Odb::Lib::FileModel; +using namespace Odb::Test::Fixtures; +using namespace std::filesystem; +using namespace testing; +using namespace Odb::Lib::ProductModel; + +namespace Odb::Test +{ + TEST_F(FileArchiveLoadFixture, Component_ProtoBuf_RoundTrip_sample_design_Succeeds) + { + //ASSERT_TRUE(exists(getDesignPath("sample_design.tgz"))); + auto pDesign = m_pDesignCache->GetDesign("sample_design"); + ASSERT_THAT(pDesign, NotNull()); + + auto pComponent = pDesign->GetComponent("U19"); + ASSERT_THAT(pComponent, NotNull()); + + auto pComponentMsg = pComponent->to_protobuf(); + ASSERT_THAT(pComponentMsg, NotNull()); + + auto pComponentFromMsg = std::unique_ptr(Component::MakeEmpty()); + pComponentFromMsg->from_protobuf(*pComponentMsg); + + ASSERT_EQ(pComponent->GetRefDes(), pComponentFromMsg->GetRefDes()); + ASSERT_EQ(pComponent->GetIndex(), pComponentFromMsg->GetIndex()); + ASSERT_EQ(pComponent->GetSide(), pComponentFromMsg->GetSide()); + ASSERT_EQ(pComponent->GetPackage()->GetName(), pComponentFromMsg->GetPackage()->GetName()); + ASSERT_EQ(pComponent->GetPart()->GetName(), pComponentFromMsg->GetPart()->GetName()); + } + + TEST_F(FileArchiveLoadFixture, Design_ProtoBuf_RoundTrip_sample_design_Succeeds) + { + //ASSERT_TRUE(exists(getDesignPath("sample_design.tgz"))); + auto pDesign = m_pDesignCache->GetDesign("sample_design"); + ASSERT_THAT(pDesign, NotNull()); + + auto pDesignMsg = pDesign->to_protobuf(); + ASSERT_THAT(pDesignMsg, NotNull()); + + auto pDesignFromMsg = std::make_unique(); + pDesignFromMsg->from_protobuf(*pDesignMsg); + + ASSERT_EQ(pDesign->GetName(), pDesignFromMsg->GetName()); + ASSERT_EQ(pDesign->GetProductModel(), pDesignFromMsg->GetProductModel()); + ASSERT_EQ(pDesign->GetComponents().size(), pDesignFromMsg->GetComponents().size()); + //ASSERT_THAT(pDesign->GetComponents(), ContainerEq(pDesignFromMsg->GetComponents())); + } + + TEST_F(FileArchiveLoadFixture, FileArchive_ProtoBuf_RoundTrip_sample_design_Succeeds) + { + //ASSERT_TRUE(exists(getDesignPath("sample_design.tgz"))); + auto pFileArchive = m_pDesignCache->GetFileArchive("sample_design"); + ASSERT_THAT(pFileArchive, NotNull()); + + auto pFileArchiveMsg = pFileArchive->to_protobuf(); + ASSERT_THAT(pFileArchiveMsg, NotNull()); + + auto pFileArchiveFromMsg = std::make_unique(""); + pFileArchiveFromMsg->from_protobuf(*pFileArchiveMsg); + + ASSERT_EQ(pFileArchive->GetProductName(), pFileArchiveFromMsg->GetProductName()); + //ASSERT_EQ(pFileArchive->GetFilename(), pFileArchiveFromMsg->GetFilename()); + ASSERT_EQ(pFileArchive->GetSymbolsDirectoriesByName().size(), pFileArchiveFromMsg->GetSymbolsDirectoriesByName().size()); + //ASSERT_THAT(pDesign->GetComponents(), ContainerEq(pDesignFromMsg->GetComponents())); + } + + TEST_F(FileArchiveLoadFixture, Component_ProtoBuf_RoundTrip_designodb_rigidflex_Succeeds) + { + //ASSERT_TRUE(exists(getDesignPath("sample_design.tgz"))); + auto pDesign = m_pDesignCache->GetDesign("designodb_rigidflex"); + ASSERT_THAT(pDesign, NotNull()); + + auto pComponent = pDesign->GetComponent("R56"); + ASSERT_THAT(pComponent, NotNull()); + + auto pComponentMsg = pComponent->to_protobuf(); + ASSERT_THAT(pComponentMsg, NotNull()); + + auto pComponentFromMsg = std::unique_ptr(Component::MakeEmpty()); + pComponentFromMsg->from_protobuf(*pComponentMsg); + + ASSERT_EQ(pComponent->GetRefDes(), pComponentFromMsg->GetRefDes()); + ASSERT_EQ(pComponent->GetIndex(), pComponentFromMsg->GetIndex()); + ASSERT_EQ(pComponent->GetSide(), pComponentFromMsg->GetSide()); + ASSERT_EQ(pComponent->GetPackage()->GetName(), pComponentFromMsg->GetPackage()->GetName()); + ASSERT_EQ(pComponent->GetPart()->GetName(), pComponentFromMsg->GetPart()->GetName()); + } + + TEST_F(FileArchiveLoadFixture, Design_ProtoBuf_RoundTrip_designodb_rigidflex_Succeeds) + { + //ASSERT_TRUE(exists(getDesignPath("sample_design.tgz"))); + auto pDesign = m_pDesignCache->GetDesign("designodb_rigidflex"); + ASSERT_THAT(pDesign, NotNull()); + + auto pDesignMsg = pDesign->to_protobuf(); + ASSERT_THAT(pDesignMsg, NotNull()); + + auto pDesignFromMsg = std::make_unique(); + pDesignFromMsg->from_protobuf(*pDesignMsg); + + ASSERT_EQ(pDesign->GetName(), pDesignFromMsg->GetName()); + ASSERT_EQ(pDesign->GetProductModel(), pDesignFromMsg->GetProductModel()); + ASSERT_EQ(pDesign->GetComponents().size(), pDesignFromMsg->GetComponents().size()); + //ASSERT_THAT(pDesign->GetComponents(), ContainerEq(pDesignFromMsg->GetComponents())); + } + + TEST_F(FileArchiveLoadFixture, FileArchive_ProtoBuf_RoundTrip_designodb_rigidflex_Succeeds) + { + //ASSERT_TRUE(exists(getDesignPath("sample_design.tgz"))); + auto pFileArchive = m_pDesignCache->GetFileArchive("designodb_rigidflex"); + ASSERT_THAT(pFileArchive, NotNull()); + + auto pFileArchiveMsg = pFileArchive->to_protobuf(); + ASSERT_THAT(pFileArchiveMsg, NotNull()); + + auto pFileArchiveFromMsg = std::make_unique(""); + pFileArchiveFromMsg->from_protobuf(*pFileArchiveMsg); + + ASSERT_EQ(pFileArchive->GetProductName(), pFileArchiveFromMsg->GetProductName()); + ASSERT_EQ(pFileArchive->GetFilename(), pFileArchiveFromMsg->GetFilename()); + ASSERT_EQ(pFileArchive->GetSymbolsDirectoriesByName().size(), pFileArchiveFromMsg->GetSymbolsDirectoriesByName().size()); + //ASSERT_THAT(pDesign->GetComponents(), ContainerEq(pDesignFromMsg->GetComponents())); + } +} \ No newline at end of file From 88d9b23a2552e2e6fb72db617c4d86c98c9c0e13 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sun, 28 Jan 2024 14:19:44 -0800 Subject: [PATCH 24/42] fix MakeName() to not throw exception if constituent parts are null --- OdbDesignLib/ProductModel/PinConnection.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OdbDesignLib/ProductModel/PinConnection.cpp b/OdbDesignLib/ProductModel/PinConnection.cpp index e9e0e419..7afa9ef3 100644 --- a/OdbDesignLib/ProductModel/PinConnection.cpp +++ b/OdbDesignLib/ProductModel/PinConnection.cpp @@ -20,7 +20,8 @@ namespace Odb::Lib::ProductModel } std::string PinConnection::MakeName(std::shared_ptr& pComponent, std::shared_ptr& pPin) - { + { + if (pComponent == nullptr || pPin == nullptr) return "Pin::MakeName() FAILED"; return pComponent->GetRefDes() + "-" + pPin->GetName(); } From 91ce0a6f82813bdf034fb02d8dd27c288ed88e66 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sun, 28 Jan 2024 14:20:03 -0800 Subject: [PATCH 25/42] use ctor with explicit name argument --- OdbDesignLib/ProductModel/Net.cpp | 2 +- OdbDesignLib/ProductModel/PinConnection.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/OdbDesignLib/ProductModel/Net.cpp b/OdbDesignLib/ProductModel/Net.cpp index 8da1faa0..d93a75c3 100644 --- a/OdbDesignLib/ProductModel/Net.cpp +++ b/OdbDesignLib/ProductModel/Net.cpp @@ -53,7 +53,7 @@ namespace Odb::Lib::ProductModel m_index = message.index(); for (auto& pinConnectionMsg : message.pinconnections()) { - auto pPinConnection = std::make_shared(nullptr, nullptr); + auto pPinConnection = std::make_shared(nullptr, nullptr, ""); pPinConnection->from_protobuf(pinConnectionMsg); m_pinConnections.push_back(pPinConnection); } diff --git a/OdbDesignLib/ProductModel/PinConnection.h b/OdbDesignLib/ProductModel/PinConnection.h index 9ed94efe..7d23dba4 100644 --- a/OdbDesignLib/ProductModel/PinConnection.h +++ b/OdbDesignLib/ProductModel/PinConnection.h @@ -16,14 +16,15 @@ namespace Odb::Lib::ProductModel class ODBDESIGN_EXPORT PinConnection : public IProtoBuffable { public: - PinConnection(std::shared_ptr pComponent, std::shared_ptr pPin); - std::string MakeName(std::shared_ptr& pComponent, std::shared_ptr& pPin); + PinConnection(std::shared_ptr pComponent, std::shared_ptr pPin); PinConnection(std::shared_ptr pComponent, std::shared_ptr pPin, std::string name); //~PinConnection(); std::shared_ptr GetPin() const; std::shared_ptr GetComponent() const; + std::string MakeName(std::shared_ptr& pComponent, std::shared_ptr& pPin); + // Inherited via IProtoBuffable std::unique_ptr to_protobuf() const override; void from_protobuf(const Odb::Lib::Protobuf::ProductModel::PinConnection& message) override; From 338afc7b4e05df9d26158e9c85c6c62b6eeecf2e Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Sun, 28 Jan 2024 14:22:06 -0800 Subject: [PATCH 26/42] remove test for filename equality --- OdbDesignTests/ProtobufSerializationTests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OdbDesignTests/ProtobufSerializationTests.cpp b/OdbDesignTests/ProtobufSerializationTests.cpp index cfcec34c..f616e6d2 100644 --- a/OdbDesignTests/ProtobufSerializationTests.cpp +++ b/OdbDesignTests/ProtobufSerializationTests.cpp @@ -125,7 +125,7 @@ namespace Odb::Test pFileArchiveFromMsg->from_protobuf(*pFileArchiveMsg); ASSERT_EQ(pFileArchive->GetProductName(), pFileArchiveFromMsg->GetProductName()); - ASSERT_EQ(pFileArchive->GetFilename(), pFileArchiveFromMsg->GetFilename()); + //ASSERT_EQ(pFileArchive->GetFilename(), pFileArchiveFromMsg->GetFilename()); ASSERT_EQ(pFileArchive->GetSymbolsDirectoriesByName().size(), pFileArchiveFromMsg->GetSymbolsDirectoriesByName().size()); //ASSERT_THAT(pDesign->GetComponents(), ContainerEq(pDesignFromMsg->GetComponents())); } From 049ee5a9e2d14edf85e9b3f5d3d72afc355ddd2b Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Mon, 29 Jan 2024 07:23:37 -0800 Subject: [PATCH 27/42] fix warning --- OdbDesignTests/Fixtures/FileArchiveLoadFixture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OdbDesignTests/Fixtures/FileArchiveLoadFixture.cpp b/OdbDesignTests/Fixtures/FileArchiveLoadFixture.cpp index 5908adff..81e99ba4 100644 --- a/OdbDesignTests/Fixtures/FileArchiveLoadFixture.cpp +++ b/OdbDesignTests/Fixtures/FileArchiveLoadFixture.cpp @@ -32,7 +32,7 @@ namespace Odb::Test::Fixtures std::string FileArchiveLoadFixture::getTestDataDir() { auto szTestDataDir = std::getenv(ODB_TEST_DATA_DIR_ENV_NAME); - if (szTestDataDir == nullptr) szTestDataDir = ""; + if (szTestDataDir == nullptr) return ""; //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; From 0683a301cbf83c79d89ab0940d7e810f5a5884d8 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Mon, 29 Jan 2024 07:26:01 -0800 Subject: [PATCH 28/42] make method static --- OdbDesignTests/Fixtures/FileArchiveLoadFixture.cpp | 2 +- OdbDesignTests/Fixtures/FileArchiveLoadFixture.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OdbDesignTests/Fixtures/FileArchiveLoadFixture.cpp b/OdbDesignTests/Fixtures/FileArchiveLoadFixture.cpp index 81e99ba4..4562438e 100644 --- a/OdbDesignTests/Fixtures/FileArchiveLoadFixture.cpp +++ b/OdbDesignTests/Fixtures/FileArchiveLoadFixture.cpp @@ -29,7 +29,7 @@ namespace Odb::Test::Fixtures ASSERT_NE(m_pDesignCache, nullptr); } - std::string FileArchiveLoadFixture::getTestDataDir() + /*static*/ std::string FileArchiveLoadFixture::getTestDataDir() { auto szTestDataDir = std::getenv(ODB_TEST_DATA_DIR_ENV_NAME); if (szTestDataDir == nullptr) return ""; diff --git a/OdbDesignTests/Fixtures/FileArchiveLoadFixture.h b/OdbDesignTests/Fixtures/FileArchiveLoadFixture.h index 7ae12555..aae0c28a 100644 --- a/OdbDesignTests/Fixtures/FileArchiveLoadFixture.h +++ b/OdbDesignTests/Fixtures/FileArchiveLoadFixture.h @@ -22,7 +22,7 @@ namespace Odb::Test::Fixtures void SetUp() override; void TearDown() override; - std::string getTestDataDir(); + static 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"; From bf543d5e3f773d3cf3c7c63bb671edaaf40fe765 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Mon, 29 Jan 2024 07:31:14 -0800 Subject: [PATCH 29/42] minor change --- OdbDesignTests/Fixtures/FileArchiveLoadFixture.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OdbDesignTests/Fixtures/FileArchiveLoadFixture.h b/OdbDesignTests/Fixtures/FileArchiveLoadFixture.h index aae0c28a..44780329 100644 --- a/OdbDesignTests/Fixtures/FileArchiveLoadFixture.h +++ b/OdbDesignTests/Fixtures/FileArchiveLoadFixture.h @@ -8,7 +8,7 @@ namespace Odb::Test::Fixtures { - class FileArchiveLoadFixture : public ::testing::Test + class FileArchiveLoadFixture : public testing::Test { public: FileArchiveLoadFixture(); From 1aa3e89303e258efcc1e3b440f4f9e66a852ff88 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Mon, 29 Jan 2024 07:35:20 -0800 Subject: [PATCH 30/42] cleanup, remove some comments --- OdbDesignTests/ProtobufSerializationTests.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/OdbDesignTests/ProtobufSerializationTests.cpp b/OdbDesignTests/ProtobufSerializationTests.cpp index f616e6d2..ff6739b3 100644 --- a/OdbDesignTests/ProtobufSerializationTests.cpp +++ b/OdbDesignTests/ProtobufSerializationTests.cpp @@ -15,8 +15,7 @@ using namespace Odb::Lib::ProductModel; namespace Odb::Test { TEST_F(FileArchiveLoadFixture, Component_ProtoBuf_RoundTrip_sample_design_Succeeds) - { - //ASSERT_TRUE(exists(getDesignPath("sample_design.tgz"))); + { auto pDesign = m_pDesignCache->GetDesign("sample_design"); ASSERT_THAT(pDesign, NotNull()); @@ -38,7 +37,6 @@ namespace Odb::Test TEST_F(FileArchiveLoadFixture, Design_ProtoBuf_RoundTrip_sample_design_Succeeds) { - //ASSERT_TRUE(exists(getDesignPath("sample_design.tgz"))); auto pDesign = m_pDesignCache->GetDesign("sample_design"); ASSERT_THAT(pDesign, NotNull()); @@ -56,7 +54,6 @@ namespace Odb::Test TEST_F(FileArchiveLoadFixture, FileArchive_ProtoBuf_RoundTrip_sample_design_Succeeds) { - //ASSERT_TRUE(exists(getDesignPath("sample_design.tgz"))); auto pFileArchive = m_pDesignCache->GetFileArchive("sample_design"); ASSERT_THAT(pFileArchive, NotNull()); @@ -74,7 +71,6 @@ namespace Odb::Test TEST_F(FileArchiveLoadFixture, Component_ProtoBuf_RoundTrip_designodb_rigidflex_Succeeds) { - //ASSERT_TRUE(exists(getDesignPath("sample_design.tgz"))); auto pDesign = m_pDesignCache->GetDesign("designodb_rigidflex"); ASSERT_THAT(pDesign, NotNull()); @@ -96,7 +92,6 @@ namespace Odb::Test TEST_F(FileArchiveLoadFixture, Design_ProtoBuf_RoundTrip_designodb_rigidflex_Succeeds) { - //ASSERT_TRUE(exists(getDesignPath("sample_design.tgz"))); auto pDesign = m_pDesignCache->GetDesign("designodb_rigidflex"); ASSERT_THAT(pDesign, NotNull()); @@ -114,7 +109,6 @@ namespace Odb::Test TEST_F(FileArchiveLoadFixture, FileArchive_ProtoBuf_RoundTrip_designodb_rigidflex_Succeeds) { - //ASSERT_TRUE(exists(getDesignPath("sample_design.tgz"))); auto pFileArchive = m_pDesignCache->GetFileArchive("designodb_rigidflex"); ASSERT_THAT(pFileArchive, NotNull()); From 80109dec81ec6aa03b20abd3ceaa07cd09680b60 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Mon, 29 Jan 2024 07:35:57 -0800 Subject: [PATCH 31/42] add test case that test data sample designs exist --- OdbDesignTests/TestTests.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OdbDesignTests/TestTests.cpp b/OdbDesignTests/TestTests.cpp index 211fa881..2e8253e5 100644 --- a/OdbDesignTests/TestTests.cpp +++ b/OdbDesignTests/TestTests.cpp @@ -34,4 +34,10 @@ namespace Odb::Test ASSERT_FALSE(getTestDataDir().empty()); EXPECT_TRUE(exists(getTestDataDir())); } + + TEST_F(FileArchiveLoadFixture, TestDataDesignsExist) + { + ASSERT_TRUE(exists(getDesignPath("sample_design.tgz"))); + ASSERT_TRUE(exists(getDesignPath("designodb_rigidflex.tgz"))); + } } From af2fc602002e8e945cdcbee24cd85738d1327ebb Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Mon, 29 Jan 2024 10:56:10 -0800 Subject: [PATCH 32/42] fix typo --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 31c28226..da42bbf7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,5 +95,5 @@ if (DOXYGEN_FOUND) COMMENT "Generating API documentation with Doxygen" VERBATIM ) else (DOXYGEN_FOUND) - message("Doxygen need to be installed to generate the doxygen documentation") + message("Doxygen needs to be installed to generate the doxygen documentation") endif (DOXYGEN_FOUND) From 8fa62233650bc0d5cf7abc60bbc98de08bdeb6fc Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Mon, 29 Jan 2024 10:56:48 -0800 Subject: [PATCH 33/42] add (disabled/commented-out) define for disabling crow's json error-checking --- Utils/crow_win.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Utils/crow_win.h b/Utils/crow_win.h index 0b9131d8..c4670974 100644 --- a/Utils/crow_win.h +++ b/Utils/crow_win.h @@ -1,5 +1,9 @@ #pragma once +// disable error-checking in crow's json code to improve its performance +// https://crowcpp.org/master/guides/json/ +//#define CROW_JSON_NO_ERROR_CHECK + #include "win.h" #include "crow.h" #include "crow/middlewares/cors.h" From d6cfce4439aeb80ce34c4103d5fc3bcddfd4255f Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Mon, 29 Jan 2024 10:57:09 -0800 Subject: [PATCH 34/42] add crow_win.h to target's source files --- Utils/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utils/CMakeLists.txt b/Utils/CMakeLists.txt index adea8b1c..64987dbe 100644 --- a/Utils/CMakeLists.txt +++ b/Utils/CMakeLists.txt @@ -1,7 +1,7 @@ # CMakeList.txt : CMake project for OdbDesignServer # -add_library(Utils SHARED "utils_export.h" "ExitCode.h" "ThreadSafeQueue.h" "WorkQueueLoopThread.h" "Logger.h" "Logger.cpp" "CommandLineArgs.h" "CommandLineArgs.cpp" "bin2ascii.h" "ArchiveExtractor.cpp" "ArchiveExtractor.h" "libarchive_extract.cpp" "libarchive_extract.h" "str_utils.cpp" "str_utils.h" "IJsonable.h" "IJsonable.cpp" "CrowReturnable.h" "JsonCrowReturnable.h" "timestamp.h" "timestamp.cpp" "StopWatch.h" "StopWatch.cpp" "UrlEncoding.h" "UrlEncoding.cpp" "StringVector.h" "equals_within.h" "equals_within.cpp") +add_library(Utils SHARED "utils_export.h" "ExitCode.h" "ThreadSafeQueue.h" "WorkQueueLoopThread.h" "Logger.h" "Logger.cpp" "CommandLineArgs.h" "CommandLineArgs.cpp" "bin2ascii.h" "ArchiveExtractor.cpp" "ArchiveExtractor.h" "libarchive_extract.cpp" "libarchive_extract.h" "str_utils.cpp" "str_utils.h" "IJsonable.h" "IJsonable.cpp" "CrowReturnable.h" "JsonCrowReturnable.h" "timestamp.h" "timestamp.cpp" "StopWatch.h" "StopWatch.cpp" "UrlEncoding.h" "UrlEncoding.cpp" "StringVector.h" "equals_within.h" "equals_within.cpp" "crow_win.h") # state that anybody linking to us needs to include the current source dir, # while we don't. From b5dd70b84b6d2490560463b6dcaf91924b0bc81e Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Mon, 29 Jan 2024 10:58:51 -0800 Subject: [PATCH 35/42] implement product model (designs) endpoints Fixes: #25 --- .../Controllers/DesignsController.cpp | 172 +++++++++++++----- 1 file changed, 122 insertions(+), 50 deletions(-) diff --git a/OdbDesignServer/Controllers/DesignsController.cpp b/OdbDesignServer/Controllers/DesignsController.cpp index 2d88091c..e5c5b22b 100644 --- a/OdbDesignServer/Controllers/DesignsController.cpp +++ b/OdbDesignServer/Controllers/DesignsController.cpp @@ -53,18 +53,18 @@ namespace Odb::App::Server return this->designs_components_route_handler(designName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/designs//components/") - ([&](const crow::request& req, std::string designName, std::string refDes) - { - // authenticate request before sending to handler - auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); - if (authResp.code != crow::status::OK) - { - return authResp; - } - - return this->designs_component_route_handler(designName, refDes, req); - }); + //CROW_ROUTE(m_serverApp.crow_app(), "/designs//components/") + // ([&](const crow::request& req, std::string designName, std::string refDes) + // { + // // authenticate request before sending to handler + // auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + // if (authResp.code != crow::status::OK) + // { + // return authResp; + // } + + // return this->designs_component_route_handler(designName, refDes, req); + // }); CROW_ROUTE(m_serverApp.crow_app(), "/designs//nets") ([&](const crow::request& req, std::string designName) @@ -79,18 +79,18 @@ namespace Odb::App::Server return this->designs_nets_route_handler(designName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/designs//nets/") - ([&](const crow::request& req, std::string designName, std::string netName) - { - // authenticate request before sending to handler - auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); - if (authResp.code != crow::status::OK) - { - return authResp; - } + //CROW_ROUTE(m_serverApp.crow_app(), "/designs//nets/") + // ([&](const crow::request& req, std::string designName, std::string netName) + // { + // // authenticate request before sending to handler + // auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + // if (authResp.code != crow::status::OK) + // { + // return authResp; + // } - return this->designs_net_route_handler(designName, netName, req); - }); + // return this->designs_net_route_handler(designName, netName, req); + // }); CROW_ROUTE(m_serverApp.crow_app(), "/designs//packages") ([&](const crow::request& req, std::string designName) @@ -105,18 +105,18 @@ namespace Odb::App::Server return this->designs_packages_route_handler(designName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/designs//packages/") - ([&](const crow::request& req, std::string designName, std::string packageName) - { - // authenticate request before sending to handler - auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); - if (authResp.code != crow::status::OK) - { - return authResp; - } + //CROW_ROUTE(m_serverApp.crow_app(), "/designs//packages/") + // ([&](const crow::request& req, std::string designName, std::string packageName) + // { + // // authenticate request before sending to handler + // auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + // if (authResp.code != crow::status::OK) + // { + // return authResp; + // } - return this->designs_package_route_handler(designName, packageName, req); - }); + // return this->designs_package_route_handler(designName, packageName, req); + // }); CROW_ROUTE(m_serverApp.crow_app(), "/designs//parts") ([&](const crow::request& req, std::string designName) @@ -131,18 +131,18 @@ namespace Odb::App::Server return this->designs_parts_route_handler(designName, req); }); - CROW_ROUTE(m_serverApp.crow_app(), "/designs//parts/") - ([&](const crow::request& req, std::string designName, std::string partName) - { - // authenticate request before sending to handler - auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); - if (authResp.code != crow::status::OK) - { - return authResp; - } - - return this->designs_part_route_handler(designName, partName, req); - }); + //CROW_ROUTE(m_serverApp.crow_app(), "/designs//parts/") + // ([&](const crow::request& req, std::string designName, std::string partName) + // { + // // authenticate request before sending to handler + // auto authResp = m_serverApp.request_auth().AuthenticateRequest(req); + // if (authResp.code != crow::status::OK) + // { + // return authResp; + // } + + // return this->designs_part_route_handler(designName, partName, req); + // }); } crow::response DesignsController::designs_list_route_handler(const crow::request& req) @@ -203,7 +203,7 @@ namespace Odb::App::Server } crow::json::wvalue wv; - wv["components"] = std::move(rvComponents); + wv = std::move(rvComponents); return crow::response(wv); } @@ -214,7 +214,31 @@ namespace Odb::App::Server crow::response DesignsController::designs_nets_route_handler(std::string designName, const crow::request& req) { - return crow::response(); + auto designNameDecoded = UrlEncoding::decode(designName); + if (designNameDecoded.empty()) + { + return crow::response(crow::status::BAD_REQUEST, "design name not specified"); + } + + auto pDesign = m_serverApp.designs().GetDesign(designNameDecoded); + if (pDesign == nullptr) + { + std::stringstream ss; + ss << "design: \"" << designNameDecoded << "\" not found"; + return crow::response(crow::status::NOT_FOUND, ss.str()); + } + + std::vector rvNets; + + const auto& nets = pDesign->GetNets(); + for (const auto& net : nets) + { + rvNets.push_back(crow::json::load(net->to_json())); + } + + crow::json::wvalue wv; + wv = std::move(rvNets); + return crow::response(wv); } crow::response DesignsController::designs_net_route_handler(std::string designName, std::string netName, const crow::request& req) @@ -224,7 +248,31 @@ namespace Odb::App::Server crow::response DesignsController::designs_parts_route_handler(std::string designName, const crow::request& req) { - return crow::response(); + auto designNameDecoded = UrlEncoding::decode(designName); + if (designNameDecoded.empty()) + { + return crow::response(crow::status::BAD_REQUEST, "design name not specified"); + } + + auto pDesign = m_serverApp.designs().GetDesign(designNameDecoded); + if (pDesign == nullptr) + { + std::stringstream ss; + ss << "design: \"" << designNameDecoded << "\" not found"; + return crow::response(crow::status::NOT_FOUND, ss.str()); + } + + std::vector rvParts; + + const auto& parts = pDesign->GetParts(); + for (const auto& part : parts) + { + rvParts.push_back(crow::json::load(part->to_json())); + } + + crow::json::wvalue wv; + wv = std::move(rvParts); + return crow::response(wv); } crow::response DesignsController::designs_part_route_handler(std::string designName, std::string partName, const crow::request& req) @@ -234,7 +282,31 @@ namespace Odb::App::Server crow::response DesignsController::designs_packages_route_handler(std::string designName, const crow::request& req) { - return crow::response(); + auto designNameDecoded = UrlEncoding::decode(designName); + if (designNameDecoded.empty()) + { + return crow::response(crow::status::BAD_REQUEST, "design name not specified"); + } + + auto pDesign = m_serverApp.designs().GetDesign(designNameDecoded); + if (pDesign == nullptr) + { + std::stringstream ss; + ss << "design: \"" << designNameDecoded << "\" not found"; + return crow::response(crow::status::NOT_FOUND, ss.str()); + } + + std::vector rvPackages; + + const auto& packages = pDesign->GetPackages(); + for (const auto& package : packages) + { + rvPackages.push_back(crow::json::load(package->to_json())); + } + + crow::json::wvalue wv; + wv = std::move(rvPackages); + return crow::response(wv); } crow::response DesignsController::designs_package_route_handler(std::string designName, std::string packageName, const crow::request& req) From 7cce026d7378fbd6ac76c60a920a5ab9d1932882 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Mon, 29 Jan 2024 10:58:58 -0800 Subject: [PATCH 36/42] minor change --- OdbDesignLib/ProductModel/Design.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OdbDesignLib/ProductModel/Design.h b/OdbDesignLib/ProductModel/Design.h index 68bd3717..ab552113 100644 --- a/OdbDesignLib/ProductModel/Design.h +++ b/OdbDesignLib/ProductModel/Design.h @@ -27,6 +27,7 @@ namespace Odb::Lib::ProductModel const Net::Vector& GetNets() const; const Net::StringMap GetNetsByName() const; + std::shared_ptr GetNet(const std::string& name) const; const Package::Vector& GetPackages() const; const Package::StringMap& GetPackagesByName() const; @@ -37,8 +38,7 @@ namespace Odb::Lib::ProductModel const Part::Vector& GetParts() const; const Part::StringMap& GetPartsByName() const; - - std::shared_ptr GetNet(const std::string& name) const; + std::shared_ptr GetNoneNet() const; bool Build(std::string path); From 0a324592a929e18c5a98463424551b6b653902f3 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Mon, 29 Jan 2024 11:13:17 -0800 Subject: [PATCH 37/42] use matcher in test case --- OdbDesignTests/TestTests.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OdbDesignTests/TestTests.cpp b/OdbDesignTests/TestTests.cpp index 2e8253e5..2a85f707 100644 --- a/OdbDesignTests/TestTests.cpp +++ b/OdbDesignTests/TestTests.cpp @@ -1,9 +1,11 @@ #include +#include #include "Fixtures/FileArchiveLoadFixture.h" #include using namespace std::filesystem; using namespace Odb::Test::Fixtures; +using namespace testing; namespace Odb::Test { @@ -26,7 +28,8 @@ namespace Odb::Test TEST_F(FileArchiveLoadFixture, TestDataDirEnvironmentVariablesExists) { - ASSERT_FALSE(getTestDataDir().empty()); + //ASSERT_FALSE(getTestDataDir().empty()); + EXPECT_THAT(getTestDataDir(), Not(IsEmpty())); } TEST_F(FileArchiveLoadFixture, TestDataDirDirectoryExists) From 0d6d19cf5120fca0ba9d64a1242568724481e760 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Tue, 30 Jan 2024 14:02:44 -0800 Subject: [PATCH 38/42] update swagger spec --- swagger/odbdesign-server-0.9-swagger.yaml | 79 +++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/swagger/odbdesign-server-0.9-swagger.yaml b/swagger/odbdesign-server-0.9-swagger.yaml index 3e8a1db4..30e40eb7 100644 --- a/swagger/odbdesign-server-0.9-swagger.yaml +++ b/swagger/odbdesign-server-0.9-swagger.yaml @@ -19,6 +19,7 @@ tags: - name: "steps" - name: "layers" - name: "symbols" + - name: "designs" paths: /files/list: get: @@ -485,6 +486,84 @@ paths: description: "" security: - BasicAuth: [] + /designs: + get: + tags: ["designs"] + responses: + "200": + description: "" + security: + - BasicAuth: [] + /designs/{name}: + get: + tags: ["designs"] + parameters: + - name: name + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /designs/{name}/components: + get: + tags: ["designs"] + parameters: + - name: name + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /designs/{name}/nets: + get: + tags: ["designs"] + parameters: + - name: name + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /designs/{name}/parts: + get: + tags: ["designs"] + parameters: + - name: name + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] + /designs/{name}/packages: + get: + tags: ["designs"] + parameters: + - name: name + in: path + required: true + schema: + type: string + responses: + "200": + description: "" + security: + - BasicAuth: [] components: securitySchemes: BasicAuth: From 35a56d19856be6de1ce1ff4fb19e16225affd27a Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Tue, 30 Jan 2024 15:09:39 -0800 Subject: [PATCH 39/42] Create deploy-eks.yml --- .github/workflows/deploy-eks.yml | 94 ++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 .github/workflows/deploy-eks.yml diff --git a/.github/workflows/deploy-eks.yml b/.github/workflows/deploy-eks.yml new file mode 100644 index 00000000..086912e5 --- /dev/null +++ b/.github/workflows/deploy-eks.yml @@ -0,0 +1,94 @@ +# This workflow will build and push a new container image to Amazon ECR, +# and then will deploy a new task definition to Amazon ECS, when there is a push to the "development" branch. +# +# To use this workflow, you will need to complete the following set-up steps: +# +# 1. Create an ECR repository to store your images. +# For example: `aws ecr create-repository --repository-name my-ecr-repo --region us-east-2`. +# Replace the value of the `ECR_REPOSITORY` environment variable in the workflow below with your repository's name. +# Replace the value of the `AWS_REGION` environment variable in the workflow below with your repository's region. +# +# 2. Create an ECS task definition, an ECS cluster, and an ECS service. +# For example, follow the Getting Started guide on the ECS console: +# https://us-east-2.console.aws.amazon.com/ecs/home?region=us-east-2#/firstRun +# Replace the value of the `ECS_SERVICE` environment variable in the workflow below with the name you set for the Amazon ECS service. +# Replace the value of the `ECS_CLUSTER` environment variable in the workflow below with the name you set for the cluster. +# +# 3. Store your ECS task definition as a JSON file in your repository. +# The format should follow the output of `aws ecs register-task-definition --generate-cli-skeleton`. +# Replace the value of the `ECS_TASK_DEFINITION` environment variable in the workflow below with the path to the JSON file. +# Replace the value of the `CONTAINER_NAME` environment variable in the workflow below with the name of the container +# in the `containerDefinitions` section of the task definition. +# +# 4. Store an IAM user access key in GitHub Actions secrets named `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`. +# See the documentation for each action used below for the recommended IAM policies for this IAM user, +# and best practices on handling the access key credentials. + +name: Deploy to Amazon ECS + +on: + push: + branches: [ "development" ] + +env: + AWS_REGION: MY_AWS_REGION # set this to your preferred AWS region, e.g. us-west-1 + ECR_REPOSITORY: MY_ECR_REPOSITORY # set this to your Amazon ECR repository name + ECS_SERVICE: MY_ECS_SERVICE # set this to your Amazon ECS service name + ECS_CLUSTER: MY_ECS_CLUSTER # set this to your Amazon ECS cluster name + ECS_TASK_DEFINITION: MY_ECS_TASK_DEFINITION # set this to the path to your Amazon ECS task definition + # file, e.g. .aws/task-definition.json + CONTAINER_NAME: MY_CONTAINER_NAME # set this to the name of the container in the + # containerDefinitions section of your task definition + +permissions: + contents: read + +jobs: + deploy: + name: Deploy + runs-on: ubuntu-latest + environment: production + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ env.AWS_REGION }} + + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v1 + + - name: Build, tag, and push image to Amazon ECR + id: build-image + env: + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + IMAGE_TAG: ${{ github.sha }} + run: | + # Build a docker container and + # push it to ECR so that it can + # be deployed to ECS. + docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . + docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG + echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT + + - name: Fill in the new image ID in the Amazon ECS task definition + id: task-def + uses: aws-actions/amazon-ecs-render-task-definition@v1 + with: + task-definition: ${{ env.ECS_TASK_DEFINITION }} + container-name: ${{ env.CONTAINER_NAME }} + image: ${{ steps.build-image.outputs.image }} + + - name: Deploy Amazon ECS task definition + uses: aws-actions/amazon-ecs-deploy-task-definition@v1 + with: + task-definition: ${{ steps.task-def.outputs.task-definition }} + service: ${{ env.ECS_SERVICE }} + cluster: ${{ env.ECS_CLUSTER }} + wait-for-service-stability: true From 3a934301ac0cebc01107c459af83c0377cfcf614 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Tue, 30 Jan 2024 15:27:27 -0800 Subject: [PATCH 40/42] only run scan and build workflows on pull requests and then release and docker publish workflows on pushes --- .github/workflows/cmake-multi-platform.yml | 3 ++- .github/workflows/codeql.yml | 4 ++-- .github/workflows/docker-publish.yml | 4 ++-- .github/workflows/docker-scout-scan.yml | 4 ++-- .github/workflows/scorecard.yml | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 2ae4c0c9..9d5b84ae 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -3,7 +3,8 @@ name: CMake Build Multi-Platform on: push: - branches: [ "development", "main", "release", "nam20485" ] + #branches: [ "development", "main", "release", "nam20485" ] + branches: [ "release" ] pull_request: branches: [ "development", "main", "release", "nam20485" ] diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 6966cd7a..381e113d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -12,8 +12,8 @@ name: "CodeQL Security Scan" on: - push: - branches: [ "development", "main", "release", "nam20485" ] + #push: + # branches: [ "development", "main", "release", "nam20485" ] pull_request: branches: [ "development", "main", "release", "nam20485" ] diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 69984159..e42bea62 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -8,8 +8,8 @@ name: Docker Publish on: push: branches: [ "development", "main", "release", "nam20485" ] - pull_request: - branches: [ "development", "main", "release", "nam20485" ] + #pull_request: + # branches: [ "development", "main", "release", "nam20485" ] env: # Use docker.io for Docker Hub if empty diff --git a/.github/workflows/docker-scout-scan.yml b/.github/workflows/docker-scout-scan.yml index b3252e1f..25ca855d 100644 --- a/.github/workflows/docker-scout-scan.yml +++ b/.github/workflows/docker-scout-scan.yml @@ -6,8 +6,8 @@ name: Docker Scout Scan # documentation. on: - push: - branches: [ "development", "main", "release", "nam20485" ] + #push: + # branches: [ "development", "main", "release", "nam20485" ] pull_request: branches: [ "development", "main", "release", "nam20485" ] diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 68f0a067..a3811e0c 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -11,8 +11,8 @@ on: # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained schedule: - cron: '26 13 * * 3' - push: - branches: [ "development" ] + #push: + # branches: [ "development" ] pull_request: branches: [ "development" ] From 02b6c2e9e2ae1e4c0d0fd7df142b60d0068dae92 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Tue, 30 Jan 2024 16:52:15 -0800 Subject: [PATCH 41/42] run workflows on nam20485 branch pushes --- .github/workflows/cmake-multi-platform.yml | 3 +-- .github/workflows/codeql.yml | 4 ++-- .github/workflows/docker-scout-scan.yml | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 9d5b84ae..8f38d689 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -3,8 +3,7 @@ name: CMake Build Multi-Platform on: push: - #branches: [ "development", "main", "release", "nam20485" ] - branches: [ "release" ] + branches: [ "release", "nam20485" ] pull_request: branches: [ "development", "main", "release", "nam20485" ] diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 381e113d..fe603425 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -12,8 +12,8 @@ name: "CodeQL Security Scan" on: - #push: - # branches: [ "development", "main", "release", "nam20485" ] + push: + branches: [ "nam20485" ] pull_request: branches: [ "development", "main", "release", "nam20485" ] diff --git a/.github/workflows/docker-scout-scan.yml b/.github/workflows/docker-scout-scan.yml index 25ca855d..06c9fa79 100644 --- a/.github/workflows/docker-scout-scan.yml +++ b/.github/workflows/docker-scout-scan.yml @@ -6,8 +6,8 @@ name: Docker Scout Scan # documentation. on: - #push: - # branches: [ "development", "main", "release", "nam20485" ] + push: + branches: [ "nam20485" ] pull_request: branches: [ "development", "main", "release", "nam20485" ] From e8a5d878cd2ba69bd0d36d5de1142602d4f9533a Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Tue, 30 Jan 2024 17:20:18 -0800 Subject: [PATCH 42/42] split release job out of cmake-multi-platform workflow and stop running cmake-multi-platform on release branch pushes --- .github/workflows/cmake-multi-platform.yml | 112 +------------------ .github/workflows/create-release.yml | 122 +++++++++++++++++++++ 2 files changed, 123 insertions(+), 111 deletions(-) create mode 100644 .github/workflows/create-release.yml diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 8f38d689..09e88f31 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -3,7 +3,7 @@ name: CMake Build Multi-Platform on: push: - branches: [ "release", "nam20485" ] + branches: [ "nam20485" ] pull_request: branches: [ "development", "main", "release", "nam20485" ] @@ -212,113 +212,3 @@ jobs: name: ${{ matrix.os }}-artifacts path: ${{ env.ARTIFACTS_DIR }}/artifacts-${{matrix.os}}.zip retention-days: 1 - - # - # Create Release job - # - - release: - # only on pushes to the release branch - name: Create Release - needs: build - if: ${{ (github.ref_name == 'release') && github.event_name == 'push' }} - runs-on: ubuntu-22.04 - permissions: - contents: write - - steps: - - - name: Checkout Repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - # download the artifacts - - name: "Download artifacts" - uses: "actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935" # v4.1.1 - with: - path: ${{ github.workspace }}/artifacts - - - name: Rename Artifacts - run: | - mv ${{ github.workspace }}/artifacts/ubuntu-22.04-artifacts/artifacts-ubuntu-22.04.zip ${{ github.workspace }}/artifacts/OdbDesign-Linux-x64.zip - mv ${{ github.workspace }}/artifacts/windows-2022-artifacts/artifacts-windows-2022.zip ${{ github.workspace }}/artifacts/OdbDesign-Windows-x64.zip - mv ${{ github.workspace }}/artifacts/macos-12-artifacts/artifacts-macos-12.zip ${{ github.workspace }}/artifacts/OdbDesign-MacOS-x64.zip - - - name: Generate SHA256 Sums - run: | - # sha256 - cd ${{ github.workspace }}/artifacts - sha256sum OdbDesign-Linux-x64.zip > OdbDesign-Linux-x64.zip.sha256sum - sha256sum OdbDesign-Windows-x64.zip > OdbDesign-Windows-x64.zip.sha256sum - sha256sum OdbDesign-MacOS-x64.zip > OdbDesign-MacOS-x64.zip.sha256sum - - - name: Import GPG Key - uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0 - with: - gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - passphrase: ${{ secrets.PASSPHRASE }} - - - name: Sign Binaries - run: | - cd ${{ github.workspace }}/artifacts - gpg --batch --yes --detach-sign --armor OdbDesign-Linux-x64.zip - gpg --batch --yes --detach-sign --armor OdbDesign-Windows-x64.zip - gpg --batch --yes --detach-sign --armor OdbDesign-MacOS-x64.zip - - - name: Create Release Variables - run: | - export RELEASE_VERSION="${{vars.RELEASE_VERSION_PREFIX}}.${{github.run_number}}" - echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV - export RELEASE_TAG="v${RELEASE_VERSION}" - echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV - export RELEASE_NAME="OdbDesign ${RELEASE_TAG}" - echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV - - # create a release - - name: "Create GitHub Release" - uses: "actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea" # v7.0.1 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - script: | - try { - const createResponse = await github.rest.repos.createRelease({ - generate_release_notes: true, - name: process.env.RELEASE_NAME, - owner: context.repo.owner, - repo: context.repo.repo, - tag_name: process.env.RELEASE_TAG, - body: require('fs').readFileSync('${{ github.workspace }}/release/release-body.md', 'utf8'), - target_commitish: '${{ github.ref_name }}' - }); - - const files = - [ - { name: 'OdbDesign-Linux-x64.zip', contentType: 'application/zip' }, - { name: 'OdbDesign-Linux-x64.zip.sha256sum', contentType: 'text/plain' }, - { name: 'OdbDesign-Linux-x64.zip.asc', contentType: 'text/plain' }, - { name: 'OdbDesign-Windows-x64.zip', contentType: 'application/zip' }, - { name: 'OdbDesign-Windows-x64.zip.sha256sum', contentType: 'text/plain' }, - { name: 'OdbDesign-Windows-x64.zip.asc', contentType: 'text/plain' }, - { name: 'OdbDesign-MacOS-x64.zip', contentType: 'application/zip' }, - { name: 'OdbDesign-MacOS-x64.zip.sha256sum', contentType: 'text/plain' }, - { name: 'OdbDesign-MacOS-x64.zip.asc', contentType: 'text/plain' } - ]; - - const artifactsPath = '${{ github.workspace }}/artifacts'; - - for (const file of files) { - const filePath = artifactsPath +'/' + file.name; - const uploadResponse = await github.rest.repos.uploadReleaseAsset({ - owner: context.repo.owner, - repo: context.repo.repo, - release_id: createResponse.data.id, - name: file.name, - data: require('fs').readFileSync(filePath), - headers: { - 'content-type': file.contentType, - 'content-length': require('fs').statSync(filePath).size - } - }); - } - } catch (error) { - core.setFailed(error.message); - } \ No newline at end of file diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 00000000..d8fe951b --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,122 @@ +# run CMake build on Windows and Linux +name: Create Release + +on: + push: + branches: [ "release" ] + +permissions: + contents: read + +env: + ARTIFACTS_DIR: ${{ github.workspace }}/artifacts + ARTIFACTS_DIR_WIN: ${{ github.workspace }}\artifacts + +jobs: + + release: + + # only on pushes to the release branch + name: Create Release + #needs: build + if: ${{ (github.ref_name == 'release') && github.event_name == 'push' }} + runs-on: ubuntu-22.04 + permissions: + contents: write + + steps: + + - name: Checkout Repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + # download the artifacts + - name: "Download artifacts" + uses: "actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935" # v4.1.1 + with: + path: ${{ github.workspace }}/artifacts + + - name: Rename Artifacts + run: | + mv ${{ github.workspace }}/artifacts/ubuntu-22.04-artifacts/artifacts-ubuntu-22.04.zip ${{ github.workspace }}/artifacts/OdbDesign-Linux-x64.zip + mv ${{ github.workspace }}/artifacts/windows-2022-artifacts/artifacts-windows-2022.zip ${{ github.workspace }}/artifacts/OdbDesign-Windows-x64.zip + mv ${{ github.workspace }}/artifacts/macos-12-artifacts/artifacts-macos-12.zip ${{ github.workspace }}/artifacts/OdbDesign-MacOS-x64.zip + + - name: Generate SHA256 Sums + run: | + # sha256 + cd ${{ github.workspace }}/artifacts + sha256sum OdbDesign-Linux-x64.zip > OdbDesign-Linux-x64.zip.sha256sum + sha256sum OdbDesign-Windows-x64.zip > OdbDesign-Windows-x64.zip.sha256sum + sha256sum OdbDesign-MacOS-x64.zip > OdbDesign-MacOS-x64.zip.sha256sum + + - name: Import GPG Key + uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.PASSPHRASE }} + + - name: Sign Binaries + run: | + cd ${{ github.workspace }}/artifacts + gpg --batch --yes --detach-sign --armor OdbDesign-Linux-x64.zip + gpg --batch --yes --detach-sign --armor OdbDesign-Windows-x64.zip + gpg --batch --yes --detach-sign --armor OdbDesign-MacOS-x64.zip + + - name: Create Release Variables + run: | + export RELEASE_VERSION="${{vars.RELEASE_VERSION_PREFIX}}.${{github.run_number}}" + echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV + export RELEASE_TAG="v${RELEASE_VERSION}" + echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV + export RELEASE_NAME="OdbDesign ${RELEASE_TAG}" + echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV + + # create a release + - name: "Create GitHub Release" + uses: "actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea" # v7.0.1 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + script: | + try { + const createResponse = await github.rest.repos.createRelease({ + generate_release_notes: true, + name: process.env.RELEASE_NAME, + owner: context.repo.owner, + repo: context.repo.repo, + tag_name: process.env.RELEASE_TAG, + body: require('fs').readFileSync('${{ github.workspace }}/release/release-body.md', 'utf8'), + target_commitish: '${{ github.ref_name }}' + }); + + const files = + [ + { name: 'OdbDesign-Linux-x64.zip', contentType: 'application/zip' }, + { name: 'OdbDesign-Linux-x64.zip.sha256sum', contentType: 'text/plain' }, + { name: 'OdbDesign-Linux-x64.zip.asc', contentType: 'text/plain' }, + { name: 'OdbDesign-Windows-x64.zip', contentType: 'application/zip' }, + { name: 'OdbDesign-Windows-x64.zip.sha256sum', contentType: 'text/plain' }, + { name: 'OdbDesign-Windows-x64.zip.asc', contentType: 'text/plain' }, + { name: 'OdbDesign-MacOS-x64.zip', contentType: 'application/zip' }, + { name: 'OdbDesign-MacOS-x64.zip.sha256sum', contentType: 'text/plain' }, + { name: 'OdbDesign-MacOS-x64.zip.asc', contentType: 'text/plain' } + ]; + + const artifactsPath = '${{ github.workspace }}/artifacts'; + + for (const file of files) { + const filePath = artifactsPath +'/' + file.name; + const uploadResponse = await github.rest.repos.uploadReleaseAsset({ + owner: context.repo.owner, + repo: context.repo.repo, + release_id: createResponse.data.id, + name: file.name, + data: require('fs').readFileSync(filePath), + headers: { + 'content-type': file.contentType, + 'content-length': require('fs').statSync(filePath).size + } + }); + } + } catch (error) { + core.setFailed(error.message); + }