From 92ab5d078f80eaeda7893bc4d446095238ba88b8 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Wed, 7 Dec 2022 19:04:47 +0100 Subject: [PATCH] remove aliases for smart pointers and lists Signed-off-by: Steffen Vogel --- fpga/include/villas/fpga/card.hpp | 20 ++++++++------------ fpga/include/villas/fpga/core.hpp | 5 +---- fpga/lib/card.cpp | 10 +++++----- fpga/lib/core.cpp | 6 +++--- fpga/src/villas-fpga-cat.cpp | 2 +- fpga/src/villas-fpga-pipe.cpp | 2 +- fpga/src/villas-fpga-xbar-select.cpp | 2 +- fpga/tests/unit/global.hpp | 2 +- 8 files changed, 21 insertions(+), 28 deletions(-) diff --git a/fpga/include/villas/fpga/card.hpp b/fpga/include/villas/fpga/card.hpp index d9574a7f8..5a1e5741f 100644 --- a/fpga/include/villas/fpga/card.hpp +++ b/fpga/include/villas/fpga/card.hpp @@ -49,10 +49,6 @@ class PCIeCardFactory; class Card { public: - - using Ptr = std::shared_ptr; - using List = std::list; - friend PCIeCardFactory; }; @@ -83,13 +79,13 @@ public: void dump() { } - ip::Core::Ptr + std::shared_ptr lookupIp(const std::string &name) const; - ip::Core::Ptr + std::shared_ptr lookupIp(const Vlnv &vlnv) const; - ip::Core::Ptr + std::shared_ptr lookupIp(const ip::IpIdentifier &id) const; bool @@ -100,7 +96,7 @@ private: std::set memoryBlocksMapped; public: // TODO: make this private - ip::Core::List ips; // IPs located on this FPGA card + std::list> ips; // IPs located on this FPGA card bool doReset; // Reset VILLASfpga during startup? int affinity; // Affinity for MSI interrupts @@ -136,11 +132,11 @@ protected: class PCIeCardFactory : public plugin::Plugin { public: - static Card::List - make(json_t *json, std::shared_ptr pci, std::shared_ptr vc); + static + std::list> make(json_t *json, std::shared_ptr pci, std::shared_ptr vc); - static PCIeCard* - create() + static + PCIeCard* create() { return new PCIeCard(); } diff --git a/fpga/include/villas/fpga/core.hpp b/fpga/include/villas/fpga/core.hpp index bc39fd170..a7cea5ab2 100644 --- a/fpga/include/villas/fpga/core.hpp +++ b/fpga/include/villas/fpga/core.hpp @@ -114,9 +114,6 @@ public: virtual ~Core() = default; - using Ptr = std::shared_ptr; - using List = std::list; - public: // Generic management interface for IPs @@ -284,7 +281,7 @@ public: // Returns a running and checked FPGA IP static - Core::List make(PCIeCard* card, json_t *json_ips); + std::list> make(PCIeCard* card, json_t *json_ips); virtual std::string getType() const diff --git a/fpga/lib/card.cpp b/fpga/lib/card.cpp index 7dcf103af..b82d8bf0b 100644 --- a/fpga/lib/card.cpp +++ b/fpga/lib/card.cpp @@ -42,9 +42,9 @@ static PCIeCardFactory PCIeCardFactoryInstance; static const kernel::pci::Device defaultFilter((kernel::pci::Id(FPGA_PCI_VID_XILINX, FPGA_PCI_PID_VFPGA))); -PCIeCard::List PCIeCardFactory::make(json_t *json, std::shared_ptr pci, std::shared_ptr vc) +std::list> PCIeCardFactory::make(json_t *json, std::shared_ptr pci, std::shared_ptr vc) { - PCIeCard::List cards; + std::list> cards; auto logger = getStaticLogger(); const char *card_name; @@ -182,7 +182,7 @@ PCIeCard::~PCIeCard() } } -ip::Core::Ptr PCIeCard::lookupIp(const std::string &name) const +std::shared_ptr PCIeCard::lookupIp(const std::string &name) const { for (auto &ip : ips) { if (*ip == name) { @@ -193,7 +193,7 @@ ip::Core::Ptr PCIeCard::lookupIp(const std::string &name) const return nullptr; } -ip::Core::Ptr PCIeCard::lookupIp(const Vlnv &vlnv) const +std::shared_ptr PCIeCard::lookupIp(const Vlnv &vlnv) const { for (auto &ip : ips) { if (*ip == vlnv) { @@ -204,7 +204,7 @@ ip::Core::Ptr PCIeCard::lookupIp(const Vlnv &vlnv) const return nullptr; } -ip::Core::Ptr PCIeCard::lookupIp(const ip::IpIdentifier &id) const +std::shared_ptr PCIeCard::lookupIp(const ip::IpIdentifier &id) const { for (auto &ip : ips) { if (*ip == id) { diff --git a/fpga/lib/core.cpp b/fpga/lib/core.cpp index 2ea08d9be..df1bdb094 100644 --- a/fpga/lib/core.cpp +++ b/fpga/lib/core.cpp @@ -50,7 +50,7 @@ vlnvInitializationOrder = { Vlnv(AxiStreamSwitchFactory::getCompatibleVlnvString()), }; -Core::List +std::list> CoreFactory::make(PCIeCard* card, json_t *json_ips) { // We only have this logger until we know the factory to build an IP with @@ -59,8 +59,8 @@ CoreFactory::make(PCIeCard* card, json_t *json_ips) std::list allIps; // All IPs available in config std::list orderedIps; // IPs ordered in initialization order - Core::List configuredIps; // Successfully configured IPs - Core::List initializedIps; // Initialized, i.e. ready-to-use IPs + std::list> configuredIps; // Successfully configured IPs + std::list> initializedIps; // Initialized, i.e. ready-to-use IPs // Parse all IP instance names and their VLNV into list `allIps` const char* ipName; diff --git a/fpga/src/villas-fpga-cat.cpp b/fpga/src/villas-fpga-cat.cpp index cb521ea0f..ace383da7 100644 --- a/fpga/src/villas-fpga-cat.cpp +++ b/fpga/src/villas-fpga-cat.cpp @@ -81,7 +81,7 @@ int main(int argc, char* argv[]) auto card = fpga::setupFpgaCard(configFile, fpgaName); - std::vector aurora_channels; + std::vector> aurora_channels; for (int i = 0; i < 4; i++) { auto name = fmt::format("aurora_8b10b_ch{}", i); auto id = fpga::ip::IpIdentifier("xilinx.com:ip:aurora_8b10b:", name); diff --git a/fpga/src/villas-fpga-pipe.cpp b/fpga/src/villas-fpga-pipe.cpp index 8a10f6427..0b8c2dc85 100644 --- a/fpga/src/villas-fpga-pipe.cpp +++ b/fpga/src/villas-fpga-pipe.cpp @@ -73,7 +73,7 @@ int main(int argc, char* argv[]) auto card = fpga::setupFpgaCard(configFile, fpgaName); - std::vector aurora_channels; + std::vector> aurora_channels; for (int i = 0; i < 4; i++) { auto name = fmt::format("aurora_8b10b_ch{}", i); auto id = fpga::ip::IpIdentifier("xilinx.com:ip:aurora_8b10b:", name); diff --git a/fpga/src/villas-fpga-xbar-select.cpp b/fpga/src/villas-fpga-xbar-select.cpp index b5da3bb80..5f165930f 100644 --- a/fpga/src/villas-fpga-xbar-select.cpp +++ b/fpga/src/villas-fpga-xbar-select.cpp @@ -73,7 +73,7 @@ int main(int argc, char* argv[]) auto card = fpga::setupFpgaCard(configFile, fpgaName); - std::vector aurora_channels; + std::vector> aurora_channels; for (int i = 0; i < 4; i++) { auto name = fmt::format("aurora_8b10b_ch{}", i); auto id = fpga::ip::IpIdentifier("xilinx.com:ip:aurora_8b10b:", name); diff --git a/fpga/tests/unit/global.hpp b/fpga/tests/unit/global.hpp index 8a4b1b67e..9a820140b 100644 --- a/fpga/tests/unit/global.hpp +++ b/fpga/tests/unit/global.hpp @@ -29,7 +29,7 @@ class FpgaState { public: // List of all available FPGA cards, only first will be tested at the moment - villas::fpga::PCIeCard::List cards; + std::list> cards; }; // Global state to be shared by unittests