Faulhaber Serial Com Test  Version 1
A Qt interface to test Faulhaber MCBL 3006 motion controller
ErrorHandler.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * <Serial Com Test - Control of Faulhaber motor through serial port.>
3  * Copyright (C) 2015 B. Véron
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  ****************************************************************************/
18 
19 #ifndef ERROR_HANDLER_H
20 #define ERROR_HANDLER_H
21 
22 // Qt includes
23 #include <QString>
24 #include <QVector>
25 
26 
27 class ErrorHandler {
28 
29 public:
30 
31  ErrorHandler();
33  QString getLastError();
34  void setCurrentError(const QString pClassName, const QString pMethodName, const QString pErrorString, const bool pIsLastError);
35 
36 protected:
37 
38  QVector<QString> mClassName;
39  QVector<QString> mMethodName;
40  QVector<QString> mErrorString;
42 };
43 
44 #endif // ERROR_HANDLER_H
45 
46 
47 //------------------------------------------------------------------------------------------------
48 // Doxygen comments:
49 
55 // * \author Nikolai Hungr & Baptiste Véron
56 // * \date 14/10/2014
57 // * \bug None for the moment...
58 // */
59 
QVector< QString > mClassName
List of classes mapping the path taken by the error.
Definition: ErrorHandler.h:38
QVector< QString > mErrorString
List of error descriptions caused by the error&#39;s path throughout the member classes.
Definition: ErrorHandler.h:40
void setCurrentError(const QString pClassName, const QString pMethodName, const QString pErrorString, const bool pIsLastError)
Store the error that currently occured.
Definition: ErrorHandler.cpp:44
QVector< QString > mMethodName
List of methods mapping the path taken by the error.
Definition: ErrorHandler.h:39
Class for handling all the errors that occur in the Lpr Control library.
Definition: ErrorHandler.h:27
ErrorHandler()
ErrorHandler constructor.
Definition: ErrorHandler.cpp:22
bool mResetOnNextError
When True, the next call to setCurrentError will reset the mClassName, mMethodName, mErrorString QVectors.
Definition: ErrorHandler.h:41
QString getLastError()
Get the last error that occured.
Definition: ErrorHandler.cpp:27
~ErrorHandler()
ErrorHandler destructor.
Definition: ErrorHandler.h:32