LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
packagepad.h
Go to the documentation of this file.
1 /*
2  * LibrePCB - Professional EDA for everyone!
3  * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
4  * https://librepcb.org/
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef LIBREPCB_LIBRARY_PACKAGEPAD_H
21 #define LIBREPCB_LIBRARY_PACKAGEPAD_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
31 
32 #include <QtCore>
33 
34 /*******************************************************************************
35  * Namespace / Forward Declarations
36  ******************************************************************************/
37 namespace librepcb {
38 namespace library {
39 
40 /*******************************************************************************
41  * Class PackagePad
42  ******************************************************************************/
43 
51 class PackagePad final : public SerializableObject {
52  Q_DECLARE_TR_FUNCTIONS(PackagePad)
53 
54 public:
55  // Constructors / Destructor
56  PackagePad() = delete;
57  PackagePad(const PackagePad& other) noexcept;
58  PackagePad(const Uuid& uuid, const CircuitIdentifier& name) noexcept;
59  explicit PackagePad(const SExpression& node);
60  ~PackagePad() noexcept;
61 
62  // Getters
63  const Uuid& getUuid() const noexcept { return mUuid; }
64  CircuitIdentifier getName() const noexcept { return mName; }
65 
66  // Setters
67  void setName(const CircuitIdentifier& name) noexcept;
68 
69  // General Methods
70 
72  void serialize(SExpression& root) const override;
73 
74  // Operator Overloadings
75  bool operator==(const PackagePad& rhs) const noexcept;
76  bool operator!=(const PackagePad& rhs) const noexcept {
77  return !(*this == rhs);
78  }
79  PackagePad& operator=(const PackagePad& rhs) noexcept;
80 
81 private: // Data
84 };
85 
86 /*******************************************************************************
87  * Class PackagePadList
88  ******************************************************************************/
89 
91  static constexpr const char* tagname = "pad";
92 };
93 using PackagePadList =
95 using CmdPackagePadInsert =
97 using CmdPackagePadRemove =
99 using CmdPackagePadsSwap =
101 
102 /*******************************************************************************
103  * End of File
104  ******************************************************************************/
105 
106 } // namespace library
107 } // namespace librepcb
108 
109 #endif // LIBREPCB_LIBRARY_PACKAGEPAD_H
Uuid mUuid
Definition: packagepad.h:82
The CmdListElementRemove class.
Definition: cmdlistelementremove.h:44
PackagePad & operator=(const PackagePad &rhs) noexcept
Definition: packagepad.cpp:80
CircuitIdentifier getName() const noexcept
Definition: packagepad.h:64
void setName(const CircuitIdentifier &name) noexcept
Definition: packagepad.cpp:57
The SerializableObject class is the base class for all classes which need to be serializable/deserial...
Definition: serializableobject.h:46
The CmdListElementsSwap class.
Definition: cmdlistelementsswap.h:44
type_safe::constrained_type< QString, CircuitIdentifierConstraint, CircuitIdentifierVerifier > CircuitIdentifier
Definition: circuitidentifier.h:89
CircuitIdentifier mName
Definition: packagepad.h:83
const Uuid & getUuid() const noexcept
Definition: packagepad.h:63
void serialize(SExpression &root) const override
Serialize the object into an existing S-Expression node.
Definition: packagepad.cpp:65
~PackagePad() noexcept
Definition: packagepad.cpp:50
The CmdListElementInsert class.
Definition: cmdlistelementinsert.h:44
bool operator!=(const PackagePad &rhs) const noexcept
Definition: packagepad.h:76
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:58
bool operator==(const PackagePad &rhs) const noexcept
Definition: packagepad.cpp:74
static constexpr const char * tagname
Definition: packagepad.h:91
The SExpression class.
Definition: sexpression.h:60
The PackagePad class represents one logical pad of a package.
Definition: packagepad.h:51