LibrePCB Developers Documentation
bi_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_BI_BASE_H
21#define LIBREPCB_CORE_BI_BASE_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include <QtCore>
27
28/*******************************************************************************
29 * Namespace / Forward Declarations
30 ******************************************************************************/
31namespace librepcb {
32
33class Board;
34class Circuit;
35class Point;
36class Project;
37
38/*******************************************************************************
39 * Class BI_Base
40 ******************************************************************************/
41
45class BI_Base : public QObject {
46 Q_OBJECT
47
48public:
49 // Constructors / Destructor
50 BI_Base() = delete;
51 BI_Base(const BI_Base& other) = delete;
52 BI_Base(Board& board) noexcept;
53 virtual ~BI_Base() noexcept;
54
55 // Getters
56 Project& getProject() const noexcept;
57 Circuit& getCircuit() const noexcept;
58 Board& getBoard() const noexcept { return mBoard; }
59 virtual bool isAddedToBoard() const noexcept { return mIsAddedToBoard; }
60
61 // General Methods
62 virtual void addToBoard();
63 virtual void removeFromBoard();
64
65 // Operator Overloadings
66 BI_Base& operator=(const BI_Base& rhs) = delete;
67
68protected:
70
71private:
72 // General Attributes
74};
75
76/*******************************************************************************
77 * End of File
78 ******************************************************************************/
79
80} // namespace librepcb
81
82#endif
The Board Item Base (BI_Base) class.
Definition: bi_base.h:45
virtual void addToBoard()
Definition: bi_base.cpp:63
virtual bool isAddedToBoard() const noexcept
Definition: bi_base.h:59
virtual ~BI_Base() noexcept
Definition: bi_base.cpp:43
BI_Base & operator=(const BI_Base &rhs)=delete
Board & mBoard
Definition: bi_base.h:69
Project & getProject() const noexcept
Definition: bi_base.cpp:51
bool mIsAddedToBoard
Definition: bi_base.h:73
virtual void removeFromBoard()
Definition: bi_base.cpp:68
Circuit & getCircuit() const noexcept
Definition: bi_base.cpp:55
BI_Base(const BI_Base &other)=delete
Board & getBoard() const noexcept
Definition: bi_base.h:58
The Board class represents a PCB of a project and is always part of a circuit.
Definition: board.h:73
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
Definition: occmodel.cpp:77