#ifndef DOMAIN_CONNECTION_H #define DOMAIN_CONNECTION_H #include "attribute.h" #include #include namespace domain { struct ConnectionComponent { std::string component; std::string pin; bool operator==(const ConnectionComponent& rhs) const { return (component == rhs.component) && (pin == rhs.pin); } bool operator!=(const ConnectionComponent& rhs) const { return !operator==(rhs); } }; class Connection { ConnectionComponent first; std::optional second; std::string bus; std::vector attributes; std::vector firstWires; std::optional> secondWires; public: Connection(ConnectionComponent first, std::optional second, std::string bus, std::vector attributes, std::vector firstWires, std::optional> secondWires); bool isConnecting(ConnectionComponent first); bool isConnecting(ConnectionComponent first, std::string bus); bool isConnecting(ConnectionComponent first, std::string bus, ConnectionComponent second); ConnectionComponent getComponent(); std::optional getSecondComponent(); std::string getBus(); std::vector getAttributes(); std::vector getWires(); std::optional> getSecondWires(); Attribute getAttribute(std::string name); bool hasAttribute(std::string name); }; } // namespace domain #endif // DOMAIN_CONNECTION_H