#include "pins.hpp"
#include "parts.hpp"
#include "signals.hpp"

Pin::Pin(std::string name) : SystemElement(name), sig(nullptr), prnt(nullptr) {};

bool Pin::connected()
{
    return sig != nullptr;
}

void Pin::connect(Signal *signal)
{
    sig = signal;
}

Pins::Pins(void) : SystemElementContainer<Pin>("pins") {}

Pins::Pins(std::vector<Pin *> pins) : SystemElementContainer<Pin>("pins", pins) {}