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 101
24 #define CONFIGFILE_CORRUPTED 102
26 #define PROJECTFILE_NOACCESS 201
27 #define PROJECTFILE_CORRUPTED 202
29 #define BLOCKFILE_NOACCESS 301
30 #define BLOCKFILE_CORRUPTED 302
32 #define IMPLFILE_NOACCESS 401
33 #define IMPLFILE_CORRUPTED 402
34 #define IMPLFILE_NOPATTERN 403
36 #define VHDLFILE_NOACCESS 501
38 #define BLOCKPATH_NOACCESS 601
40 #define IMPLPATH_NOACCESS 701
42 // exceptions for block manipulations
43 #define BLOCK_NULL 1001
44 #define BLOCK_INVALID_TYPE 1002
46 // exceptions for interfaces manipulations
47 #define IFACE_NULL 2001
48 #define IFACE_INVALID_TYPE 2002
49 #define IFACE_MULTIPLICITY_REACHED 2003
51 // exceptions for block items manipulations
52 #define BLOCKITEM_NULL 3001
53 #define BLOCKITEM_INVALID_TYPE 3002
55 // exceptions for width interfaces validation
56 #define WIDTHS_NOT_EQUALS 4001
58 // exceptions for VHDL generation
59 #define INVALID_VALUE 5001
64 class Exception : public QObject {
69 Exception(const Exception& other);
71 inline int getType() { return id; }
72 inline void setMessage(QString _message) { message = _message; }
73 inline QString getMessage() { return message; }
74 QString getDefaultMessage();
82 #endif //__EXCEPTION_H__