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
28 #define PROJECTPATH_NOACCESS 203
30 #define BLOCKFILE_NOACCESS 301
31 #define BLOCKFILE_CORRUPTED 302
33 #define IMPLFILE_NOACCESS 401
34 #define IMPLFILE_CORRUPTED 402
35 #define IMPLFILE_NOPATTERN 403
37 #define VHDLFILE_NOACCESS 501
38 #define VHDLFILE_CORRUPTED 502
40 #define BLOCKPATH_NOACCESS 601
42 #define IMPLPATH_NOACCESS 701
44 // exceptions for block manipulations
45 #define BLOCK_NULL 1001
46 #define BLOCK_INVALID_TYPE 1002
49 // exceptions for interfaces manipulations
50 #define IFACE_NULL 2001
51 #define IFACE_INVALID_TYPE 2002
52 #define IFACE_MULTIPLICITY_REACHED 2003
53 #define IFACE_BLOCK_NOCLKRST 2004
54 #define IFACE_GROUP_NOCLKRST 2005
55 #define IFACE_TOP_NOCLKRSTGEN 2006
56 #define IFACE_INVALID_CLKFREQ 2007
58 // exceptions for block items manipulations
59 #define BLOCKITEM_NULL 3001
60 #define BLOCKITEM_INVALID_TYPE 3002
62 // exceptions for width interfaces validation
63 #define WIDTHS_NOT_EQUALS 4001
65 // exceptions for VHDL generation
66 #define INVALID_VALUE 5001
68 // exception for patterns
69 #define INVALID_FUNBLOCK_USE 10001
70 #define INVALID_REFBLOCK_USE 10002
71 #define INVALID_GROUPBLOCK_USE 10003
73 #define INVALID_DELTA_CP 10004 // delta and CP are not consistent (NB: used during admittance computation)
75 #define EVAL_PARAM_UNKNOWN 10101 // a variable used in an expression is not defined as a block parameter
76 #define EVAL_PARAM_NOVALUE 10102 // can't get the double value of a block parameter
77 #define EVAL_INVALID_EXPR 10103 // invalid arithmetic expression (in a block parameter/pattern)
79 #define INVALID_IFACE_PATTERN 10201 // the pattern of an interface is invalid (not correct grammar)
80 #define INVALID_IFACE_PC 10202 // the production counter of an interface is invalid (not correct grammar)
82 #define INVALID_IFACE_CP_LENGTH 10301 // the size of CP for an interface differs from others
83 #define NO_IFACE_CP 10302 // an interface has no CP defined in reference block
85 #define INVALID_IFACE_PP_LENGTH 10401 // the size of PP for an interface differs from others
86 #define NO_IFACE_PP 10402 // an interface has no PP defined in reference block
88 #define NO_IFACE_IP 10501 // an interface has no IP
89 #define IP_AP_NOTCOMPAT 10502 // IP and AP not compatible
90 #define IP_END_NULLCOL 10503 // IP ends with anull column (normally not possible during compat. check)
91 #define AP_TOO_SHORT 10504 // AP has been badly computed, leading to a AP shorter than needed (NB: it is an abnormal case)
93 #define IFACE_NOT_CONNECTED 10601 // an interface with control is not connected => impossible to analyz the graph
98 class Exception : public QObject {
102 Exception(int _id, void* _source = NULL);
103 Exception(const Exception& other);
105 inline int getType() { return id; }
106 inline void setMessage(QString _message) { message = _message; }
107 inline QString getMessage() { return message; }
108 QString getDefaultMessage();
109 inline void* getSource() { return source; }
118 #endif //__EXCEPTION_H__