41 const QVector<InputPort *> &
inputs()
const {
return m_inputPorts; }
44 const QVector<OutputPort *> &
outputs()
const {
return m_outputPorts; }
53 int inputSize()
const {
return static_cast<int>(m_inputPorts.size()); }
56 int outputSize()
const {
return static_cast<int>(m_outputPorts.size()); }
69 void addPort(
const QString &name,
bool isOutput);
92 GraphicElement *m_owner;
94 QVector<InputPort *> m_inputPorts;
95 QVector<OutputPort *> m_outputPorts;
void addOutputPort(const QString &name={})
Appends a new output port with optional name.
void setInputs(const QVector< InputPort * > &inputs)
InputPort * takeLastInput()
const QVector< OutputPort * > & outputs() const
Returns the output port vector.
QVector< Port * > allPorts() const
Returns a combined list of all input and output ports as Port pointers.
int outputSize() const
Returns the current number of output ports.
void addInputPort(const QString &name={})
Appends a new input port with optional name.
InputPort * inputPort(int index) const
Returns the input port at index, or nullptr if out of range.
int inputSize() const
Returns the current number of input ports.
ElementPorts(GraphicElement *owner)
Constructs the port store bound to its owning owner element.
void addPort(const QString &name, bool isOutput)
Appends a new port (parented to the owner) with name; isOutput selects direction.
const QVector< InputPort * > & inputs() const
Returns the input port vector.
OutputPort * takeLastOutput()
Removes and returns the last output port WITHOUT deleting it. Returns nullptr if empty.
void resizeOutputs(int size)
Grows or shrinks the output list to exactly size.
void resizeInputs(int size)
OutputPort * outputPort(int index) const
Returns the output port at index, or nullptr if out of range.
Abstract base class for all graphical circuit elements in wiRedPanda.
A port that drives a signal (the source end of a wire).
Abstract base class for circuit element ports (connection endpoints).