#pragma once

#include "QuantumCircuitElement.h"
#include "QuantumGate.h"
#include "QuantumTerminal.h"
#include "QuantumWire.h"
#include "QuantumState.h"

#include <vector>

class QuantumCircuit
{
public:
	void addInputTerminal(QuantumTerminalPtr terminal);

	void addOutputTerminal(QuantumTerminalPtr terminal);

	void addQuantumWire(QuantumWirePtr wire);

	void addLogicGate(QuantumGatePtr gate);

	void buildWireConnections();

	const std::vector<QuantumTerminal*>& getInputTerminals() const;

	const std::vector<QuantumTerminal*>& getOutputTerminals() const;

	const std::vector<QuantumGate*>& getLogicGates() const;

	const std::vector<QuantumWire*>& getQuantumWires() const;

	QuantumState getInputState() const;

private:
	bool connectivityIsValid() const;

	std::vector<QuantumTerminal*> mInputTerminals;
	std::vector<QuantumTerminal*> mOutputTerminals;

	std::vector<QuantumWire*> mWires;
	std::vector<QuantumGate*> mGates;

	std::vector<std::unique_ptr<QuantumCircuitElement> > mElements;
};