1 /*-==============================================================-
5 creation date : 08/04/2015
7 author : S. Domas (sdomas@iut-bm.univ-fcomte.fr)
11 supp. infos : saved in UTF-8 [éè]
13 -==============================================================-*/
14 #ifndef __EXCEPTION_H__
15 #define __EXCEPTION_H__
22 // exceptions for file accesses
23 #define CONFIGFILE_NOACCESS 1
24 #define CONFIGFILE_CORRUPTED 2
26 #define PROJECTFILE_NOACCESS 3
27 #define PROJECTFILE_CORRUPTED 4
29 #define BLOCKPATH_NOACCESS 5
30 #define IMPLPATH_NOACCESS 6
32 #define BLOCKFILE_NOACCESS 7
33 #define BLOCKFILE_CORRUPTED 8
35 #define IMPLFILE_NOACCESS 9
36 #define IMPLFILE_CORRUPTED 10
38 #define VHDLFILE_NOACCESS 11
40 // exceptions for block manipulations
41 #define BLOCK_NULL 100
42 #define BLOCK_INVALID_TYPE 101
44 // exceptions for interfaces manipulations
45 #define IFACE_NULL 200
46 #define IFACE_INVALID_TYPE 201
47 #define IFACE_MULTIPLICITY_REACHED 202
49 // exceptions for block items manipulations
50 #define BLOCKITEM_NULL 300
51 #define BLOCKITEM_INVALID_TYPE 301
53 // exceptions for width interfaces validation
54 #define WIDTHS_NOT_EQUALS 400
56 // exceptions for VHDL generation
57 #define INVALID_VALUE 500
62 class Exception : public QObject {
67 Exception(const Exception& other);
69 inline int getType() { return id; }
70 inline void setMessage(QString _message) { message = _message; }
71 inline QString getMessage() { return message; }
72 QString getDefaultMessage();
80 #endif //__EXCEPTION_H__