LibrePCB Developers Documentation
si_base.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_SI_BASE_H
21#define LIBREPCB_CORE_SI_BASE_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include <QtCore>
27
28/*******************************************************************************
29 * Namespace / Forward Declarations
30 ******************************************************************************/
31namespace librepcb {
32
33class Circuit;
34class Point;
35class Project;
36class Schematic;
37
38/*******************************************************************************
39 * Class SI_Base
40 ******************************************************************************/
41
45class SI_Base : public QObject {
46 Q_OBJECT
47
48public:
49 // Constructors / Destructor
50 SI_Base() = delete;
51 SI_Base(const SI_Base& other) = delete;
52 SI_Base(Schematic& schematic) noexcept;
53 virtual ~SI_Base() noexcept;
54
55 // Getters
56 Project& getProject() const noexcept;
57 Circuit& getCircuit() const noexcept;
58 Schematic& getSchematic() const noexcept { return mSchematic; }
59 virtual bool isAddedToSchematic() const noexcept {
61 }
62
63 // General Methods
64 virtual void addToSchematic();
65 virtual void removeFromSchematic();
66
67 // Operator Overloadings
68 SI_Base& operator=(const SI_Base& rhs) = delete;
69
70protected:
72
73private:
74 // General Attributes
76};
77
78/*******************************************************************************
79 * End of File
80 ******************************************************************************/
81
82} // namespace librepcb
83
84#endif
The Circuit class represents all electrical connections in a project (drawn in the schematics)
Definition: circuit.h:70
The Project class represents a whole (opened) project with all its content.
Definition: project.h:71
The Schematic Item Base (SI_Base) class.
Definition: si_base.h:45
Schematic & mSchematic
Definition: si_base.h:71
SI_Base & operator=(const SI_Base &rhs)=delete
Schematic & getSchematic() const noexcept
Definition: si_base.h:58
virtual bool isAddedToSchematic() const noexcept
Definition: si_base.h:59
virtual void addToSchematic()
Definition: si_base.cpp:63
virtual ~SI_Base() noexcept
Definition: si_base.cpp:43
Project & getProject() const noexcept
Definition: si_base.cpp:51
bool mIsAddedToSchematic
Definition: si_base.h:75
Circuit & getCircuit() const noexcept
Definition: si_base.cpp:55
virtual void removeFromSchematic()
Definition: si_base.cpp:68
SI_Base(const SI_Base &other)=delete
The Schematic class represents one schematic page of a project and is always part of a circuit.
Definition: schematic.h:74
Definition: occmodel.cpp:77