20#ifndef LIBREPCB_CORE_DEVICEPADSIGNALMAP_H
21#define LIBREPCB_CORE_DEVICEPADSIGNALMAP_H
26#include "../../serialization/serializableobjectlist.h"
56 const tl::optional<Uuid>& signal)
noexcept;
84 return !(*
this == rhs);
98 static constexpr const char*
tagname =
"pad";
114 const Uuid& pad)
noexcept {
115 std::shared_ptr<const DevicePadSignalMapItem> item = map.find(pad);
116 return item ? item->getSignalUuid() : tl::nullopt;
121 foreach (
const Uuid& pad, pads) {
122 map.
append(std::make_shared<DevicePadSignalMapItem>(pad, tl::nullopt));
128 foreach (
const Uuid& pad, map.getUuidSet() - pads) {
131 foreach (
const Uuid& pad, pads - map.getUuidSet()) {
132 map.append(std::make_shared<DevicePadSignalMapItem>(pad, tl::nullopt));
134 Q_ASSERT(map.getUuidSet() == pads);
Definition: devicepadsignalmap.h:109
DevicePadSignalMapHelpers()=delete
static DevicePadSignalMap create(const QSet< Uuid > pads) noexcept
Definition: devicepadsignalmap.h:119
static void setPads(DevicePadSignalMap &map, QSet< Uuid > pads) noexcept
Definition: devicepadsignalmap.h:127
static tl::optional< Uuid > tryGetSignalUuid(const DevicePadSignalMap &map, const Uuid &pad) noexcept
Definition: devicepadsignalmap.h:113
The DevicePadSignalMapItem class.
Definition: devicepadsignalmap.h:42
~DevicePadSignalMapItem() noexcept
Definition: devicepadsignalmap.cpp:52
DevicePadSignalMapItem & operator=(const DevicePadSignalMapItem &rhs) noexcept
Definition: devicepadsignalmap.cpp:90
Slot< DevicePadSignalMapItem, Event > OnEditedSlot
Definition: devicepadsignalmap.h:50
Event
Definition: devicepadsignalmap.h:45
DevicePadSignalMapItem()=delete
void serialize(SExpression &root) const
Serialize into librepcb::SExpression node.
Definition: devicepadsignalmap.cpp:74
const Uuid & getUuid() const noexcept
Definition: devicepadsignalmap.h:61
Signal< DevicePadSignalMapItem, Event > onEdited
Definition: devicepadsignalmap.h:49
bool operator!=(const DevicePadSignalMapItem &rhs) const noexcept
Definition: devicepadsignalmap.h:83
Uuid mPadUuid
must be valid
Definition: devicepadsignalmap.h:89
const tl::optional< Uuid > & getSignalUuid() const noexcept
Definition: devicepadsignalmap.h:65
bool operator==(const DevicePadSignalMapItem &rhs) const noexcept
Definition: devicepadsignalmap.cpp:83
bool setSignalUuid(const tl::optional< Uuid > &uuid) noexcept
Definition: devicepadsignalmap.cpp:59
const Uuid & getPadUuid() const noexcept
Definition: devicepadsignalmap.h:64
tl::optional< Uuid > mSignalUuid
tl::nullopt if not connected to a signal
Definition: devicepadsignalmap.h:90
The SExpression class.
Definition: sexpression.h:69
int append(const std::shared_ptr< T > &obj) noexcept
Definition: serializableobjectlist.h:342
The Signal class is used to emit signals on non-QObject derived classes.
Definition: signalslot.h:65
The Slot class is used to receive signals from non-QObject derived classes.
Definition: signalslot.h:170
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:58
Definition: occmodel.cpp:77
Definition: devicepadsignalmap.h:97
static constexpr const char * tagname
Definition: devicepadsignalmap.h:98