stuff-from-scratch/plugins/quantum_computing/src/QuantumCircuit.cpp

47 lines
1 KiB
C++
Raw Normal View History

2023-01-26 11:27:35 +00:00
#include "QuantumCircuit.h"
#include "QuantumGate.h"
void QuantumCircuit::addInputTerminal(QuantumTerminalPtr terminal)
{
mInputTerminals.push_back(terminal.get());
mElements.push_back(std::move(terminal));
}
void QuantumCircuit::addOutputTerminal(QuantumTerminalPtr terminal)
{
mOutputTerminals.push_back(terminal.get());
mElements.push_back(std::move(terminal));
}
void QuantumCircuit::addQuantumWire(QuantumWirePtr wire)
{
mWires.push_back(wire.get());
mElements.push_back(std::move(wire));
}
void QuantumCircuit::addLogicGate(QuantumGatePtr gate)
{
mGates.push_back(gate.get());
mElements.push_back(std::move(gate));
}
const std::vector<QuantumTerminal*>& QuantumCircuit::getInputTerminals() const
{
return mInputTerminals;
}
const std::vector<QuantumTerminal*>& QuantumCircuit::getOutputTerminals() const
{
return mOutputTerminals;
}
const std::vector<QuantumGate*>& QuantumCircuit::getLogicGates() const
{
return mGates;
}
const std::vector<QuantumWire*>& QuantumCircuit::getQuantumWires() const
{
return mWires;
}