#pragma once

#include "QuantumCircuitElement.h"
#include "Qubit.h"

#include <string>
#include <memory>

class QuantumWire;

class QuantumTerminal : public QuantumCircuitElement
{
public:
    enum class TerminalType
    {
        INPUT,
        OUTPUT
    };

    QuantumTerminal(TerminalType type, const std::string& label = {});

    QuantumWire* getConnection() const;

    Type getType() const override;

    TerminalType getTerminalType() const
    {
        return mType;
    }

    bool isFullyConnected() const override
    {
        return mConnection;
    }

    const Qubit& getValue() const;

    void setConnection(QuantumWire* connection);

    void setValue(const Qubit& value);

private:
    std::string mLabel;
    TerminalType mType;
    Qubit mValue;
    QuantumWire* mConnection{ nullptr };
};
using QuantumTerminalPtr = std::unique_ptr<QuantumTerminal>;
