OpenASIP 2.2
Loading...
Searching...
No Matches
Exception.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2009 Tampere University.
3
4 This file is part of TTA-Based Codesign Environment (TCE).
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23 */
24/**
25 * @file Exception.hh
26 *
27 * Declarations of exception classes.
28 *
29 * @author Mikael Lepistö 2003 (tmlepist-no.spam-cs.tut.fi)
30 */
31
32#ifndef TTA_EXCEPTION_HH
33#define TTA_EXCEPTION_HH
34
35#include <string>
36
37/// Exception wrapper macro that automatically includes
38/// file name, line number and function name where the throw is made.
39#define THROW_EXCEPTION(exceptionType, message) \
40 throw exceptionType(__FILE__, __LINE__, __func__, std::string() + message)
41
42///////////////////////////////////////////////////////////////////////////////
43// Exception
44///////////////////////////////////////////////////////////////////////////////
45
46/**
47 * Base class for all exceptions of the system.
48 *
49 * It contains information common to all exceptions that identifies the spot
50 * in the source code in which the execption was thrown: name of the source
51 * file, line number and name of the procedure. Also, it may contain an
52 * error message.
53 */
54class Exception {
55public:
57 std::string filename, int linenum,
58 std::string procname = unknownProcMsg_,
59 std::string errorMessage = "");
60
61 virtual ~Exception();
62
63 std::string fileName() const;
64 int lineNum() const;
65 std::string procedureName() const;
66 std::string errorMessage() const;
67 std::string errorMessageStack(bool messagesOnly = false) const;
68
69 /// Used when no procedure name is given.
70 static const std::string unknownProcMsg_;
71
72 /// Returns information of the last thrown exception.
73 static std::string lastExceptionInfo();
74
75 void setCause(const Exception &cause);
76 bool hasCause() const;
77 const Exception& cause() const;
78
79private:
80 /// Information of the last thrown exception for easing the debugging.
81 static std::string lastExceptionInfo_;
82 /// Name of the file where exception occurred.
83 std::string file_;
84 /// Line number in the file.
85 int line_;
86 /// Procedure name.
87 std::string proc_;
88 /// Error message
89 std::string errorMessage_;
90 /// Exception that caused current exception.
92};
93
94///////////////////////////////////////////////////////////////////////////////
95// IllegalParameters
96///////////////////////////////////////////////////////////////////////////////
97
98/**
99 * IllegalParameters exception is the base class for all exceptional
100 * conditions that are caused by input parameters given to the throwing
101 * function. An IllegalParameters is a valid parameter of its type (in
102 * terms of value range and type sanity) that in the context in which the
103 * function is called denotes a corrupted state. IllegalParameters
104 * conditions may occur when the throwing function is invoked in ways that
105 * violate some constraint, such as for example, an order constraint
106 * (precedence) or a logical constraint (conflict between parameter values
107 * given at different invocations).
108 *
109 * An IllegalParameters condition is "by definition" not to be treated as an
110 * assert, because the problem is typically originated by the client of the
111 * throwing function.
112 */
114public:
116 std::string filename, int linenum,
117 std::string procname = unknownProcMsg_,
118 std::string errorMessage = "");
119 virtual ~IllegalParameters() {};
120};
121
122///////////////////////////////////////////////////////////////////////////////
123// IOException
124///////////////////////////////////////////////////////////////////////////////
125
126/**
127 * Base class for exceptions which are occured when trying to
128 * do reading or writing.
129 */
130class IOException : public Exception {
131public:
133 std::string filename, int linenum,
134 std::string procname = unknownProcMsg_,
135 std::string errorMessage = "");
136 virtual ~IOException() {};
137};
138
139///////////////////////////////////////////////////////////////////////////////
140// InvalidData
141///////////////////////////////////////////////////////////////////////////////
142
143/**
144 * Base class for exceptions which occur because an object contains invalid
145 * data. The object could be a parameter passed to a method (invalid
146 * parameter), or an object whose a method is invoked (method incompatible
147 * with the current object state).
148 */
149class InvalidData : public Exception {
150public:
152 std::string filename, int linenum,
153 std::string procname = unknownProcMsg_,
154 std::string errorMessage = "");
155 virtual ~InvalidData() {};
156};
157
158///////////////////////////////////////////////////////////////////////////////
159// UnreachableStream
160///////////////////////////////////////////////////////////////////////////////
161
162/**
163 * Implements an exception which is thrown when trying to read from
164 * or write to a stream that cannot be opened or appears otherwise
165 * unreachable.
166 *
167 * It contains information about the file name, line number and
168 * procedure name in which this exception was thrown, and the stream
169 * name.
170 */
172public:
174 std::string filename, int linenum,
175 std::string procname = unknownProcMsg_,
176 std::string errorMessage = "");
177
178 virtual ~UnreachableStream();
179};
180
181///////////////////////////////////////////////////////////////////////////////
182// EndOfFile
183///////////////////////////////////////////////////////////////////////////////
184
185/**
186 * Implements an exception which is thrown when trying to read from
187 * stream when end of file has been reached.
188 */
189class EndOfFile : public IOException {
190public:
191 EndOfFile(
192 std::string filename, int linenum,
193 std::string procname = unknownProcMsg_,
194 std::string errorMessage = "");
195 virtual ~EndOfFile();
196};
197
198
199///////////////////////////////////////////////////////////////////////////////
200// WritePastEOF
201///////////////////////////////////////////////////////////////////////////////
202
203/**
204 * Implements an exception which is thrown when trying to write to
205 * a stream when the write cursor has been set past the end of file.
206 */
207class WritePastEOF : public IOException {
208public:
210 std::string filename, int linenum,
211 std::string procname = unknownProcMsg_,
212 std::string errorMessage = "");
213 virtual ~WritePastEOF();
214};
215
216///////////////////////////////////////////////////////////////////////////////
217// FileNotFound
218///////////////////////////////////////////////////////////////////////////////
219
220/**
221 * Implements an exception which is thrown when a requested file is not
222 * found.
223 */
224class FileNotFound : public IOException {
225public:
227 std::string filename,
228 int linenum,
229 std::string procname = unknownProcMsg_,
230 std::string errorMessage = "");
231 virtual ~FileNotFound();
232};
233
234///////////////////////////////////////////////////////////////////////////////
235// PathNotFound
236///////////////////////////////////////////////////////////////////////////////
237
238/**
239 * Implements an exception which is thrown when a requested path is not
240 * found.
241 */
242class PathNotFound : public IOException {
243public:
245 std::string filename,
246 int linenum,
247 std::string procname,
248 std::string errorMessage,
249 std::string path);
250 virtual ~PathNotFound();
251
252 std::string path() const;
253
254private:
255 std::string path_;
256
257};
258
259
260///////////////////////////////////////////////////////////////////////////////
261// KeyAlreadyExists
262///////////////////////////////////////////////////////////////////////////////
263
264/**
265 * Implements an exception which is thrown when trying to add an entry
266 * to a reference key map that already contains an entry with given key.
267 */
269public:
271 std::string filename, int linenum,
272 std::string procname = unknownProcMsg_,
273 std::string errorMessage = "");
274 virtual ~KeyAlreadyExists() {};
275};
276
277///////////////////////////////////////////////////////////////////////////////
278// KeyNotFound
279///////////////////////////////////////////////////////////////////////////////
280
281/**
282 * Implements an exception which is thrown when a requested key for
283 * object is not found.
284 */
286public:
288 std::string filename, int linenum,
289 std::string procname = unknownProcMsg_,
290 std::string errorMessage = "");
291 virtual ~KeyNotFound() {};
292};
293
294///////////////////////////////////////////////////////////////////////////////
295// InstanceNotFound
296///////////////////////////////////////////////////////////////////////////////
297
298/**
299 * Implements an exception which is thrown when can't find
300 * an instance of a class that is requested.
301 * For example in BinaryReader::readData, Section::createSection and
302 * SectionReader::readSection.
303 */
305public:
307 std::string filename, int linenum,
308 std::string procname = unknownProcMsg_,
309 std::string errorMessage = "");
310 virtual ~InstanceNotFound();
311};
312
313///////////////////////////////////////////////////////////////////////////////
314// OutOfRange
315///////////////////////////////////////////////////////////////////////////////
316
317/**
318 * Implements an exception which is thrown when something is out of range.
319 */
320class OutOfRange : public InvalidData {
321public:
323 std::string filename, int linenum,
324 std::string procname = unknownProcMsg_,
325 std::string errorMessage = "");
326 virtual ~OutOfRange() {};
327};
328
329///////////////////////////////////////////////////////////////////////////////
330// WrongSubclass
331///////////////////////////////////////////////////////////////////////////////
332
333/**
334 * Class is not capable to do that thing that was wanted.
335 */
337public:
339 std::string filename, int linenum,
340 std::string procname = unknownProcMsg_,
341 std::string errorMessage = "");
342 virtual ~WrongSubclass() {};
343};
344
345///////////////////////////////////////////////////////////////////////////////
346// NotChunkable
347///////////////////////////////////////////////////////////////////////////////
348
349/**
350 * Implements an exception which is thrown when trying get chunk object
351 * from section that does not override base classe's chunk() method.
352 */
354public:
356 std::string filename, int linenum,
357 std::string procname = unknownProcMsg_,
358 std::string errorMessage = "");
359 virtual ~NotChunkable() {};
360};
361
362///////////////////////////////////////////////////////////////////////////////
363// UnresolvedReference
364///////////////////////////////////////////////////////////////////////////////
365
366/**
367 * Implements an exception which is thrown when reference manager
368 * finds unresolvable references while trying to resolve().
369 */
371public:
373 std::string filename, int linenum,
374 std::string procname = unknownProcMsg_,
375 std::string errorMessage = "");
377};
378
379
380///////////////////////////////////////////////////////////////////////////////
381// ErrorInExternalFile
382///////////////////////////////////////////////////////////////////////////////
383
384/**
385 * Exception which is thrown when Schema parser finds errors in the file.
386 */
388public:
390 std::string filename, int linenum,
391 std::string procname = unknownProcMsg_,
392 std::string errorMessage = "");
393 virtual ~ErrorInExternalFile();
394};
395
396///////////////////////////////////////////////////////////////////////////////
397// MissingKeys
398///////////////////////////////////////////////////////////////////////////////
399
400/**
401 * Exception which is thrown when trying to do replacement while writing
402 * binary file and reference manager doesn't contain enough keys for
403 * computing replacement value.
404 */
405class MissingKeys : public InvalidData {
406public:
408 std::string filename, int linenum,
409 std::string procname = unknownProcMsg_,
410 std::string errorMessage = "");
411 virtual ~MissingKeys();
412};
413
414/////////////////////////////////////////////////////////////////////////////
415// NumberFormatException
416/////////////////////////////////////////////////////////////////////////////
417/**
418 * Exception which is thrown when trying to convert an illegal number to
419 * another type.
420 */
422public:
424 std::string filename, int linenum,
425 std::string procname = unknownProcMsg_,
426 std::string errorMessage = "");
427 virtual ~NumberFormatException();
428};
429
430///////////////////////////////////////////////////////////////////////////////
431// IllegalCommandLine
432///////////////////////////////////////////////////////////////////////////////
433
434/**
435 * Exception which is thrown when user given command line is somehow
436 * erronous.
437 */
439public:
441 std::string filename, int linenum,
442 std::string procname = unknownProcMsg_,
443 std::string errorMessage = "");
444 virtual ~IllegalCommandLine();
445};
446
447///////////////////////////////////////////////////////////////////////////////
448// UnexpectedValue
449///////////////////////////////////////////////////////////////////////////////
450
451/**
452 * Exception which is thrown when user given command line is somehow
453 * erronous.
454 */
456public:
458 std::string filename, int linenum,
459 std::string procname = unknownProcMsg_,
460 std::string errorMessage = "");
461 virtual ~UnexpectedValue();
462};
463
464
465/////////////////////////////////////////////////////////////////////////////
466// IllegalConnectivity
467/////////////////////////////////////////////////////////////////////////////
468
469/**
470 * Exception which is thrown when tried to make something impossible because
471 * of the connectivity of the object.
472 */
474public:
476 std::string filename,
477 int linenum,
478 std::string procname = unknownProcMsg_,
479 std::string errorMessage = "");
480 virtual ~IllegalConnectivity();
481};
482
483/////////////////////////////////////////////////////////////////////////////
484// ParserStopRequest
485/////////////////////////////////////////////////////////////////////////////
486
487/**
488 * Exception which is thrown when parser wants to tell the client that no
489 * error is found but the client should not proceed.
490 */
492public:
494 std::string fileName,
495 int lineNum,
496 std::string procName = unknownProcMsg_,
497 std::string errorMessage = "");
498 virtual ~ParserStopRequest();
499};
500
501/////////////////////////////////////////////////////////////////////////////
502// ComponentAlreadyExists
503/////////////////////////////////////////////////////////////////////////////
504
505/**
506 * Exception which is thrown when trying to add or attach a machine
507 * component to another component and corresponding component is already
508 * attached/added.
509 */
511public:
513 std::string filename,
514 int linenum,
515 std::string procname = unknownProcMsg_,
516 std::string errorMessage = "");
517 virtual ~ComponentAlreadyExists();
518};
519
520
521/////////////////////////////////////////////////////////////////////////////
522// IllegalRegistration
523/////////////////////////////////////////////////////////////////////////////
524
525/**
526 * Exception which is thrown when an object that can be registered to (that
527 * is, owned and managed by) another object happens to have an owner that is
528 * incompatible with the operation requested. For example, an operation
529 * involving two objects could throw this exception if the objects are
530 * registered to different owners.
531 */
533public:
535 std::string filename,
536 int linenum,
537 std::string procname = unknownProcMsg_,
538 std::string errorMessage = "");
539 virtual ~IllegalRegistration();
540};
541
542
543/////////////////////////////////////////////////////////////////////////////
544// ObjectStateLoadingException
545/////////////////////////////////////////////////////////////////////////////
546
547/**
548 * An exception which is thrown by Serializable::loadState if the loading
549 * failed for some reason.
550 */
552public:
554 std::string filename,
555 int linenum,
556 std::string procname = unknownProcMsg_,
557 std::string errorMessage = "");
559};
560
561
562/////////////////////////////////////////////////////////////////////////////
563// NonexistingChild
564/////////////////////////////////////////////////////////////////////////////
565
566/**
567 * Exception thrown when no child object is found in a graph or tree-like
568 * structure where each node can have several child nodes.
569 */
571public:
573 std::string filename,
574 int linenum,
575 std::string procname = unknownProcMsg_,
576 std::string errorMessage = "");
577 virtual ~NonexistingChild();
578};
579
580/////////////////////////////////////////////////////////////////////////////
581// DynamicLibraryException
582/////////////////////////////////////////////////////////////////////////////
583
584/**
585 * Exception which is thrown when errors occurred when handling dynamic
586 * libraries.
587 */
589public:
591 std::string filename,
592 int linenum,
593 std::string procname = unknownProcMsg_,
594 std::string errorMessage = "");
595 virtual ~DynamicLibraryException();
596};
597
598/////////////////////////////////////////////////////////////////////////////
599// MultipleInstancesFound
600/////////////////////////////////////////////////////////////////////////////
601
602/**
603 * Exception which is thrown when multiple instances of some kind are found.
604 */
606public:
608 std::string filename,
609 int linenum,
610 std::string procname = unknownProcMsg_,
611 std::string errorMessage = "");
612 virtual ~MultipleInstancesFound();
613};
614
615
616/////////////////////////////////////////////////////////////////////////////
617// SymbolNotFound
618/////////////////////////////////////////////////////////////////////////////
619
620/**
621 * Exception which is thrown when symbol is not found.
622 */
623class SymbolNotFound : public Exception {
624public:
626 std::string filename,
627 int linenum,
628 std::string procname = unknownProcMsg_,
629 std::string errorMessage = "");
630 virtual ~SymbolNotFound();
631};
632
633/////////////////////////////////////////////////////////////////////////////
634// ObjectNotInitialized
635/////////////////////////////////////////////////////////////////////////////
636
637/**
638 * Exception which is thrown when object is not properly initialized.
639 */
641public:
643 std::string filename,
644 int linenum,
645 std::string procname = unknownProcMsg_,
646 std::string errorMessage = "");
647 virtual ~ObjectNotInitialized();
648};
649
650/////////////////////////////////////////////////////////////////////////////
651// ScriptExecutionFailure
652/////////////////////////////////////////////////////////////////////////////
653
654/**
655 * Exception which is thrown when script execution fails.
656 */
658public:
660 std::string filename,
661 int linenum,
662 std::string procname = unknownProcMsg_,
663 std::string errorMessage = "");
664 virtual ~ScriptExecutionFailure();
665};
666
667
668/////////////////////////////////////////////////////////////////////////////
669// SerializerException
670/////////////////////////////////////////////////////////////////////////////
671
672/**
673 * Exception which is thrown by serializers when some error occurs.
674 */
676public:
678 std::string fileName,
679 int lineNum,
680 std::string procName = unknownProcMsg_,
681 std::string errorMessage = "");
682 virtual ~SerializerException();
683};
684
685/////////////////////////////////////////////////////////////////////////////
686// RelationalDBException
687/////////////////////////////////////////////////////////////////////////////
688
689/**
690 * Exception which is thrown by methods that handle relational databases.
691 */
693public:
695 std::string fileName,
696 int lineNum,
697 std::string procName = unknownProcMsg_,
698 std::string errorMessage = "");
699 virtual ~RelationalDBException();
700};
701
702
703/////////////////////////////////////////////////////////////////////////////
704// StartTooLate
705/////////////////////////////////////////////////////////////////////////////
706
707/**
708 * Exception which is thrown when pipeline does not start at cycle 0 or 1.
709 */
710class StartTooLate : public InvalidData {
711public:
713 std::string fileName,
714 int lineNum,
715 std::string procName = unknownProcMsg_,
716 std::string errorMessage = "");
717 virtual ~StartTooLate();
718};
719
720
721/////////////////////////////////////////////////////////////////////////////
722// NotAvailable
723/////////////////////////////////////////////////////////////////////////////
724
725/**
726 * Exception which is thrown when something is not available.
727 */
728class NotAvailable : public InvalidData {
729public:
731 std::string fileName,
732 int lineNum,
733 std::string procName = unknownProcMsg_,
734 std::string errorMessage = "");
735 virtual ~NotAvailable();
736};
737
738/////////////////////////////////////////////////////////////////////////////
739// CannotEstimateCost
740/////////////////////////////////////////////////////////////////////////////
741
742/**
743 * Exception which is thrown when cost estimator is unable to estimate
744 * a cost for given machine/machine part.
745 *
746 * Such case is usually due to missing cost data for the given machine part.
747 */
749public:
751 std::string fileName,
752 int lineNum,
753 std::string procName = unknownProcMsg_,
754 std::string errorMessage = "");
755 virtual ~CannotEstimateCost();
756};
757
758
759/////////////////////////////////////////////////////////////////////////////
760// WrongOperandType
761/////////////////////////////////////////////////////////////////////////////
762
763/**
764 * Exception which is thrown when tried to use input operand as output or
765 * vice versa.
766 */
768public:
770 std::string fileName,
771 int lineNum,
772 std::string procName = unknownProcMsg_,
773 std::string errorMessage = "");
774 virtual ~WrongOperandType();
775};
776
777
778/////////////////////////////////////////////////////////////////////////////
779// BadOperationModule
780/////////////////////////////////////////////////////////////////////////////
781
782/**
783 * Exception which is thrown when operation module is somehow invalid.
784 */
786public:
788 std::string fileName,
789 int lineNum,
790 std::string procName = unknownProcMsg_,
791 std::string errorMessage = "");
792 virtual ~BadOperationModule();
793};
794
795
796/////////////////////////////////////////////////////////////////////////////
797// TypeMismatch
798/////////////////////////////////////////////////////////////////////////////
799
800/**
801 * Exception which is thrown when types mismatch.
802 */
803class TypeMismatch : public InvalidData {
804public:
806 std::string fileName,
807 int lineNum,
808 std::string procName = unknownProcMsg_,
809 std::string errorMessage = "");
810 virtual ~TypeMismatch();
811};
812
813
814/////////////////////////////////////////////////////////////////////////////
815// InvalidName
816/////////////////////////////////////////////////////////////////////////////
817
818/**
819 * Exception thrown when a string of characters that represents a name
820 * does not conform to the expected constraints. Typical lexical constraints
821 * are clashings with reserved names (keywords) and presence of illegal
822 * characters. A structural constraint may be the presence (for example, a
823 * single, mandatory dot `.' to separate the basename from the extension)
824 * and the order of expected characters (for example, a digit not allowed in
825 * first position).
826 */
827class InvalidName : public InvalidData {
828public:
830 std::string fileName,
831 int lineNum,
832 std::string procName = unknownProcMsg_,
833 std::string errorMessage = "");
834 virtual ~InvalidName();
835};
836
837/////////////////////////////////////////////////////////////////////////////
838// IllegalBehavior
839/////////////////////////////////////////////////////////////////////////////
840
841/**
842 * Exception which is thrown when an illegal operation behavior is executed.
843 */
845public:
847 std::string fileName,
848 int lineNum,
849 std::string procName = unknownProcMsg_,
850 std::string errorMessage = "");
852};
853
854/////////////////////////////////////////////////////////////////////////////
855// NonexistingSyscall
856/////////////////////////////////////////////////////////////////////////////
857
858/**
859 * Exception which is thrown when nonexisting syscall is called.
860 */
862public:
864 std::string fileName,
865 int lineNum,
866 std::string procName = unknownProcMsg_,
867 std::string errorMessage = "");
868 virtual ~NonexistingSyscall();
869};
870
871/////////////////////////////////////////////////////////////////////////////
872// IllegalMachine
873/////////////////////////////////////////////////////////////////////////////
874
875/**
876 * Exception which is thrown when machine being used is somehow erroneous.
877 */
879public:
881 std::string fileName,
882 int lineNum,
883 std::string procName = unknownProcMsg_,
884 std::string errorMessage = "");
885 virtual ~IllegalMachine();
886};
887
888/////////////////////////////////////////////////////////////////////////////
889// IllegalProgram
890/////////////////////////////////////////////////////////////////////////////
891
892/**
893 * Exception which is thrown when program being handled is somehow erronous.
894 */
896public:
898 std::string fileName,
899 int lineNum,
900 std::string procName = unknownProcMsg_,
901 std::string errorMessage = "");
902 virtual ~IllegalProgram();
903};
904
905
906/////////////////////////////////////////////////////////////////////////////
907// SimulationException
908/////////////////////////////////////////////////////////////////////////////
909
910/**
911 * Base class for exceptions thrown by simulator.
912 */
914public:
916 std::string fileName,
917 int lineNum,
918 std::string procName = unknownProcMsg_,
919 std::string errorMessage = "");
920 virtual ~SimulationException();
921};
922
923/////////////////////////////////////////////////////////////////////////////
924// SimulationStillRunning
925/////////////////////////////////////////////////////////////////////////////
926
927/**
928 * An exception which is thrown when doing something which requires the
929 * simulation not to be in running state.
930 */
932public:
934 std::string fileName,
935 int lineNum,
936 std::string procName = unknownProcMsg_,
937 std::string errorMessage = "");
938 virtual ~SimulationStillRunning();
939};
940
941/////////////////////////////////////////////////////////////////////////////
942// SimulationExecutionError
943/////////////////////////////////////////////////////////////////////////////
944
945/**
946 * Exception which is thrown when a runtime error occurs in the simulated
947 * program.
948 *
949 * Runtime error might be, for example, illegal memory access.
950 */
952public:
954 std::string filename,
955 int linenum,
956 std::string procname = unknownProcMsg_,
957 std::string errorMessage = "");
959};
960
961/////////////////////////////////////////////////////////////////////////////
962// SimulationCycleLimitReached
963/////////////////////////////////////////////////////////////////////////////
964
965/**
966 * An exception which is thrown when simulation cycle limitation is reached.
967 */
969public:
971 std::string fileName,
972 int lineNum,
973 std::string procName = unknownProcMsg_,
974 std::string errorMessage = "");
976};
977
978/////////////////////////////////////////////////////////////////////////////
979// SimulationTimeOut
980/////////////////////////////////////////////////////////////////////////////
981
982/**
983 * An exception which is thrown when simulation cycle limitation is reached.
984 */
986public:
988 std::string fileName,
989 int lineNum,
990 std::string procName = unknownProcMsg_,
991 std::string errorMessage = "");
992 virtual ~SimulationTimeOut();
993};
994
995/////////////////////////////////////////////////////////////////////////////
996// ObjectAlreadyExists
997/////////////////////////////////////////////////////////////////////////////
998
999/**
1000 * Exception which is thrown when something already existing is being added.
1001 */
1003public:
1005 std::string filename,
1006 int linenum,
1007 std::string procname = unknownProcMsg_,
1008 std::string errorMessage = "");
1009 virtual ~ObjectAlreadyExists();
1010};
1011
1012/////////////////////////////////////////////////////////////////////////////
1013// CompileError
1014/////////////////////////////////////////////////////////////////////////////
1015
1016/**
1017 * Exception which is thrown when there is error in compilation.
1018 */
1019class CompileError : public Exception {
1020public:
1022 std::string filename,
1023 int linenum,
1024 std::string procname = unknownProcMsg_,
1025 std::string errorMessage = "");
1026
1027 virtual ~CompileError();
1028
1030 int codeFileLineNumber();
1031
1032private:
1034};
1035
1036///////////////////////////////////////////////////////////////////////////////
1037// ModuleRunTimeError
1038///////////////////////////////////////////////////////////////////////////////
1039
1040/**
1041 * Base class for handling run-time errors in plugin modules.
1042 */
1044public:
1046 std::string filename, int linenum,
1047 std::string procname = unknownProcMsg_,
1048 std::string errorMessage = "");
1050};
1051
1052///////////////////////////////////////////////////////////////////////////////
1053// NoKnownConversion
1054///////////////////////////////////////////////////////////////////////////////
1055/**
1056 * Exception which is thrown when conversion of from a type to another can not
1057 * be resolved or there are no known mapping of a variable to another.
1058 */
1060public:
1062 std::string filename, int linenum,
1063 std::string procname = unknownProcMsg_,
1064 std::string errorMessage = "");
1066};
1067
1068#include "Exception.icc"
1069
1070#endif
virtual ~BadOperationModule()
virtual ~CannotEstimateCost()
void setCodeFileLineNumber(int lineNum)
virtual ~CompileError()
int codeFileLineNumber()
virtual ~ComponentAlreadyExists()
Definition Exception.cc:709
virtual ~DynamicLibraryException()
Definition Exception.cc:820
virtual ~EndOfFile()
Definition Exception.cc:271
virtual ~ErrorInExternalFile()
Definition Exception.cc:524
const Exception * cause_
Exception that caused current exception.
Definition Exception.hh:91
const Exception & cause() const
Definition Exception.cc:95
std::string errorMessage_
Error message.
Definition Exception.hh:89
std::string proc_
Procedure name.
Definition Exception.hh:87
int line_
Line number in the file.
Definition Exception.hh:85
virtual ~Exception()
Definition Exception.cc:116
std::string file_
Name of the file where exception occurred.
Definition Exception.hh:83
static std::string lastExceptionInfo_
Information of the last thrown exception for easing the debugging.
Definition Exception.hh:81
std::string errorMessageStack(bool messagesOnly=false) const
Definition Exception.cc:138
static const std::string unknownProcMsg_
Used when no procedure name is given.
Definition Exception.hh:70
std::string fileName() const
std::string errorMessage() const
Definition Exception.cc:123
std::string procedureName() const
bool hasCause() const
Definition Exception.cc:85
int lineNum() const
static std::string lastExceptionInfo()
Returns information of the last thrown exception.
Definition Exception.cc:108
void setCause(const Exception &cause)
Definition Exception.cc:75
virtual ~FileNotFound()
Definition Exception.cc:325
virtual ~IOException()
Definition Exception.hh:136
virtual ~IllegalCommandLine()
Definition Exception.cc:602
virtual ~IllegalConnectivity()
Definition Exception.cc:656
virtual ~IllegalMachine()
virtual ~IllegalOperationBehavior()
virtual ~IllegalParameters()
Definition Exception.hh:119
virtual ~IllegalProgram()
virtual ~IllegalRegistration()
Definition Exception.cc:737
virtual ~InstanceNotFound()
Definition Exception.cc:418
virtual ~InvalidData()
Definition Exception.hh:155
virtual ~InvalidName()
virtual ~KeyAlreadyExists()
Definition Exception.hh:274
virtual ~KeyNotFound()
Definition Exception.hh:291
virtual ~MissingKeys()
Definition Exception.cc:550
virtual ~ModuleRunTimeError()
virtual ~MultipleInstancesFound()
Definition Exception.cc:847
virtual ~NoKnownConversion()
virtual ~NonexistingChild()
Definition Exception.cc:793
virtual ~NonexistingSyscall()
virtual ~NotAvailable()
virtual ~NotChunkable()
Definition Exception.hh:359
virtual ~NumberFormatException()
Definition Exception.cc:576
virtual ~ObjectAlreadyExists()
virtual ~ObjectNotInitialized()
Definition Exception.cc:902
virtual ~ObjectStateLoadingException()
Definition Exception.cc:765
virtual ~OutOfRange()
Definition Exception.hh:326
virtual ~ParserStopRequest()
Definition Exception.cc:682
virtual ~PathNotFound()
Definition Exception.cc:353
std::string path() const
std::string path_
Definition Exception.hh:255
virtual ~RelationalDBException()
Definition Exception.cc:984
virtual ~ScriptExecutionFailure()
Definition Exception.cc:929
virtual ~SerializerException()
Definition Exception.cc:957
virtual ~SimulationException()
virtual ~SimulationExecutionError()
virtual ~SimulationStillRunning()
virtual ~SimulationTimeOut()
virtual ~StartTooLate()
virtual ~SymbolNotFound()
Definition Exception.cc:875
virtual ~TypeMismatch()
virtual ~UnexpectedValue()
Definition Exception.cc:628
virtual ~UnreachableStream()
Definition Exception.cc:244
virtual ~UnresolvedReference()
Definition Exception.hh:376
virtual ~WritePastEOF()
Definition Exception.cc:299
virtual ~WrongOperandType()
virtual ~WrongSubclass()
Definition Exception.hh:342