LibrePCB Developers Documentation
Loading...
Searching...
No Matches
organizationpcbdesignrules.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_CORE_ORGANIZATIONPCBDESIGNRULES_H
21#define LIBREPCB_CORE_ORGANIZATIONPCBDESIGNRULES_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../project/board/drc/boarddesignrulechecksettings.h"
27#include "../../serialization/serializablekeyvaluemap.h"
28
29#include <QtCore>
30
31/*******************************************************************************
32 * Namespace / Forward Declarations
33 ******************************************************************************/
34namespace librepcb {
35
36/*******************************************************************************
37 * Class OrganizationPcbDesignRules
38 ******************************************************************************/
39
44public:
45 // Constructors / Destructor
46 OrganizationPcbDesignRules() noexcept = delete;
48 const Uuid& uuid, const ElementName& name, const QString& description,
49 const QUrl& url, const BoardDesignRuleCheckSettings& settings) noexcept;
51 explicit OrganizationPcbDesignRules(const SExpression& node);
53
54 // Getters
55 const Uuid& getUuid() const noexcept { return mUuid; }
56 const LocalizedNameMap& getNames() const noexcept { return mNames; }
57 const LocalizedDescriptionMap& getDescriptions() const noexcept {
58 return mDescriptions;
59 }
60 const QUrl& getUrl() const noexcept { return mUrl; }
61 BoardDesignRuleCheckSettings getDrcSettings(bool cleanOptions) const noexcept;
62
63 // Setters
64 void setUuid(const Uuid& uuid) noexcept { mUuid = uuid; }
65 void setNames(const LocalizedNameMap& names) noexcept { mNames = names; }
66 void setDescriptions(const LocalizedDescriptionMap& descriptions) noexcept {
67 mDescriptions = descriptions;
68 }
70 mDrcSettings = s;
71 mDrcSettings.setSources({}); // Not supported in this context.
72 }
73
74 // General Methods
75
81 void serialize(SExpression& root) const;
82
83 // Operator Overloadings
85 const OrganizationPcbDesignRules& rhs) noexcept;
86 bool operator==(const OrganizationPcbDesignRules& rhs) const noexcept =
87 default;
88
89private: // Data
90 // Attributes
94 QUrl mUrl;
95
96 // This dependency from the "library" sources to "project" sources is actually
97 // violating our software architecture. It's not critical, but it would be
98 // better to move the BoardDesignRuleCheckSettings class into the common
99 // sources so both "library" and "project" sources can depend on it.
101};
102
103/*******************************************************************************
104 * End of File
105 ******************************************************************************/
106
107} // namespace librepcb
108
109#endif
The BoardDesignRuleCheckSettings class.
Definition boarddesignrulechecksettings.h:50
void setSources(const SourceSet &value) noexcept
Definition boarddesignrulechecksettings.h:171
The OrganizationPcbDesignRules class.
Definition organizationpcbdesignrules.h:43
BoardDesignRuleCheckSettings mDrcSettings
Definition organizationpcbdesignrules.h:100
QUrl mUrl
Definition organizationpcbdesignrules.h:94
OrganizationPcbDesignRules & operator=(const OrganizationPcbDesignRules &rhs) noexcept
Definition organizationpcbdesignrules.cpp:118
const LocalizedNameMap & getNames() const noexcept
Definition organizationpcbdesignrules.h:56
void setDrcSettings(const BoardDesignRuleCheckSettings &s) noexcept
Definition organizationpcbdesignrules.h:69
bool operator==(const OrganizationPcbDesignRules &rhs) const noexcept=default
Uuid mUuid
Definition organizationpcbdesignrules.h:91
void setNames(const LocalizedNameMap &names) noexcept
Definition organizationpcbdesignrules.h:65
BoardDesignRuleCheckSettings getDrcSettings(bool cleanOptions) const noexcept
Definition organizationpcbdesignrules.cpp:76
LocalizedDescriptionMap mDescriptions
Definition organizationpcbdesignrules.h:93
LocalizedNameMap mNames
Definition organizationpcbdesignrules.h:92
void setUuid(const Uuid &uuid) noexcept
Definition organizationpcbdesignrules.h:64
void serialize(SExpression &root) const
Serialize into librepcb::SExpression node.
Definition organizationpcbdesignrules.cpp:101
const LocalizedDescriptionMap & getDescriptions() const noexcept
Definition organizationpcbdesignrules.h:57
const Uuid & getUuid() const noexcept
Definition organizationpcbdesignrules.h:55
OrganizationPcbDesignRules() noexcept=delete
void setDescriptions(const LocalizedDescriptionMap &descriptions) noexcept
Definition organizationpcbdesignrules.h:66
const QUrl & getUrl() const noexcept
Definition organizationpcbdesignrules.h:60
The SExpression class.
Definition sexpression.h:69
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition uuid.h:56
Definition occmodel.cpp:77
type_safe::constrained_type< QString, ElementNameConstraint, ElementNameVerifier > ElementName
Definition elementname.h:84