LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
if_ercmsgprovider.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_PROJECT_IF_ERCMSGPROVIDER_H
21 #define LIBREPCB_PROJECT_IF_ERCMSGPROVIDER_H
22 
23 /*******************************************************************************
24  * Namespace / Forward Declarations
25  ******************************************************************************/
26 namespace librepcb {
27 namespace project {
28 
29 class ErcMsg; // all classes which implement IF_ErcMsgProvider will need this
30  // declaration
31 
32 /*******************************************************************************
33  * Macros
34  ******************************************************************************/
35 
44 #define DECLARE_ERC_MSG_CLASS_NAME(msgOwnerClassName) \
45 public: \
46  virtual const char* getErcMsgOwnerClassName() const noexcept override { \
47  return #msgOwnerClassName; \
48  } \
49  \
50 private:
51 
52 /*******************************************************************************
53  * Class IF_ErcMsgProvider
54  ******************************************************************************/
55 
60 public:
61  // Constructors / Destructor
63  virtual ~IF_ErcMsgProvider() {}
64 
65  // Getters
66  virtual const char* getErcMsgOwnerClassName() const noexcept = 0;
67 };
68 
69 /*******************************************************************************
70  * End of File
71  ******************************************************************************/
72 
73 } // namespace project
74 } // namespace librepcb
75 
76 #endif // LIBREPCB_PROJECT_IF_ERCMSGPROVIDER_H
virtual const char * getErcMsgOwnerClassName() const noexcept=0
The IF_ErcMsgProvider class.
Definition: if_ercmsgprovider.h:59
IF_ErcMsgProvider()
Definition: if_ercmsgprovider.h:62
virtual ~IF_ErcMsgProvider()
Definition: if_ercmsgprovider.h:63