From e96b08c53c5d0902e08b38c35a3feafe1170ab79 Mon Sep 17 00:00:00 2001 From: daniel-k Date: Tue, 9 Jan 2018 16:27:57 +0100 Subject: [PATCH] lib/ip: implement more comparison operators for IpCore --- fpga/include/villas/fpga/ip.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fpga/include/villas/fpga/ip.hpp b/fpga/include/villas/fpga/ip.hpp index 191cf4e56..ae467750f 100644 --- a/fpga/include/villas/fpga/ip.hpp +++ b/fpga/include/villas/fpga/ip.hpp @@ -94,10 +94,20 @@ public: return vlnvMatch and (nameWildcard or id.name == otherId.name); } + bool + operator!= (const IpIdentifier& otherId) { + return !(*this == otherId); + } + bool operator== (const Vlnv& otherVlnv) { return id.vlnv == otherVlnv; } + bool + operator== (const std::string& otherName) + { return id.name == otherName; } + + friend std::ostream& operator<< (std::ostream& stream, const IpCore& ip) { return stream << ip.id; }