LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
deviceconverter.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_EAGLEIMPORT_DEVICECONVERTER_H
21 #define LIBREPCB_EAGLEIMPORT_DEVICECONVERTER_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include <QtCore>
27 
28 #include <memory>
29 
30 /*******************************************************************************
31  * Namespace / Forward Declarations
32  ******************************************************************************/
33 
34 namespace parseagle {
35 class DeviceSet;
36 class Device;
37 } // namespace parseagle
38 
39 namespace librepcb {
40 
41 namespace library {
42 class Device;
43 }
44 
45 namespace eagleimport {
46 
47 class ConverterDb;
48 
49 /*******************************************************************************
50  * Class DeviceConverter
51  ******************************************************************************/
52 
56 class DeviceConverter final {
57 public:
58  // Constructors / Destructor
59  DeviceConverter() = delete;
60  DeviceConverter(const DeviceConverter& other) = delete;
61  DeviceConverter(const parseagle::DeviceSet& deviceSet,
62  const parseagle::Device& device, ConverterDb& db) noexcept;
63  ~DeviceConverter() noexcept;
64 
65  // General Methods
66  std::unique_ptr<library::Device> generate() const;
67 
68  // Operator Overloadings
69  DeviceConverter& operator=(const DeviceConverter& rhs) = delete;
70 
71 private:
72  QString createDescription() const noexcept;
73 
74  const parseagle::DeviceSet& mDeviceSet;
75  const parseagle::Device& mDevice;
77 };
78 
79 /*******************************************************************************
80  * End of File
81  ******************************************************************************/
82 
83 } // namespace eagleimport
84 } // namespace librepcb
85 
86 #endif // LIBREPCB_EAGLEIMPORT_DEVICECONVERTER_H
std::unique_ptr< library::Device > generate() const
Definition: deviceconverter.cpp:55
The DeviceConverter class.
Definition: deviceconverter.h:56
ConverterDb & mDb
Definition: deviceconverter.h:76
The Device class represents an instance of a component (a "real" component)
Definition: device.h:54
The ConverterDb class.
Definition: converterdb.h:47
QString createDescription() const noexcept
Definition: deviceconverter.cpp:92
~DeviceConverter() noexcept
Definition: deviceconverter.cpp:48
const parseagle::Device & mDevice
Definition: deviceconverter.h:75
DeviceConverter & operator=(const DeviceConverter &rhs)=delete
const parseagle::DeviceSet & mDeviceSet
Definition: deviceconverter.h:74